Repository navigation
test(rust): pin that weakly_exposed owner-named tests keep their gap, not the reach limit (#11481) - #11938
Conversation
… not the reach limit (#11481) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzVWk9FoK366FfhytUg
|
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 12 minutes. View limit details
|
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head decfba5): REVIEW_INCOMPLETE
Inspected:
- PR #11938 (draft, no labels), head
decfba5bba511fa0a2d8cc897481983cb2b03705, basefdf285a8b44867b85c326a147fe6927ed912020e(the currentmaintip; thefa621a32tip named in the brief is older). 5 files, +73/-4. - Governing issue #11481 (open) and the implementing PR #11606 (closed, "name the reach limit for infection_unknown findings related only by proximity or owner name"). The body's citation "#11606 could admit it" is accurate; the
weakly_exposedfollow-up was never an open issue, only a "follow-up" clause in RIPR-SPEC-0117. #11481's own acceptance (extend toinfection_unknown) is already delivered by #11606, so this PR is a decision-pinning follow-up rather than a new slice — consistent with the body, and I found no stale premise in it. - Semantic owner of the changed behavior:
needs_proximity_reach_limit,crates/ripr/src/analysis/language/rust/mod.rs:1457-1483at headdecfba5. The only production edit is the comment at :1472-1478; the gate itself (:1469-1482) is unchanged, so "Class, reach credit, actionability and all output unchanged" is accurate. - Consumers of that decision:
apply_rust_no_static_path_limit(mod.rs:1499-1581) ->apply_rust_proximity_reach_limit(:1639-1708) ->apply_rust_transitive_reach_limit(:1712-1741) /apply_rust_macro_reach_limit(:1745-1760). The "do not extend" behavior is structural, not a separate rule:RelationReason::is_proximity_only(crates/ripr/src/domain/evidence.rs:260-265) covers onlySameTestFile | SameModule | WeakTokenSubstring, soOwnerNamedTestis excluded from the proximity set and themod.rs:1479-1480arm is the only place that re-admits it — and only forInfectionUnknown. - New test and helper:
crates/ripr/src/analysis/language/rust/proximity_reach_tests.rs:1702-1756at head, helperweak_assertion_fixture:1710-1719. - Fixture construction checked against the shared fixture
MACRO_ROUTED(proximity_reach_tests.rs:108-126): thestr::replacetarget"fn outer_triples() {\n assert_eq!(outer(4), 12);"occurs verbatim inMACRO_ROUTED(4-space indent beforefn, 8-space beforeassert_eq!), so the rename/weak-assert substitution actually fires. If it stopped matching, the fixture would become the unmodifiedouter_triplesshape, whose relation isSameTestFile(proximity-only), andall_relations(&named, ... OwnerNamedTest)at :1728-1730 would fail loudly — the fixture cannot pass for the wrong reason. - Oracle strength of the new pair, read against the semantic owner:
assert!(!super::needs_proximity_reach_limit(&named))(:1737) andassert_unlimited(&named, ...)(:1738; helper :1346-1355, which pinsstatic_limit_kind == Noneand the absence ofTransitiveReachUnresolved/MacroReachUnresolvedstop reasons) both fail if the admission is extended toweakly_exposed:mod.rs:1479-1480would then match,apply_rust_proximity_reach_limitwould set astatic_limit_kindand pushStopReason::MacroReachUnresolved(:1674-1707, :1745-1760), and both assertions would trip. The proximity twin (:1742-1754) pins the opposite outcome on the otherwise identical fixture, so the relation alone decides the result. This is a genuine positive/discriminating pair, not a self-confirming restatement of the implementation. - Credited-oracle assumption behind :1731-1736:
oracle_crediting_relations(crates/ripr/src/analysis/classify/reveal.rs:5433-5443) lets a loneOwnerNamedTestrelation credit its oracle (it credits unless a reach-bearing related test exists), andcredits_oracle = credits(*reason) && !unrelated_proximity(reveal.rs:2340) withunrelated_proximityrequiringowner_reaching_related(reveal.rs:2295-2299), which excludes name-only relations. So a lone owner-named row may credit its weak assertion, and the assertedoracle.is_some() && oracle_strength == Weakis consistent with the rule as implemented. - Precedents in the same file:
proximity_only_reach_through_a_macro_names_the_macro_limit(:136-182) — the sameMACRO_ROUTEDshape yields classWeaklyExposed, one related test,static_limit_kind = RustMacroReachUnresolvedandfinding.missing == [RustMacroReachUnresolved];a_same_named_function_in_another_module_is_witnessed_by_name_only_known_limit(:1362-1383) — a same-file owner-named fixture resolves toOwnerNamedTestrather thanSameTestFile(:1372-1374), the relation precedence the new test depends on;the_owner_named_admission_is_limited_to_infection_unknown_all_owner_named(:1409-1443) is the synthetic white-box counterpart this PR replaces with a natural fixture. - Repo conventions, checked against merged practice:
changelog.d/11481-weakly-exposed-owner-named-decision.mdis added with the<!-- section: Internal / CI -->header used by sibling fragments; both specs are reworded (docs/specs/RIPR-SPEC-0114-rust-transitive-reach-limitation.md:105,docs/specs/RIPR-SPEC-0117-rust-macro-reach-limitation.md:179-186), and RIPR-SPEC-0117:721 adds the new test to that spec's anchor list..ripr/traceability.tomlis NOT updated, but the immediate siblings of this test are likewise absent from that file, so the spec anchor list is the registration mechanism this family uses.
Blocking:
No source defect found. What stands between this candidate and REVIEW_READY is hosted proof only. #11938 is a Draft with no labels, so every Rust lane reported skipped for head decfba5 (runs 41247693804 CI, 41247693707 Coverage, 41247693795 Security, 41247693705 Future Clippy (advisory), 41247693765 Windows Advisory, 41247693752 macOS Advisory, all created 2026-10-31T22:19:54Z, event=pull_request). Rust lanes in this repo only start on a merge-ready label event, so skipped is unobserved, not green, and the new test has no hosted execution receipt at all. Only "Source of Truth" (41247693788) and "Qualify ripr-rs Python Wheel" (41247693743) ran, and neither exercises the changed Rust test.
Non-blocking:
- The rationale now recorded in durable spec text over-generalizes the class definition. RIPR-SPEC-0117:180-181 states that "
weakly_exposedexists only because a related test carries a credited weak assertion", and the PR body repeats it.analysis::classify::decision::classify(crates/ripr/src/analysis/classify/decision.rs:21-53) does not encode that:WeaklyExposedis the residual class whenever the Exposed condition (reach/discriminate/infect/propagate allYes) fails and no*Unknownclass applies. The sibling fixtureproximity_only_reach_through_a_macro_names_the_macro_limit(proximity_reach_tests.rs:147) isweakly_exposedwhile carrying a strongassert_eq!(outer(4), 12)oracle. The decision itself still stands and is fail-closed, and the limit demonstrably owns the finding'smissinglist when applied (:168-175); only the sentence is too strong. Narrowing it to "aweakly_exposedfinding whose only related test is owner-named still carries that test's weak assertion" would keep the decision and drop the false class-wide invariant. - The fixture helper binds to
MACRO_ROUTEDby string surgery (:1713-1716). It fails loudly today, but a whitespace edit toMACRO_ROUTEDwould turn this into a confusing failure instead of an obvious one; a named constant for the test body would be sturdier. Not a defect. assert!(!super::needs_proximity_reach_limit(&named))(:1737) duplicates whatassert_unlimitedalready pins black-box (:1738). Keeping the white-box form is defensible, but the black-box assertion carries the oracle weight if the white-box one is ever dropped.- Both hosted review providers are quota-limited here (gemini-code-assist 22:19:55Z, coderabbitai 22:20:00Z posted rate-limit notices, no review content). Under the false-confidence rules that is missing review for those providers, not a clean pass; this pass is additional evidence, not a substitute.
Not run:
- The Rust toolchain on this host is not on
PATH, so I could not runcargo test -p ripr --lib proximity_reach,cargo fmt --check,cargo xtask precommit, clippy, or any other repo-native gate. The PR body's claims that the filtered test run reports 41 passed and thatcargo fmt --checkandcargo xtask precommitexit 0 are the author's; I did not reproduce them. Everything above about the new test's expected outcomes is static reading of the semantic owner at headdecfba5, not execution. - No rendered CLI/LSP receipt was produced. The diff touches no production path and I found no route by which output could move, but that is a source argument, not an observed render.
- Hosted Rust lanes for head
decfba5areskipped(Draft, nomerge-readylabel), so neither the new test nor the touched spec text has hosted proof.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head decfba5bba511fa0a2d8cc897481983cb2b03705. Not an approval.
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the changed admission predicate remains restricted to InfectionUnknown, so weakly_exposed owner-named findings retain their gap and are not reach-limited.
- Confirm the PR's central behavioral proof is not independently evidenced in this packet because the relevant sensor failed and the late cargo-test receipt is absent.
Refuted
- The specs and changelog accurately preserve the distinction between an owner-named credited weak assertion and a proximity-only finding.
Evidence gaps
- The focused cargo-test receipt was scheduled but absent from the supplied packet, so claimed execution of the new pair remains unverified here.
- The new paired test distinguishes an owner-named weak assertion from a proximity-only twin, but its executed result awaits the late cargo-test receipt.
- The packet lacks the late cargo-test receipt and records the ripr sensor as failed, leaving execution confirmation incomplete despite sound test oracles.
- Model proof intent was rejected by deterministic validation.
- The PR's focused test execution is claimed but not represented by an available cargo-test receipt.
- Execution proof for the new route is not yet independently available in the shared packet; the PR body reports a focused test run, but cargo-test receipt status was scheduled-late/absent.
- Focused runtime proof of the new natural-fixture pair remains unconfirmed by the supplied sensor receipts.
- The new fixture pair is intended to prove behavior, but no completed independent cargo-test receipt is present.
…decision rationale (#11481) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzVWk9FoK366FfhytUg
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Reporter summary
The changed production predicate remains restricted to infection_unknown, and the specs, changelog, and paired natural-fixture test consistently encode the decision to leave owner-named weakly_exposed findings unlimited while limiting the proximity-only twin. However, the late cargo-test receipt failed with exit code 101 and includes no failure output, so the new fixture’s relation/oracle classification and expected outputs are not independently verified. Inspect sensors/cargo-test/ub-review-sensor-status.json and rerun the focused proximity-reach test before treating the behavioral claim as proven; until then, the direction is uncertain rather than a code-level finding requiring changes.
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head 01034b8): REVIEW_INCOMPLETE
Inspected:
- Subject: PR #11938, head
01034b8e0c0788653c2d011d47e90186d4c2cb9e, earlier reviewed headdecfba5bba511fa0a2d8cc897481983cb2b03705, recorded basefdf285a8b44867b85c326a147fe6927ed912020e; 5 files. Governed by issue #11481. - Delta measured directly from the API (
compare/decfba5b...01034b8e: ahead=1, behind=0, 3 files), not from the bundle side-loaded patches, which for this PR are base-to-head diffs. The candidate contribution is NOT byte-identical to the earlier head: a real content change - one commit01034b8e0 test(rust): harden the weakly_exposed owner-named pin and reword the decision rationale (#11481)touching three of the five contribution paths:crates/ripr/src/analysis/language/rust/mod.rs(+2/-1, doc comment onneeds_proximity_reach_limit),crates/ripr/src/analysis/language/rust/proximity_reach_tests.rs(+5/-0, two assertions in theweak_assertion_fixturehelper) anddocs/specs/RIPR-SPEC-0117-rust-macro-reach-limitation.md(+10/-6, the rationale). The changelog fragment and RIPR-SPEC-0114 are unchanged. - State change: the PR is no longer a Draft and now carries the
merge-readylabel, so the Rust lanes that wereskippedat the earlier head actually ran. That converts the earlier "hosted proof only" blocker into a real lane result. - Semantic owner for the changed content:
needs_proximity_reach_limit(crates/ripr/src/analysis/language/rust/mod.rs:1458-1484), the helperweak_assertion_fixture(crates/ripr/src/analysis/language/rust/proximity_reach_tests.rs:1710-1724) with the pinned pair test at:1726-1760, and RIPR-SPEC-0117 as the durable rationale owner.
Earlier findings re-bound:
- Earlier Blocking (hosted proof only - every Rust lane
skippedatdecfba5because the PR was a Draft) is REPAIRED as far as the changed test is concerned: the Rust-only feature lane at this head executed the changed test and it passed. - Earlier non-blocking #1 (the durable rationale over-generalizes the class definition) STILL HOLDS in substance: the spec sentence was reworded, but the over-general invariant survives and the PR body still carries the original wording. Details below.
- Earlier non-blocking #2 (the fixture helper binds to
MACRO_ROUTEDby string surgery, so a whitespace edit would produce a confusing failure) is REPAIRED by the new named drift guard. - Earlier non-blocking #3 (the white-box assertion duplicates the black-box one) is unchanged and still holds as a style note.
- Earlier non-blocking #4 (both hosted review providers quota-limited) still holds:
gemini-code-assist[bot]posted only a daily-quota notice again at 2026-10-31T23:51:18Z andcoderabbitai[bot]only a rate-limit notice at 22:20:00Z. That is missing review for those providers, not a clean pass.
Blocking:
No source defect found in the delta. What stands between this candidate and REVIEW_READY is hosted proof only, and the hosted proof that exists is red - on lanes this candidate did not cause (attribution below).
Non-blocking:
- The durable rationale still states a class-wide invariant the code does not encode. The reworded RIPR-SPEC-0117 text reads "
infection_unknownmakes no assertion claim, whileweakly_exposedexists only because a related test carries a credited weak assertion and publishes a gap for it", and the PR body still says "Aweakly_exposedfinding exists only because a related test carries a credited weak assertion (observe is notno)".analysis::classify::decision::classifydoes not encode that:WeaklyExposedis the residual class whenever the Exposed condition fails and no*Unknownclass applies. I re-verified the counterexample at this head rather than restating the earlier one: the sibling fixtureproximity_only_reach_through_a_macro_names_the_macro_limit(proximity_reach_tests.rs:137-182) builds the unmodifiedMACRO_ROUTED, whose only related test carries the STRONGassert_eq!(outer(4), 12)oracle, assertsfinding.class == ExposureClass::WeaklyExposedat:147, and publishes the gapRustMacroReachUnresolved(:168-175) - a reach gap, not an assertion gap. That finding isweakly_exposedbecause the macro reach is unresolved, not because any related test carries a weak assertion. The rewording around it is a real improvement - it now states that soundness of the extension is not established, that extending would withdraw a gap and its next step on name evidence alone, and what would reopen the question - but the over-generalizing sentence survives. Narrowing it to "aweakly_exposedfinding whose only related test is owner-named still carries that test's weak assertion" would keep the decision and drop the false class-wide invariant. - The new assertions are sound but partly redundant with each other. The drift guard at
:1711-1714and the post-condition at:1722check overlapping facts: if the template literal is present inMACRO_ROUTED, thereplaceat:1717-1720fires, so the post-condition cannot fail without the guard already having fired. Not a defect - the post-condition gives a better message and prints the constructed library - but the guard carries the discriminating work. - Hosted state at this head, newest run wins. Run 41254245552 ("CI") is failure: "Rust-only feature lane" (job 124693924438) failed at step 9 "Test --no-default-features --features lang-rust" - the
riprlib target reports12886 passed; 1 failed; 1 ignoredwith the single failurelsp::backend::list_actionable_items_tests::list_actionable_items_names_gaps_the_actionable_profile_hidesatcrates/ripr/src/lsp/backend.rs:12892(left: ["probe:pricing:94:predicate", "probe:pricing:98:predicate"]vsright: ["probe:pricing:98:predicate", "probe:pricing:94:predicate"]), and thecli_smoketarget reports619 passed; 2 failedoncheck_worktree_drill_in_commands_reach_the_uncommitted_findingandselector_location_misses_explain_syntax_and_preserve_retry_scope; vscode, msrv, Perl, source-identity and ci-result are skipped. Run 41254245733 ("Merge-ready request 01034b8...") is failure: "Route Ripr Rust Small", "Detect Docs-Only Surface" and "Admit PR Candidate" are success; "Ripr Rust Small on GitHub Hosted / Rust gates" (job 124694093900) failed at step 16 "Repository policy preflight" withcheck-process-policyreporting that thecrates/ripr/src/output/first_pr/run_chain.rsallowlist entry foruse std::process::Commandis orphaned (max_count=1, pattern not found in any tracked file); its step 9 "Formatting preflight" and step 15 "User-text goldens" succeeded, but clippy and the workspace test lane never ran; "Ripr Rust Small Result" (124695975651) is failure; the sharded test lane and the CX lanes are skipped. "Source of Truth", "Qualify ripr-rs Python Wheel (read-only)", "ub-review", "Windows Advisory", "Security", "Printed Command Paste" and "Merge-ready Conflict Notice" are success; Coverage, Test Analytics, Future Clippy (advisory) and macOS Advisory are skipped.
- The changed test does have hosted execution, and it passed: the same lane log shows
test analysis::language::rust::proximity_reach_tests::a_weakly_exposed_owner_named_weak_assertion_keeps_its_gap_while_proximity_is_limited ... ok(log line 5392), alongside the siblingthe_owner_named_admission_is_limited_to_infection_unknown_all_owner_named ... ok(line 5415). That is the discriminating evidence theub-reviewsummary at this head reports as missing - that summary cites "the latecargo-testreceipt failed with exit code 101 and includes no failure output" and asks for a rerun of the focused test. The lane did fail overall, but on an unrelated LSP test; the per-test lines show the changed test passing at this head. - Attribution for both red lanes: main-red, not this candidate. (a) The process-policy orphan is a base-side fact, established by direct source comparison rather than by base-lane colour: the failing gate names exactly two files, and both are byte-identical between the recorded base
fdf285a8band head01034b8e-crates/ripr/src/output/first_pr/run_chain.rs(blob11076801f4...at both, holding onlyuse std::process::Stdio;) andpolicy/process_allowlist.d/11720-first-pr-run-chain.txt(blob63db01ce12...at both, still carrying theuse std::process::Commandentry for that file). Neither file is in this five-file contribution. Main tipc5fa19fd9051f00a9195b37af9c78e5028b6982ffails the same gate with the identical message (job 124702518162). (b) The LSP ordering assertion and the twocli_smokefailures are outside this PR - it touches no file undercrates/ripr/src/lsp/. The source-level chain is visible: the tree CI tested is the PR head merged with main as of 2026-10-31T23:49 (ea9dfe3ded8769ccc655bbbffc55c4e4947359d6), whosecrates/ripr/src/lsp/diagnostics.rsis blobeedf4d52- the #11796 union-findcanonical_group_members, which changed group ordering from string-key order to union-find root-index order - while itscrates/ripr/src/lsp/backend.rsis blob9e07aa90, whose test at:12892still asserts the old order[:98, :94]. Main pusha7431a52d(2026-11-01T00:09:56Z) fails the same test at the same line with the identical left/right flip and the same twocli_smokefailures at the same 619/2 counts (job 124698136286). This PR changes neither file. - The integration basis is already stale: CI ran against the merge of the head with main as of 23:49 on 2026-10-31, and main has since advanced to
c5fa19fd. No run of this head against the current main tip was observed. - Efficiency: the delta adds no production cost. The only production-path change is a doc comment on
needs_proximity_reach_limit(mod.rs:1450-1457); the gate body at:1458-1484is unchanged, so no comparison, allocation, I/O or traversal was added or removed on any hot path. The two new assertions are in test-only code (the helper sits inside the#[cfg(test)]module beginning atproximity_reach_tests.rs:1250) and are single substring scans over a small in-memory fixture string - bounded, no subprocess, no cache key, no memory growth. The helper is called twice, so this is two scans, not a scan inside a loop.
Not run:
- The Rust toolchain on this host is not on
PATH: nocargo test, clippy, fmt,cargo xtask precommitorcargo xtask check-traceabilitywas executed, and no local Rust receipt is claimed. The PR body claimscargo test -p ripr --lib proximity_reachreports 41 passed and thatcargo fmt --checkandcargo xtask precommitexit 0; I did not reproduce them. The hostedFormatting preflightstep passed at this head, which is independent evidence for the fmt half of that claim and nothing more. - No rendered CLI/LSP receipt was produced. The delta touches no production path and I found no route by which output could move, but that is a source argument, not an observed render. No local rerun of the focused proximity-reach test; the hosted per-test line is the execution evidence I rely on.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 01034b8e0c0788653c2d011d47e90186d4c2cb9e. Not an approval.
|
Review of record, head aa0c9dc. Disposition: REVIEW_READY (COMMENT on author PR). Inspected: full diff. Production change is comment-only in rust/mod.rs ( Generated by Claude Code |
Requested by Steven · project thread
Governing issue or accepted claim: #11481
Acceptance delta (one sentence): the open follow-up "extend owner_named_test admission to weakly_exposed" is decided fail-closed (not extended) and pinned by a natural-fixture test and spec text.
Decision
Do not extend. A
weakly_exposedfinding exists only because a related test carries a credited weak assertion (observe is notno). With onlyowner_named_testrelations, that test is the strongest name-only sign the assertion is about the owner. The transitive/macro witness is repo-wide and name-only, not tied to that test, so limiting the finding would drop the weak-assertion gap lines and read "reach unresolved" over a real weak assertion. Forinfection_unknownno such gap exists, which is why #11606 could admit it.Changes
a_weakly_exposed_owner_named_weak_assertion_keeps_its_gap_while_proximity_is_limited: natural (unmodified) fixture, classweakly_exposed, reachweak, oneowner_named_testrow with aWeakoracle, macro witness present, stays unlimited. Its twin differing only in the test name is proximity-only and still names the macro limit.Proof
cargo test -p ripr --lib proximity_reach(41 passed),cargo fmt --check,cargo xtask precommitexit 0, clippy -D warnings (see checks).Generated by Claude Code