Skip to content

fix(analysis): a call that takes another branch no longer infects a changed line (#16524) - #16631

Merged
EffortlessSteven merged 2 commits into
mainfrom
claude/project-thread-nrej6t
Nov 29, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
claude/project-thread-nrej6t

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

  • A changed line inside one if branch (Point { x: dx, y: 0 } to y: 1 under if dx > 0) read exposed from a test whose only owner call (origin_shift(-1)) takes the else branch. The infection stage now reads weak when every related test is a direct owner caller and the new changed_line_reached reader 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

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge,
    dependency, or repo-ops development for ripr-swarm

Source-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_exposed instead of exposed, while a call that takes the changed branch, or any shape the reader cannot fold, stays exposed.

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

  • Infection-stage withhold in classifier/evidence.rs, new reader value_contradiction/branch_line.rs, BranchIndex::line_reached in branch_index.rs.

Scope Classification

  • One production behavior

Production delta:

  • changed_line_reached plus BranchIndex::line_reached; the classifier reads weak infection only on Some(false) from every related test.

Evidence/support delta:

  • 6 integration tests in crates/ripr/tests/changed_line_branch_16524.rs; new fixture rust_field_construction_other_branch_call (both findings weakly_exposed); spec amendment; traceability and changelog fragments.

Single acceptance criterion:

  • The other-branch call reads weakly_exposed; taken-branch, unfoldable-argument, re-entrant and unplaceable-line shapes stay exposed.

Non-goals:

  • Integration-test callers through a crate path, calls with computed arguments, owners that call helpers. All keep today's credit.

Support-tier Impact

  • none

Policy Impact

  • none

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-all

Result, failures, or skipped proof:

  • Original author run on base 40b77e3: all exit 0, 6 tests pass, no existing golden moved. Base binary reads exposed for every case the tests expect as weak.
  • Re-run on this head (applied cleanly on cb7c25a): see the PR comment once it finishes.
  • Not run locally: 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

  • May claim: this other-branch literal-call shape no longer reads exposed. Must not claim: branch reachability for computed arguments, cross-crate callers or helper-calling owners.

Rollback

  • Revert the squash commit; no schema, config or output-contract change.

Spec-Test-Code Traceability

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.

Generated by Claude Code

…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
@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 29, 2026
@coderabbitai

coderabbitai Bot commented Nov 29, 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 18 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 138 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: 0a003d96-8d25-4e73-b118-fd40114111c6
Commits

Reviewing files that changed from the base of the PR and between 5c9b629 and d50e055.

Files selected for processing: 17

  • .ripr/traceability.d/16524-other-branch-call.toml
  • changelog.d/16524-other-branch-call.md
  • crates/ripr/src/analysis/classifier/evidence.rs
  • crates/ripr/src/analysis/test_grip_evidence.rs
  • crates/ripr/src/analysis/test_grip_evidence/value_contradiction.rs
  • crates/ripr/src/analysis/test_grip_evidence/value_contradiction/branch_index.rs
  • crates/ripr/src/analysis/test_grip_evidence/value_contradiction/branch_line.rs
  • crates/ripr/tests/changed_line_branch_16524.rs
  • docs/specs/RIPR-SPEC-0443-branch-local-return-value-grip.md
  • fixtures/rust_field_construction_other_branch_call/SPEC.md
  • fixtures/rust_field_construction_other_branch_call/diff.patch
  • fixtures/rust_field_construction_other_branch_call/expected/CHANGELOG.md
  • fixtures/rust_field_construction_other_branch_call/expected/check.json
  • fixtures/rust_field_construction_other_branch_call/expected/human-full.txt
  • fixtures/rust_field_construction_other_branch_call/expected/human.txt
  • fixtures/rust_field_construction_other_branch_call/input/Cargo.toml
  • fixtures/rust_field_construction_other_branch_call/input/src/lib.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@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

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.rs lowers infection only when the stage already reads Yes. It also needs a complete workspace, no other owner caller, no rebound assertion macro and a sole owner change. Every related test must be a DirectOwnerCall for which changed_line_reached answers Some(false). A None from 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 no mut or rebinding pattern. Its body may make no non-constructor call and use no method, macro, closure, index, ?, .await or deref. The file may have no hand trait impl or macro, and built values must be plain derive-only structs. The test may hold only let statements 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 returns None.
  • 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 returns None.
  • 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.rs reverted to base, the three WEAK-asserting tests fail and the three EXPOSED controls still pass. The tests bind to the gate.
  • cargo xtask goldens check passes over every fixture, so no other golden moved. check-traceability, check-spec-format and check-fixture-contracts pass.
  • Adversarial probes (scratch, not committed) for test shapes the call scanner does not see:
    • (f)(1) through a fn pointer, (origin_shift)(1) and fs[0](1) each read static_unknown upstream.
    • A turbofish helper helper::<u8>(1) that calls the owner keeps exposed, because the owner then has another caller.
    • A condition on a local let or on a const keeps exposed, 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 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

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.rs lowers infection only when the stage already reads Yes. It also needs a complete workspace, no other owner caller, no rebound assertion macro and a sole owner change. Every related test must be a DirectOwnerCall for which changed_line_reached answers Some(false). A None from 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 no mut or rebinding pattern. Its body may make no non-constructor call and use no method, macro, closure, index, ?, .await or deref. The file may have no hand trait impl or macro, and built values must be plain derive-only structs. The test may hold only let statements 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 returns None.
  • BranchIndex::line_reached. It returns None for 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 returns None.
  • 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.rs reverted 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 check passes over every fixture, so no other golden moved. check-traceability, check-spec-format and check-fixture-contracts pass.
  • Adversarial probes (scratch, not committed) for test shapes the call scanner does not see:
    • (f)(1) through a fn pointer, (origin_shift)(1) and fs[0](1) each read static_unknown upstream.
    • A turbofish helper helper::<u8>(1) that calls the owner keeps exposed, because the owner then has another caller.
    • A condition on a local let or on a const keeps exposed, 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

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 29, 2026 10:50
@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!

Copy link
Copy Markdown
Member Author

Local proof on head f0747c4 (merged base cb7c25a), cloud container:

  • cargo test -p ripr --test changed_line_branch_16524: 6 passed
  • cargo xtask goldens check: exit 0 (first run could not fetch locked fixture deps offline; cargo xtask goldens prepare then a clean rerun)
  • cargo xtask verdict-corpus check-all: exit 0
  • cargo xtask precommit: exit 0
  • cargo clippy -p ripr --all-targets -- -D warnings: exit 0
  • Not run: cargo test -p ripr --lib (does not link in this container); hosted Unit is the first run. CodeRabbit and Gemini were quota-limited, so their review is missing on this head.

Generated by Claude Code

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 29, 2026
@github-merge-queue
github-merge-queue Bot removed this pull request from the merge queue due to a conflict with the base branch Nov 29, 2026

@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

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.rs Implementation 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-format and check-traceability: each exits 0.

Hosted qualification on this head is still to run.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Exact d50e0558da70aaa43940e0200d87d680a8aa974d now has independent source review 6102913325 and green hosted qualification. The previous native queue entry was removed at 12:07 UTC; no newer entry is visible. With this head unchanged, the next step is a fresh native queue entry and its required merge_group result, not another merge-ready cycle or a direct merge.

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 29, 2026
Merged via the queue into main with commit 3840cf4 Nov 29, 2026
20 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/project-thread-nrej6t branch November 29, 2026 14:32
EffortlessSteven pushed a commit that referenced this pull request Nov 29, 2026
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.
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