Repository navigation
fix(analysis): bind implicit effect credit to the ordered shared-sink assertion (#7794) - #8740
EffortlessSteven wants to merge 2 commits into
Conversation
… assertion (#7794) Production authority for sibling/implicit effect observation under RIPR-SPEC-0094: proximity-only effect oracles no longer confirm from kind alone, implicit trait dispatch credit is assertion-local, refused kind rows keep independently confirmed tokens/collection reads. Fixtures and the integration matrix follow in stacked PRs. Supersedes #7817. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SXuWr9byCWqYZ9wHRTEcSy
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
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 57 minutes. View limit details
Comment |
…on scan (#7794) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SXuWr9byCWqYZ9wHRTEcSy
There was a problem hiding this comment.
Verification questions
- Confirm
local_dispatch_typerefuses any module-level macro call (including benignmod foo { ... }style emissions and fixturemacro_rules!already vetted byExpansionSurface::scan), but the gate does not distinguish expansion positions: a receiver file with one top-levelmod tests { ... }carrying a#[cfg(test)]item-macro inside the nested module still vetoes the bounded exception even though the receiver type itself is bounded. - Confirm
IMPLICIT_DISPATCH_METHODSreferenced bytransitive_reach.rs::test_has_known_implicit_dispatchandassertion_has_known_implicit_observeris not defined in the diff hunk visible here. The seeded thread cites line ~30 ofimplicit_effect.rsbut not the constant. Without a constant restricting method names, the reverse-pathreaching.iter()branch could accept any single-function method, defeating the trait-method bind. - Confirm in
classify/reveal.rs::analyze_related_assertionsthe neweffect_kind_confirmsgate is!(is_effect_family && owner_reaching_related && (is_proximity_only \|\| implicit_observer.is_some()) && !invokes_opaque_macro && implicit_observer != Some(true)). That string is hard to follow and the pre-existing_not_opaque_macrolocal is left dangling — its semantics are now duplicated rather than reused, which raises the chance of a future drift whereeffect_kind_confirmsand the surroundingobservation_confirmed/token branch fall out of sync. - Confirm
standard_handlesmatches the imported canonical path forRc/Cell/RefCell/Vec. Nested globs (e.g.use std::rc::*;) pass the rename/path check by relying on the parent's name while keeping the nested children globbed. Confirm: doesnamed[0].path()ancestor walk read the full chain or a single-segment chain, souse std::rc::*; Rc::new(...)produces the requiredstd::rc::Rcpath? If the nested use flattens to*, the canonical join fails and the bounded form refuses, but a partial glob likeuse std::rc::{Rc, Weak};could still parse while pretending a different module path. Add a fixture proving nested-glob Rc still passes the canonical-path bind (or refuses it, by design). (crates/ripr/src/analysis/classify/implicit_effect.rs:437). - Confirm
standard_handlesallowsVecto be imported fromstd::vec::Veconly, but#[derive(Default)](and other derives) commonly constructVec<T>throughvec![]/Vec::new()without anyuse std::vec::Vec;import (it is a path, not a type alias). A receiver type whose file usesVecpurely through paths in ause std::vec;glob (or relies on prelude) will be rejected as non-standard, even though it is the std handle. - Confirm receiver-type attribute veto and reverse-path-length cap are documented in spec lines 674-680 but lack a dedicated reveal/transitive_reach test; assertion_observes_dispatch uses receiver_types[0].attrs().next().is_none() and signature_parameters==[root], but only implicit_effect.rs covers local-dispatch-type exclusion, not an end-to-end red/green test that confirms an attribute-decorated receiver refuses the bounded observer while a token match still confirms.
- Confirm standard_handles lexical match binds
Rc/Cell/RefCell/Vecto the exactstd::*canonical paths; wildcard imports are vetoed but ause std::rc::*;glob still keeps the localVecconstructor. The useallpredicate only refuses globs at the item-level, so nesteduse std::rc::*allowsRc::new(...)while a same-fileuse std::cell::Cellpath passes. Check that this combined path stays bounded.
Refuted
- The new implicit_effect.rs module adds an attacker-controlled DoS sink by reading arbitrary .rs files in the workspace during classification.; refuted because: The scan iterates over RustIndex.files().values() that the classifier already loaded for the same analysis run; ExpansionSurface stores only short identifier strings in excluded_receivers (no source copies retained), uses OnceLock for once-per-index memoization, and the gh-runner profile trusts the input repo. No new filesystem read or network call is opened.
- Implicit-dispatch observer authority could be lost or detached across a worker/async boundary between source indexing, memo caching, and the assertion check.; refuted because: There is no worker or async hop. The memo is a OnceLock populated lazily from the already-built immutable RustIndex, and assertion_observes_dispatch consumes the same Arc source bytes plus the parsed test body within a single synchronous reveal_evidence call. No transferable/detachable handle crosses any boundary.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
- The Drop workspace veto is enforced through three independent surfaces (UseTree with
as Destructorrename, Drop trait impl by name in any file, complete-compact join ofuse Drop as …) but the comment-drivenmacro_rules!veto usesMacroRules::can_castonly; item macros that expand to a Drop impl would escape this static detection, which is whylocal_dispatch_typeadditionally refuses any module-level MacroCall. Same risk also applies tocargo xtask precommit‘tickled’ builders — parked. - related_tests.rs adds test_dispatches_trait_impl with reverse For/while/for_each/operator walkers gated by
compact_impl_type_nameanddispatch_operand_has_type(withlet_binding_mentions_type+bracketed_expr_has_type); the only sibling concern not unified is machine-only owner-parameter aliasing where the impl's self_ty and the owner parameter share a non-identifier symbol — parked rather than broadened.
|
Reply to review 5561544139 (leads, checked against source at 1dd36eb): (1) nested Generated by Claude Code |
|
Claimed for the open-PR sweep by the "Editor refresh latency" thread (2026-10-22). Plan: check the head against current main, repair and land it (via a successor PR from my branch if I cannot push to this one), or close only on the sweep's "we do not want this" / "fundamentally different" bar with evidence. Generated by Claude Code |
|
Released: the "Editor refresh latency" thread is dropping this sweep slice. No changes were made to this PR or its branch. The open-PR sweep will route it to a thread that can push to its branch. Last required check on 1dd36eb was a failure on 2026-10-18 and the base (e54499e) is old, so it needs a merge of main and a look at that failure first. Generated by Claude Code |
|
Picked up by the "Editor refresh latency" thread (re-claimed after the coordinator re-routed it). #8740 is the production-only split of #7817, and #7817 has now been brought current with main (merge plus re-bless, pushed), all four open review threads answered and resolved, and a review of record posted at head ef15493. Required CI on #7817 is running now. Plan, so the two do not both go through qualification: if #7817's required check passes, it lands with its fixtures and matrix and this PR is closed as superseded by merged value. If #7817 is refused at admission for size, this PR takes over: I merge main here and open the proof PRs that were meant to stack on it. No changes to this branch yet. Generated by Claude Code |
|
Closing as superseded: #7817 itself merged on 2026-10-22 (12:20Z), so the split into stacked PRs is no longer needed. The deferred fixture, corpus and matrix recovery is tracked in #9543. Generated by Claude Code |
Requested by Steven · project thread
Governing issue or accepted claim: #7794
Acceptance delta (one sentence): Production authority so a proximity-only or implicit-dispatch effect oracle confirms observation only through the ordered shared-sink assertion of the dispatched receiver (RIPR-SPEC-0094), with fail-closed refusal that preserves independent token/collection confirmation.
Before / After
implicit_effect.rs); refused rows stay visible asobservation_unconfirmedyet keep independently confirmed token/collection-read confirmation (the refused gate also honourscollection_argument_read).How
New
classify/implicit_effect.rsplus wiring inreveal.rs,related_tests.rs,transitive_reach.rs,context.rs,classifier/{evidence,finding}.rs; SPEC-0094 text, traceability, changelog fragment (#7794). In-crate unit tests ship here; fixtures, goldens, honesty corpus and the integration matrix follow in stacked PRs (split from #7817 because it exceeded the admission scope limit).Proof run
cargo fmt --check;cargo test -p ripr --lib classify::(1327 passed)cargo xtask precommit(exit 0);check-traceability,check-spec-format,check-fixture-contracts,goldens checkpass on this branch alone (no existing golden shifted)Supersedes the combined candidate #7817 (to be closed unmerged; proof PRs stack on this one).
Generated by Claude Code