Skip to content

fix(rust): credit or name the limit for a helper that forwards the test's closure (#9981) - #13856

Merged
EffortlessSteven merged 11 commits into
mainfrom
claude/rust-9981-forwarded-closure
Nov 15, 2026
Merged

EffortlessSteven merged 11 commits into
mainfrom
claude/rust-9981-forwarded-closure

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 8, 2026 •

Copy link
Copy Markdown
Member

Requested by Steven Zimmerman · project thread

Governing issue or accepted claim: #9981

Acceptance delta (one sentence): A same-file helper that forwards the test's closure to a same-file invoker now lends its later assertions (one hop), and a helper with a recognized parser-backed assertion after forwarding the closure into an unresolved callee reads a named assertion_admission_unproven limit instead of the false "has no assertion" / "Add a meaningful assertion".

Design decision (RIPR-SPEC-0197, "Forwarded closure callbacks")

  1. Same-file forward, credited, one hop. The forwarded parameter is chosen by the test's single call-making closure position. A closure that calls only through a macro counts as call-making, and two such positions fail closed. The helper passes that parameter bare to a call it always reaches, and that is the parameter's only mention. The receiver is a single same-file evidence-helper function in the test's module that always invokes that parameter. The PR credits the helper's assertions after the forward and the receiver's assertions after its invocation. Re-forwarding, conditional invocation, never invoking, and a receiver that never names its parameter are not followed.
  2. Unresolved forward, named limit and never credit. The forward goes to an external call, a qualified path, a method, or a same-file function outside the rule, and the helper still has a recognized parser-backed assertion afterwards. In that case the no_assertion rows with no oracle become the existing assertion_admission_unproven miss (RIPR-SPEC-0221), with an evidence line naming the helper and the callee. When those rows are the finding's only assertions, the observe/discriminate stages use the existing refused-assertion-context summaries, so the next step stops saying "Add a meaningful assertion". Oracle, strength and class are unchanged (no promotion).
  3. The old pinned negative actually forwarded to a same-file invoker and is now a positive. The never-invoked (rust: a helper that takes a closure parameter and asserts without ever invoking it still gives its assertion to the calling test as the oracle #9997) negatives are unchanged.

Residual (not covered)

  • The literal tracing fields.rs helper's only check is handle.assert_finished(), which is not a parser-backed assertion, so its tests still read no_assertion. The spec records this.
  • Forwarding through &fun, fun.clone(), a macro argument or a branch keeps the old reading.
  • The repair-start "still missing: a test assertion" line is unchanged.
  • The direct-invocation rule's macro-closure gap is pre-existing and recorded in the spec.

Proof

  • crates/ripr/tests/forwarded_closure_helper.rs covers:
    • the same-file forward against the direct-invocation reference, including beside a bare-forwarded non-closure value;
    • unresolved forwards, including the tracing new_span(span) builder shape with an added assertion;
    • mixed findings with a genuine no-assertion test and with a test that has an oracle;
    • a receiver that never names its parameter, and the never-invoked control.
  • Lib unit tests in facts/test_helpers/tests.rs and syntax/ra/closure_callbacks/tests.rs couldn't be built locally because the container OOM-kills the lib-test build, so hosted CI is their first run.
  • Pass locally: cargo check -p ripr, cargo fmt --check, goldens check, check-user-text, check-local-context, check-spec-format, check-static-language and check-traceability. agent_command_journey passes 16/16.
  • Independent fresh-context review: no blockers on the first pass or the re-review. Its follow-ups are in this PR.

🤖 Generated with Claude Code

https://claude.ai/code/session_01UNUoLSoNkcHb5xqvctzMo3

…ved forwards (#9981)

A same-file test helper that forwards the test's closure instead of
invoking it (`let got = with_default(fun); assert_eq!(got, want);`) now
lends its later assertions when the receiving call is a same-file
function of the test's module whose plain body eagerly invokes exactly
that parameter (one hop, reusing invoked_callback_params). The
receiving function's own assertions after its invocation are credited
too. Everything else stays fail-closed.

When the helper forwards to a call ripr cannot resolve (tracing's
`with_default(subscriber, fun)`, a qualified path or a method) and still
asserts afterwards, nothing is credited. The helper-credit pass records a
transient per-test limit instead. The classifier then turns that row's
false `no_assertion` into the analyzer-limit miss
`assertion_admission_unproven` and adds one evidence line naming the
helper and callee. Oracle, strength, stages and class are unchanged, so
no verdict can rise from this path.

The former #9997 pinned negative
(plain_helper_that_only_forwards_a_closure_parameter_lends_nothing)
forwarded to a same-file invoker. It is now an intended positive and
has been renamed.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLSoNkcHb5xqvctzMo3
…ion (#9981)

A finding's related tests may hold no assertion other than a forwarded
helper's: every rewritten row reads `assertion_admission_unproven`, no
`no_assertion` row is left, and no row carries an oracle. Previously such a
finding still said "No assertion found on related tests" and told the reader
to "Add a meaningful assertion". Now, when the observe and discriminate
stages carry exactly the no-assertion summaries, they are replaced by the
existing refused-context pair (rust_assertion_context_unestablished). Both
stages stay `no`. The existing consumers then give the refused-assertion next
step and drop the "No detected assertion" missing line.

No refusal marker is set, so the class is not rewritten. The never-invoked
control, and any finding with another no-assertion row, keep the old
wording. name_forwarded_callback_limits now runs before stage assembly and
returns its evidence lines and the `only_limits` predicate. The three stage
summaries are now named constants in reveal.rs. The integration test now
asserts the next step, the stage summaries and the missing lines for both the
external case and the control.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01UNUoLSoNkcHb5xqvctzMo3
@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 Nov 8, 2026
@coderabbitai

coderabbitai Bot commented Nov 8, 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 4 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 146 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: b73c537c-b2bd-41a0-97ba-ce010ce99862
Commits

Reviewing files that changed from the base of the PR and between 60114de and 162eb42.

Files selected for processing: 15

  • .ripr/traceability.d/9981-forwarded-closure-helper.toml
  • changelog.d/9981-forwarded-closure-helper.md
  • crates/ripr/src/analysis/classifier/evidence.rs
  • crates/ripr/src/analysis/classify/mod.rs
  • crates/ripr/src/analysis/classify/refusal_miss.rs
  • crates/ripr/src/analysis/classify/reveal.rs
  • crates/ripr/src/analysis/facts/index.rs
  • crates/ripr/src/analysis/facts/test_helpers.rs
  • crates/ripr/src/analysis/facts/test_helpers/tests.rs
  • crates/ripr/src/analysis/syntax/mod.rs
  • crates/ripr/src/analysis/syntax/ra.rs
  • crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs
  • crates/ripr/src/analysis/syntax/ra/closure_callbacks/tests.rs
  • crates/ripr/tests/forwarded_closure_helper.rs
  • docs/specs/RIPR-SPEC-0197-owner-return-pins.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Copy link
Copy Markdown
Member Author

The spec-maintenance-digest failure on d8087df isn't from this PR. Main itself doesn't compile: crates/ripr/src/output/format.rs:450 has a non-exhaustive match that is missing OutputFormat::MissedTxt, which comes from two independently merged output changes. #13848 is the open fix. This PR is still in independent review. Once #13848 lands, I'll merge main in before labeling.


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 focused proof failure resolved before upstream.

Test proof

  • Focused HEAD proof failed (exit 101): cargo test --locked --package ripr --test agent_command_journey. This is a current failure, not a red/green witness.

…vers (#9981)

Review follow-ups on the forwarded-closure helper rule.

- A, B: the rule required exactly one bare-forwarded parameter. The real
  tracing helper also forwards `span` (`subscriber::mock().new_span(span)`),
  and `let s = make(want); with_default(s, fun);` forwards `want`, so neither
  shape was credited or named. The rule now selects the forwarded parameter
  at the test's single call-making closure position. Other bare-forwarded
  parameters are ordinary values. The one-position call-making-closure check
  still guards against a second, never-run closure.
- D: a same-file receiver that passes every resolution check but never names
  its parameter (`_` or an unused name) never runs the closure. It is now
  read like the never-invoked control: no credit and no limit. The new
  `param_never_mentioned` syntax helper decides this.
- C: integration controls for mixed findings. With a genuine `no_assertion`
  test beside a forwarded-limit test, only the forwarded row is rewritten and
  the finding keeps its no-assertion summaries and next step. With an
  oracle-bearing test beside it, class, oracle, stages and next step match
  the reference.
- Spec and changelog now say the limit covers helpers with a recognized
  assertion after the forward. They state the `handle.assert_finished()` gap
  of the literal tracing helper as a remaining residual. No method-name
  oracle is added.

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

@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 focused proof failure resolved before upstream.

Test proof

  • Focused HEAD proof failed (exit 101): cargo test --locked --package ripr --test agent_command_journey. This is a current failure, not a red/green witness.

…eck (#9981)

`call_making_closure_positions` only counted closures whose bodies hold
real call expressions. So `run_test(|| my_macro!(greet("bob")), || noop())`
counted position 1 alone. If position 0 went to an external sink and
position 1 to a same-file invoker, the helper's assertions were credited
while the owner call sat in the never-run closure.

For this forwarding-credit position check only, a closure whose body holds
a macro call now counts too, whether literal or bound by `let`. That case
now yields two positions, so the rule fails closed. Callers choose the
reading with a `CountsMacros` flag. The #9997 withholding reading
(`passes_call_making_closure`) and the direct-invocation rule's
`closure_argument_positions` are unchanged. The spec records the latter's
matching gap as a pre-existing residual.

Adds a syntax unit test for the positions and a facts unit case for the
external-sink/same-file-invoker shape.

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

@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 focused proof failure resolved before upstream.

Test proof

  • Focused HEAD proof failed (exit 101): cargo test --locked --package ripr --test agent_command_journey. This is a current failure, not a red/green witness.

Identical to the format.rs hunk in #13848; merges cleanly when it lands.

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

Copy link
Copy Markdown
Member Author

Update after an independent review. The first pass found no blockers, and its follow-ups are on this branch. The re-review of 0d86b19 also found no blockers.

  • Forwarded parameter selection. The forwarded parameter is now chosen by the test's single call-making closure position, so other bare-forwarded values such as new_span(span) or make(want) no longer block the rule. The literal tracing helper's only check is handle.assert_finished(), which is not a parser oracle, so it still reads no_assertion. That residual is recorded in the spec, and the changelog is scoped to helpers with a recognized assertion after the forward.
  • Mixed-finding integration tests:
    • a forwarded-limit test next to a genuine no_assertion test keeps the finding's wording;
    • a forwarded-limit test next to a test with an oracle leaves the finding unchanged.
  • Same-file receiver that never names its parameter (_f, _) is treated like the never-invoked control, with no limit recorded.
  • Closures that call only through a macro now count as call-making for forwarding positions, so a helper that receives two such closures earns nothing (it fails closed). The matching gap in the existing direct-invocation rule is recorded as a residual.
  • Main merged in (1a67d93), plus a port of fix(output): classify missed-txt in is_json_request so main compiles #13848's identical MissedTxt arm so the tree compiles while main is broken.
  • Verification. cargo check -p ripr passes. forwarded_closure_helper passes 5/5. agent_command_journey passes 16/16 locally on both heads, so the advisory bot's failure doesn't reproduce here.

Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 8, 2026 20:12

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

SOURCE_REVIEW_READY — head 1a67d93

An independent fresh-context review covered fail-open paths, the limit path, transient index state and test compilability. Its fixes landed in 0d86b19 and b093607, and its re-review found no blockers. This head adds a merge of main and the #13848 format.rs arm.


Generated by Claude Code

@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 2 potential issues.

Devin Review

@github-actions

github-actions Bot commented Nov 8, 2026 •

Copy link
Copy Markdown
Contributor

ripr static exposure check

Commit 7c8378b831d5 · run · advisory, static evidence only (not a mutation run).

#ripr agent static-advisory base=8a5ce92b9ae5d25fd2a72aad6509bcf3d99f9477 findings=346 gaps=11 infection_unknown=14 propagation_unknown=9 reachable_unrevealed=11 static_unknown=158 weakly_exposed=154
analysis=incomplete|outcome=partial_with_limitations
limitation=diff_scope_oversized|reason=The run analyzed 974 changed line(s) and left at least 462 changed line(s) outsi…|recovery=To widen the analyzed partition, raise RIPR_PARTIAL_DIFF_LINE_BUDGET to at least 1003 (1436 to select the whole diff), then re-run.
reachable_unrevealed|crates/ripr/src/analysis/classifier/evidence.rs:1838|super::super::classify::name_forwarded_callback_limits(context, &mut related_tes…|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_analysis_classifier_evidence.rs:call_deletion:2da89314
reachable_unrevealed|crates/ripr/src/analysis/classifier/evidence.rs:1872|evidence.extend(forwarded.evidence)|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t1|id=probe:crates_ripr_src_analysis_classifier_evidence.rs:call_deletion:f46d1ea7
reachable_unrevealed|crates/ripr/src/analysis/facts/index.rs:770|self.forwarded_callback_limits .retain(\|(file, _, _), _\| file.as_path() != path)|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t2|id=probe:crates_ripr_src_analysis_facts_index.rs:call_deletion:37df143b
reachable_unrevealed|crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs:237|let parse = parse_clean_source_file(test_text)?;|missing=No exact error variant discriminator was detected|test=t3|id=probe:crates_ripr_src_analysis_syntax_ra_closure_callbacks.rs:error_path:9b964a5d
reachable_unrevealed|crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs:240|.tree()|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t3|id=probe:crates_ripr_src_analysis_syntax_ra_closure_callbacks.rs:call_deletion:f2921d9c
reachable_unrevealed|crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs:241|.syntax()|missing=No statically established oracle: assertion execution or macro binding is unesta…|test=t3|id=probe:crates_ripr_src_analysis_syntax_ra_closure_callbacks.rs:call_deletion:cd92c68a
t1=crates/ripr/src/analysis/classifier/evidence.rs:3465 a_credited_zero_argument_test_keeps_infection_beside_a_withheld_sibling unknown miss=assertion_admission_unproven
t2=crates/ripr/src/analysis/facts/index_tests.rs:300 flat_slot_identity_survives_reordering_compaction_and_repeated_membership unknown miss=assertion_admission_unproven
t3=crates/ripr/src/analysis/syntax/ra/closure_callbacks/tests.rs:1064 forwarding_positions_count_closures_whose_body_holds_a_macro unknown miss=assertion_inert
+5 more gaps not shown; `--format json` lists all
limits=infection_unknown:14,propagation_unknown:9,static_unknown:158,weakly_exposed:154
next=ripr explain --root . --base 8a5ce92b9ae5d25fd2a72aad6509bcf3d99f9477 --committed --mode draft --format agent probe:crates_ripr_src_analysis_classifier_evidence.rs:call_deletion:2da89314
verify=refused|outcome=partial_with_limitations|findings=346|exposed=0|reason=analysis_incomplete,gaps_remain,partial_scope

Took 111s.

only_limits read the capped eight-row display slice, so an assertion-free
or oracle-bearing related test omitted by the window could let the finding
drop its "add an assertion" guidance. Decide it from the full related-test
set: every oracle-crediting related test must be a forwarded-limit test with
no assertion of its own. The capped rows are still the only rows rewritten.

Adds an integration regression with nine related tests (eight visible
forwarded-limit rows and an omitted assertion-free test).

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

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

SOURCE_REVIEW_READY — head 29b53a5

Changes since the last attestation:

  • the Devin capped-rows finding is fixed in 201944a, with a regression test and a mutation check;
  • main, which now includes #13848, is merged in.

Locally cargo check -p ripr passes and forwarded_closure_helper passes 6/6. The independent re-review found no blockers.


Generated by Claude Code

The only_limits decision re-read each row's miss inside an .all closure,
which the related-test role guard (decision_helpers_never_branch_on_the_miss)
rejects. The rewrite loop now records whether any row carries an oracle or
keeps an unrewritten no_assertion miss, and the decision reads that flag.
Same predicate, no closure branching on the miss.

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

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

SOURCE_REVIEW_READY — head c3ae21a

Delta since 29b53a5: the Rust-only feature lane failed output::related_test_role_tests::decision_helpers_never_branch_on_the_miss. The guard rejects any eligibility closure that reads .miss, and only_limits in refusal_miss.rs did .all(|row| row.oracle.is_none() && row.miss != Some(NoAssertion)).

Fix (c3ae21a): the rewrite loop now records rows_clear. It goes false when a row carries an oracle, or when a no_assertion row has no forwarded limit and so stays unrewritten. The decision reads that flag. Rewritten rows are exactly no-oracle no_assertion rows that have a limit, so the predicate is unchanged.

What I checked:

  • The six forwarded_closure_helper integration tests pass locally.
  • cargo fmt --check is clean.
  • The remaining closures (credits(*reason) and test.assertions.is_empty() && ...forwarded_callback_limit) contain neither .miss nor RelatedTestMiss, so the guard's reads_miss scan no longer matches.
  • I did not run the lib test locally, because a lib-test build OOMs in this container. Hosted CI re-runs it.
  • origin/main (ab93e28) is already an ancestor of this head.

Generated by Claude Code

@github-actions

github-actions Bot commented Nov 8, 2026

Copy link
Copy Markdown
Contributor

merge-ready is set, but this PR conflicts with main (head c3ae21a2), so GitHub creates no test-merge ref and no qualification run can start. Merge main into the branch and resolve the conflicts, then remove and re-apply merge-ready.

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

SOURCE_REVIEW_READY — head 7c8378b

What changed since c3ae21a: a merge of origin/main, resolving one conflict in classifier/evidence.rs.

The conflict: this PR adds evidence.extend(forwarded.evidence), and #12900 on main adds its proximity-reach-of-tested-caller note at the same spot. I kept both, ours first.

Why that is safe:

  • Main's block reads the final observe stage.
  • Our forwarded-limit swap changes only the observe/discriminate summary text, never the state. So observe.state == No and the classify(...) result are unchanged, and #12900's predicate is unaffected.

Checks:

  • forwarded_closure_helper passes 6/6 after the merge.
  • cargo fmt --check is clean.
  • c3ae21a had the Rust-only feature lane, Rust gates and the Windows gate all green before main moved.
  • All review threads are resolved.

Generated by Claude Code

EffortlessSteven pushed a commit that referenced this pull request Nov 8, 2026
…gest cache

reset_disk_equality_read_cache_for_tests cleared the process-wide digest
cache. The lib tests run in parallel, so one test's reset could evict
another test's entry between its two lookups:
same_length_buffer_checks_read_unchanged_disk_once then counted 2 reads
instead of 1 (seen on #13885 and #13856 hosted lanes). Each test digests
its own per-thread temp path, so the reset now clears only this thread's
read counter.

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

Copy link
Copy Markdown
Member Author

The Rust-only feature lane on 7c8378b failed only in lsp::backend::disk_bytes_equal_text_tests::same_length_buffer_checks_read_unchanged_disk_once ("expected 1 disk reads, got 2"). This PR touches no LSP code, and the same test failed on #13885.

Root cause: the test helper reset_disk_equality_read_cache_for_tests() clears the process-wide digest cache. When a parallel test runs it, it can evict this test's entry between its two lookups.

Fix: #13912 changes the reset to clear only the calling thread's counter. The same PR also fixes main's current E0063 lib-test compile break, caused by #13874 and #13758 together.

Once #13912 merges, I'll merge main into this branch and re-request CI.


Generated by Claude Code

EffortlessSteven added a commit that referenced this pull request Nov 9, 2026
…e in the LSP disk-equality tests (#13912)

* fix(output): add owner_opt_outs to the #13618 nested-package render test so lib tests compile

#13874 added CheckOutput::owner_opt_outs while #13758 added a test
initializer without it; main's lib-test build fails with E0063 at
output/human.rs:9236.

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

* test(lsp): stop disk-equality test resets from clearing the shared digest cache

reset_disk_equality_read_cache_for_tests cleared the process-wide digest
cache. The lib tests run in parallel, so one test's reset could evict
another test's entry between its two lookups:
same_length_buffer_checks_read_unchanged_disk_once then counted 2 reads
instead of 1 (seen on #13885 and #13856 hosted lanes). Each test digests
its own per-thread temp path, so the reset now clears only this thread's
read counter.

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

---------

Co-authored-by: Claude <noreply@anthropic.com>

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

SOURCE_REVIEW_READY — head 7c8378b

VERDICT: APPROVE 7c8378b — no blocking findings on this head.

Exact head read: 7c8378b831d503d983a153504d3de2237b192942 (tree d7e2429d is not this PR; this head's tree is the merge of origin/main at 29b53a5d). Base 8a5ce92b. 15 files, +1530/−52. This is the same head I attested at 2026-11-08T22:38Z; the head has not moved since, so this review adds the terminal marker the earlier attestation lacked and re-checks the hosted state.

What the change does. A plain same-file helper that forwards the test's closure (let got = with_default(fun); assert_eq!(got, want);) now lends its later assertions when the receiving call resolves to a same-file function whose plain body eagerly invokes that parameter (one hop). When the receiver is not resolvable that way, no credit is given; the row's false no_assertion becomes assertion_admission_unproven with one evidence line naming helper and callee, and the finding-level "add an assertion" guidance is replaced only when every oracle-crediting related test is such a limit.

Guards that carry the claim.

  • crates/ripr/src/analysis/facts/test_helpers.rs: the else if passes_call_making_closure branch now selects the forwarded parameter by the test's single call-making-closure position, requires the call to be eagerly reached, and resolves the receiver through same_file_forward_target; ForwardTarget::NeverRuns (a _ or never-mentioned parameter) lends nothing and names nothing; Unestablished records the limit only when a role-admitted assertion follows the forward.
  • crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs: forwarded_callback_params requires the parameter's only identifier mention to be a bare argument of an eagerly reached statement call, and call_making_closure_positions counts macro-bearing closures so a second, never-run closure cannot carry the owner call.
  • crates/ripr/src/analysis/classify/refusal_miss.rs: the rewrite is gated on miss == NoAssertion && oracle.is_none(), and only_limits reads the full related-test set, not the eight-row display window.

Falsifier. The integration test forwarding_to_a_same_file_invoker_reads_like_direct_invocation compares the forwarded shape against the direct-invocation reference on oracle text, class, strength and miss; without the credit the forwarded row would have no oracle and would differ. forwarding_to_an_unresolved_callee_names_the_limit_instead_of_no_assertion asserts the never-invoked control keeps no_assertion and the "Add a meaningful assertion" step while the unresolved forward reads assertion_admission_unproven with the named evidence line; without the rewrite the row would still read no_assertion. The mixed controls pin that a genuine no_assertion test and an oracle-bearing test keep the finding wording. I did not re-run these tests in this pass; the earlier pass ran forwarded_closure_helper 6/6 at this head.

Hosted state at this head (run 42531228682, 2026-11-08). Rust gates pass, all four Rust test shards pass, Windows gate passes, admission passes. Two checks are red: the Rust-only feature lane failed on lsp::backend::disk_bytes_equal_text_tests::same_length_buffer_checks_read_unchanged_disk_once with "expected 1 disk reads, got 2" — the same test passed in shard 4 of the same run at the same commit, and it is outside every file this PR touches, so I read it as an unrelated flake; and Ripr Rust Small Result failed on ELIGIBILITY_RESULT: failure (history-sync evidence), not on a test.

Qualifications this head still lacks. The PR is CONFLICTING against current main (the MissedTxt arm in output/format.rs and the evidence.rs merge point), so it needs a restack before the merge route can qualify it. There is no merge-ready label and no current-head qualification run; the hosted evidence above is five days old and predates the current main. Base movement alone does not change this source verdict.

Residual, non-blocking. The literal tracing helper asserts only through handle.assert_finished(), a method call that is not a parser-backed oracle, so it still reads no_assertion; the spec records this. The direct-invocation rule's closure_argument_positions still does not inspect macro-only closure bodies, also recorded as pre-existing.

All review threads on this PR are resolved.

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

SOURCE_REVIEW_READY

VERDICT: APPROVE 7c8378b - no blocking findings on this head.

Exact head read: 7c8378b831d503d983a153504d3de2237b192942, base 8a5ce92b, 15 files, +1530/-52. This is the head I attested at 2026-11-08T22:38Z; it has not moved since, so this review adds the terminal marker that attestation lacked and re-checks the hosted state. Review id 5897320799 above is a mis-posted copy of this text with a broken first line; submitted reviews cannot be deleted, and this one is the current one.

What the change does. A plain same-file helper that forwards the test's closure (let got = with_default(fun); assert_eq!(got, want);) now lends its later assertions when the receiving call resolves to a same-file function whose plain body eagerly invokes that parameter (one hop). When the receiver is not resolvable that way, no credit is given; the row's false no_assertion becomes assertion_admission_unproven with one evidence line naming helper and callee, and the finding-level "add an assertion" guidance is replaced only when every oracle-crediting related test is such a limit.

Guards that carry the claim.

  • crates/ripr/src/analysis/facts/test_helpers.rs: the plain-helper branch selects the forwarded parameter by the test's single call-making-closure position, requires the call to be eagerly reached, and resolves the receiver through same_file_forward_target; ForwardTarget::NeverRuns (a _ or never-mentioned parameter) lends nothing and names nothing; Unestablished records the limit only when a role-admitted assertion follows the forward.
  • crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs: forwarded_callback_params requires the parameter's only identifier mention to be a bare argument of an eagerly reached statement call; call_making_closure_positions also counts macro-bearing closures so a second, never-run closure cannot carry the owner call.
  • crates/ripr/src/analysis/classify/refusal_miss.rs: the rewrite is gated on miss == NoAssertion && oracle.is_none(), and only_limits reads the full related-test set, not the eight-row display window.

Falsifier. forwarding_to_a_same_file_invoker_reads_like_direct_invocation compares the forwarded shape against the direct-invocation reference on oracle text, class, strength and miss; without the credit the forwarded row has no oracle and differs. forwarding_to_an_unresolved_callee_names_the_limit_instead_of_no_assertion asserts the never-invoked control keeps no_assertion and the "Add a meaningful assertion" step while the unresolved forward reads assertion_admission_unproven with the named evidence line; without the rewrite the row still reads no_assertion. The mixed controls pin that a genuine no_assertion test and an oracle-bearing test keep the finding wording. I did not re-run these tests in this pass; the earlier pass ran forwarded_closure_helper 6/6 at this head.

Hosted state at this head (run 42531228682, 2026-11-08). Rust gates pass, all four Rust test shards pass, Windows gate passes, admission passes. Two checks are red: the Rust-only feature lane failed on lsp::backend::disk_bytes_equal_text_tests::same_length_buffer_checks_read_unchanged_disk_once with "expected 1 disk reads, got 2"; that same test passed in shard 4 of the same run at the same commit and sits outside every file this PR touches, so I read it as an unrelated flake. Ripr Rust Small Result failed on ELIGIBILITY_RESULT: failure (history-sync evidence), not on a test.

Qualifications this head still lacks. The PR is CONFLICTING against current main (the MissedTxt arm in output/format.rs and the evidence.rs merge point), so a restack is needed before the merge route can qualify it. No merge-ready label and no current-head qualification run exist; the hosted evidence above is five days old and predates current main. Base movement alone does not change this source verdict.

Residual, non-blocking. The literal tracing helper asserts only through handle.assert_finished(), a method call that is not a parser-backed oracle, so it still reads no_assertion; the spec records this. The direct-invocation rule's closure_argument_positions still ignores macro-only closure bodies, also recorded as pre-existing.

All review threads on this PR are resolved.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Disposition: parked, not merge-ready.

This PR is CONFLICTING with main at head 7c8378b8, so it cannot pass late qualification or land as-is. The merge-ready label was removed on 2026-11-14.

Owner: coding ripr-swarm. Revisit by 2026-11-21, or close it earlier as superseded if another candidate lands the same issue. No code was rejected here; this records the unowned state rather than leaving it silent.

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

SOURCE_REVIEW_READY — head 162eb42

Delta since 7c8378b: one merge commit bringing in origin/main at 60114de. It includes #13912, which fixes the E0063 build break and the LSP disk-equality race. Both are the failures that were blocking this PR.

The merge had two conflicts, and both were import lists. In each I kept the union of the two sides and let cargo fmt sort them:

  • analysis/syntax/mod.rs: main's module_path_targets plus this PR's param_never_mentioned.
  • classifier/evidence.rs: the classify:: imports.

No logic hunks conflicted.

After the merge, forwarded_closure_helper passes 6/6, and the build shows no warnings or errors. The earlier approvals of 7c8378b still cover the source, because nothing outside the merge has changed. All review threads are resolved. This replaces the parked disposition from 2026-11-14.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 15, 2026
Merged via the queue into main with commit e23d892 Nov 15, 2026
21 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/rust-9981-forwarded-closure branch November 15, 2026 21:17
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