Repository navigation
fix(analysis): a call that takes another branch no longer infects a changed line (#16524) - #16631
Conversation
…hanged line (#16524) A changed line inside one if branch read exposed from a test whose only owner calls pass literals that fold the branch's condition away. The infection stage now reads weak when every related test is a direct owner caller and changed_line_reached shows none of its calls can run the line. The reader is strict: an owner or test that may run the owner through other code, an argument it cannot fold, or a line it cannot place in one arm keeps today's reading. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmmSMBuovLRPTFeSczf
|
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 18 minutes. View limit details
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source and oracle review of head f0747c4 (one commit on cb7c25a, 17 files). This thread did not write the PR.
What I inspected:
- The full diff. The new gate in
classifier/evidence.rslowers infection only when the stage already readsYes. It also needs a complete workspace, no other owner caller, no rebound assertion macro and a sole owner change. Every related test must be aDirectOwnerCallfor whichchanged_line_reachedanswersSome(false). ANonefrom any test keeps today's credit, so the reader fails closed. branch_line.rs. The owner must be a unique free function with primitive integer parameters and nomutor rebinding pattern. Its body may make no non-constructor call and use no method, macro, closure, index,?,.awaitor deref. The file may have no hand trait impl or macro, and built values must be plain derive-only structs. The test may hold onlyletstatements and assertion macros, and every call in it must be a bare literal call of the owner. Any other identifier call, method call,::-qualified call or inner macro returnsNone.BranchIndex::line_reached. It refuses a line that sits in both arms, on the condition's own lines, or under a rebound guard. It folds the innermost guard first and then each enclosing guard. An unfoldable condition returnsNone.- The spec amendment to RIPR-SPEC-0443, the traceability extension, the changelog fragment and the new fixture. The fixture's expected output has both findings
weakly_exposed.
Local proof on this head:
cargo test -p ripr --test changed_line_branch_16524: 6 passed.- Negative control: with only
evidence.rsreverted to base, the three WEAK-asserting tests fail and the three EXPOSED controls still pass. The tests bind to the gate. cargo xtask goldens checkpasses over every fixture, so no other golden moved.check-traceability,check-spec-formatandcheck-fixture-contractspass.- Adversarial probes (scratch, not committed) for test shapes the call scanner does not see:
(f)(1)through a fn pointer,(origin_shift)(1)andfs[0](1)each readstatic_unknownupstream.- A turbofish helper
helper::<u8>(1)that calls the owner keepsexposed, because the owner then has another caller. - A condition on a local
letor on aconstkeepsexposed, because the fold does not read it. - None of these probes produced a false
weakly_exposed.
Non-blocking note: owner_calls_in only sees calls with an identifier right before (. Paren, index and turbofish calls get past it, and today other gates catch each of them. If that scanner is reused where owner_has_other_callers does not hold, it should refuse any unattributed ( call position.
Not established here: hosted CI on this head, which has not run yet because the PR is a draft without a label, and bot review providers. Clippy on the impacted package was not run locally.
Generated by Claude Code
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source and oracle review of head f0747c4 (one commit on cb7c25a, 17 files). This thread did not write the PR.
What I inspected:
- The full diff. The new gate in
classifier/evidence.rslowers infection only when the stage already readsYes. It also needs a complete workspace, no other owner caller, no rebound assertion macro and a sole owner change. Every related test must be aDirectOwnerCallfor whichchanged_line_reachedanswersSome(false). ANonefrom any test keeps today's credit, so an unread shape keeps the old credit. branch_line.rs. The owner must be a unique free function with primitive integer parameters and nomutor rebinding pattern. Its body may make no non-constructor call and use no method, macro, closure, index,?,.awaitor deref. The file may have no hand trait impl or macro, and built values must be plain derive-only structs. The test may hold onlyletstatements and assertion macros, and every call in it must be a bare literal call of the owner. Any other identifier call, method call,::-qualified call or inner macro returnsNone.BranchIndex::line_reached. It returnsNonefor a line that sits in both arms, on the condition's own lines, or under a rebound guard. It folds the innermost guard first and then each enclosing guard. An unfoldable condition returnsNone.- The spec amendment to RIPR-SPEC-0443, the traceability extension, the changelog fragment and the new fixture. The fixture's expected output has both findings
weakly_exposed.
Local proof on this head:
cargo test -p ripr --test changed_line_branch_16524: 6 passed.- Negative control: with only
evidence.rsreverted to base, the three WEAK-asserting tests go red while the three EXPOSED controls stay green. The tests bind to the gate. cargo xtask goldens checkpasses over every fixture, so no other golden moved.check-traceability,check-spec-formatandcheck-fixture-contractspass.- Adversarial probes (scratch, not committed) for test shapes the call scanner does not see:
(f)(1)through a fn pointer,(origin_shift)(1)andfs[0](1)each readstatic_unknownupstream.- A turbofish helper
helper::<u8>(1)that calls the owner keepsexposed, because the owner then has another caller. - A condition on a local
letor on aconstkeepsexposed, because the fold does not read it. - None of these probes produced a false
weakly_exposed.
Side note: owner_calls_in only sees calls with an identifier right before (. Paren, index and turbofish calls get past it, and today other gates catch each of them. If that scanner is reused where owner_has_other_callers does not hold, it should return None for any unattributed ( call position.
Not established here: hosted CI on this head, which has not run yet because the PR is a draft without a label, and bot review providers. Clippy on the impacted package was not run locally.
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! |
|
Local proof on head f0747c4 (merged base cb7c25a), cloud container:
Generated by Claude Code |
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoHZREZMPh8h7Upv48
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent re-review of merge head d50e055. Its parents are f0747c4 (reviewed earlier in review 6102542287) and main 5c9b629, which carries #16162.
Delta inspected:
- The PR's change against main (5c9b629..d50e055) is still 17 files, +1322/-3.
- For every file, the added and removed lines match the reviewed f0747c4 delta against cb7c25a, so the source change is untouched.
- In RIPR-SPEC-0443, the merge only adds lines. The #16524 amendment, its six Test Mapping rows and the
branch_line.rsImplementation Mapping entry sit after #16162's #13037 amendment and rows, which stay intact. No conflict markers remain.
On this merge head, in this container:
cargo test -p ripr --test changed_line_branch_16524: 6 passed.cargo xtask goldens check,check-spec-formatandcheck-traceability: each exits 0.
Hosted qualification on this head is still to run.
Generated by Claude Code
|
Exact |
Main moved three more inline `cfg(test)` modules out of line (#16628) and landed the #13037 bare-name return tail (#16162) and the branch-call infection rule (#16631). The merge keeps both sides' analyzer behavior: - `classify/{boundary_pairing,constant_tail_change,flow}.rs` take main's `mod tests;` reference; the moved bodies are merged three-way into the new `tests.rs` files, so every item both sides carry survives. - `classify/reveal.rs` keeps the #12010 identity route's import, cross-package and shadowing defeats alongside main's bare-owner-name-tail and owner-scoped-token conditions. They are independent fail-closed conditions. - `test_grip_evidence.rs` imports both sides' added name. - `analysis/seam_cache.rs` takes main's generation comments; the joined tree carries two 1.231 claims, so it takes a fresh number in the next commit. - The corpus reports and the boundary-gap expectations differ only in provenance, so the branch's captures stand; the recapture rewrites them.
Requested by Steven · project thread
Summary
ifbranch (Point { x: dx, y: 0 }toy: 1underif dx > 0) readexposedfrom a test whose only owner call (origin_shift(-1)) takes theelsebranch. The infection stage now readsweakwhen every related test is a direct owner caller and the newchanged_line_reachedreader shows no owner call in the test can run the changed line. Every shape the reader cannot read strictly keeps today's credit.Swarm / Source Boundary
dependency, or repo-ops development for
ripr-swarmSource-of-truth Links
Proposal: n/a
Spec: docs/specs/RIPR-SPEC-0443-branch-local-return-value-grip.md (amendment #16524)
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #16524
Acceptance delta (one sentence): A changed line in a branch that every related test's literal owner calls fold away reads
weakly_exposedinstead ofexposed, while a call that takes the changed branch, or any shape the reader cannot fold, staysexposed.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication): claude/project-thread-nrej6t
Stack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): n/a
Accepted winner and losing candidate disposition (when decided): n/a. Searched open PRs: #15591 (#15529, one-line branch value probe) and #16564 (#16551, shadowed field read) are different claims.
Scope
classifier/evidence.rs, new readervalue_contradiction/branch_line.rs,BranchIndex::line_reachedinbranch_index.rs.Scope Classification
Production delta:
changed_line_reachedplusBranchIndex::line_reached; the classifier readsweakinfection only onSome(false)from every related test.Evidence/support delta:
crates/ripr/tests/changed_line_branch_16524.rs; new fixturerust_field_construction_other_branch_call(both findingsweakly_exposed); spec amendment; traceability and changelog fragments.Single acceptance criterion:
weakly_exposed; taken-branch, unfoldable-argument, re-entrant and unplaceable-line shapes stayexposed.Non-goals:
Support-tier Impact
Policy Impact
Proof
cargo test -p ripr --test changed_line_branch_16524 cargo clippy -p ripr --all-targets -- -D warnings cargo xtask precommit cargo xtask goldens check cargo xtask verdict-corpus check-allResult, failures, or skipped proof:
exposedfor every case the tests expect as weak.cargo test -p ripr --lib(does not build in a 16 GB cloud container). The patch adds no lib unit tests; hosted Unit is the first run.Claim Boundary
exposed. Must not claim: branch reachability for computed arguments, cross-crate callers or helper-calling owners.Rollback
Spec-Test-Code Traceability
Static Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Generated by Claude Code