Repository navigation
fix(rust): credit or name the limit for a helper that forwards the test's closure (#9981) - #13856
Conversation
…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
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning Review limit reachedEnable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
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. View limit details
|
|
The Generated by Claude Code |
…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
…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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLSoNkcHb5xqvctzMo3
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
|
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.
Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
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
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
ripr static exposure checkCommit 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
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLSoNkcHb5xqvctzMo3
EffortlessSteven
left a comment
There was a problem hiding this comment.
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
left a comment
There was a problem hiding this comment.
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_helperintegration tests pass locally. cargo fmt --checkis clean.- The remaining closures (
credits(*reason)andtest.assertions.is_empty() && ...forwarded_callback_limit) contain neither.missnorRelatedTestMiss, so the guard'sreads_missscan 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
|
|
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLSoNkcHb5xqvctzMo3
EffortlessSteven
left a comment
There was a problem hiding this comment.
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
observestage. - Our forwarded-limit swap changes only the observe/discriminate summary text, never the state. So
observe.state == Noand theclassify(...)result are unchanged, and #12900's predicate is unaffected.
Checks:
forwarded_closure_helperpasses 6/6 after the merge.cargo fmt --checkis 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
…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
|
The Rust-only feature lane on 7c8378b failed only in Root cause: the test helper 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 |
…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
left a comment
There was a problem hiding this comment.
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: theelse if passes_call_making_closurebranch 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 throughsame_file_forward_target;ForwardTarget::NeverRuns(a_or never-mentioned parameter) lends nothing and names nothing;Unestablishedrecords the limit only when a role-admitted assertion follows the forward.crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs:forwarded_callback_paramsrequires the parameter's only identifier mention to be a bare argument of an eagerly reached statement call, andcall_making_closure_positionscounts 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 onmiss == NoAssertion && oracle.is_none(), andonly_limitsreads 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
left a comment
There was a problem hiding this comment.
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 throughsame_file_forward_target;ForwardTarget::NeverRuns(a_or never-mentioned parameter) lends nothing and names nothing;Unestablishedrecords the limit only when a role-admitted assertion follows the forward.crates/ripr/src/analysis/syntax/ra/closure_callbacks.rs:forwarded_callback_paramsrequires the parameter's only identifier mention to be a bare argument of an eagerly reached statement call;call_making_closure_positionsalso 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 onmiss == NoAssertion && oracle.is_none(), andonly_limitsreads 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.
|
Disposition: parked, not merge-ready. This PR is CONFLICTING with 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. |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLSoNkcHb5xqvctzMo3
EffortlessSteven
left a comment
There was a problem hiding this comment.
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'smodule_path_targetsplus this PR'sparam_never_mentioned.classifier/evidence.rs: theclassify::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
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_unprovenlimit instead of the false "has no assertion" / "Add a meaningful assertion".Design decision (RIPR-SPEC-0197, "Forwarded closure callbacks")
no_assertionrows with no oracle become the existingassertion_admission_unprovenmiss (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).Residual (not covered)
fields.rshelper's only check ishandle.assert_finished(), which is not a parser-backed assertion, so its tests still readno_assertion. The spec records this.&fun,fun.clone(), a macro argument or a branch keeps the old reading.Proof
crates/ripr/tests/forwarded_closure_helper.rscovers:new_span(span)builder shape with an added assertion;facts/test_helpers/tests.rsandsyntax/ra/closure_callbacks/tests.rscouldn't be built locally because the container OOM-kills the lib-test build, so hosted CI is their first run.cargo check -p ripr,cargo fmt --check,goldens check,check-user-text,check-local-context,check-spec-format,check-static-languageandcheck-traceability.agent_command_journeypasses 16/16.🤖 Generated with Claude Code
https://claude.ai/code/session_01UNUoLSoNkcHb5xqvctzMo3