Skip to content

fix(analysis): leave derived tuple projection unverified after a conditional exit (#4135) - #11802

Merged
EffortlessSteven merged 3 commits into
mainfrom
claude/fix-4135
Oct 31, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
claude/fix-4135

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 31, 2026 •

Copy link
Copy Markdown
Member

Governing issue or accepted claim: #4135
Acceptance delta (one sentence): A derived-local tuple arm whose related test places its assertions after a conditional or diverging exit is no longer promoted to exposed; the projection oracle returns unverified (None) instead.

What changed

  • top_level_projection_observes (derived_admission.rs): after all three observations are found, any statement up to the last observation containing return, ?, break/continue, panic!/unreachable!/todo!/unimplemented!, or a *::exit(..) call makes the result None. Closure bodies and nested items are skipped (not executed by declaration). The existing unconditional-return; boundary is unchanged.
  • Unit tests: discriminator over 8 exit shapes x insertion positions (fails if the bound is removed), positive control (complete test still Some(true)), trailing-exit and uninvoked-closure/item controls.
  • New fixture match_arm_tuple_derived_conditional_exit_before_assertion + must_not_promote corpus case rust_tuple_derived_conditional_exit_before_assertion_no_promotion.

Deliberate trade-offs (safe direction)

  • panic!/? in setup and a break/continue inside a local loop count as exits, so idioms like let Some(x) = y else { panic!() } or fallible()? yield None (unverified) rather than a promotion. A missed promotion is preferred over a wrong one.
  • The scan starts at statement 0, so setup before the owner call is included.

Verification

  • Reproduced: with the rule disabled, the new fixture reports 1 exposed / 1 weakly_exposed (false promotion); with the rule, 0 exposed / 2 weakly_exposed.
  • Passed: unit tests for derived_admission, cargo xtask fixtures (new fixture), cargo xtask check-evidence-promotion-honesty, cargo xtask goldens check.
  • cargo xtask precommit stopped locally at check-rust-source-role-authority on repair_attempt/mod.rs, a file this PR does not touch; that was main's failure and is fixed by fix(repair): unbreak main after #11596 (role-authority sniff, stale refusal assertions) #11734, which this branch now includes.
  • Independent read-only review of head 37ddb96: no blocking findings.

Not covered

  • A diverging helper call that is not syntactically an exit, and exits hidden inside macro token trees, are undetectable. The terminal_flow projection path and the whole-seam repair judgment are separate owners and unchanged.

🤖 Generated with Claude Code

https://claude.ai/code/session_01YVdGzQvtpKrgEnbdSoyCd8

…itional exit (#4135)

top_level_projection_observes now returns None when a conditional or
diverging exit (return, ?, break/continue, panic-family macro,
process::exit) precedes the last observation, instead of promoting from
assertions that are not unconditionally reachable.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzQvtpKrgEnbdSoyCd8
@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!

@coderabbitai

coderabbitai Bot commented Oct 31, 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 5 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 149 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: e5864243-b6cf-4574-873e-2b4a57e24484
Commits

Reviewing files that changed from the base of the PR and between 264db59 and 793724a.

Files selected for processing: 13
  • .ripr/traceability.toml
  • changelog.d/4135-derived-tuple-conditional-exit.md
  • crates/ripr/src/analysis/classifier/evidence/tuple_match/derived_admission.rs
  • crates/ripr/src/analysis/classifier/evidence/tuple_match/derived_admission/return_boundary_tests.rs
  • fixtures/evidence-promotion-honesty-corpus/corpus.json
  • fixtures/match_arm_tuple_derived_conditional_exit_before_assertion/SPEC.md
  • fixtures/match_arm_tuple_derived_conditional_exit_before_assertion/diff.patch
  • fixtures/match_arm_tuple_derived_conditional_exit_before_assertion/expected/CHANGELOG.md
  • fixtures/match_arm_tuple_derived_conditional_exit_before_assertion/expected/check.json
  • fixtures/match_arm_tuple_derived_conditional_exit_before_assertion/expected/human-full.txt
  • fixtures/match_arm_tuple_derived_conditional_exit_before_assertion/input/Cargo.toml
  • fixtures/match_arm_tuple_derived_conditional_exit_before_assertion/input/src/lib.rs
  • fixtures/match_arm_tuple_derived_conditional_exit_before_assertion/input/tests/projection.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 31, 2026 17:44
@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!

…tional-exit fixture

check-user-text counts a new expected/human.txt path against 0 at the
merge-base, and this fixture's default human output carries banned
plain-language terms. The human golden is optional (the runner compares
it only when present); the fixture keeps check.json and human-full.txt,
which pin the same non-promotion and are not scanned.

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01YVdGzQvtpKrgEnbdSoyCd8
@EffortlessSteven
EffortlessSteven merged commit 27c4137 into main Oct 31, 2026
61 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/fix-4135 branch October 31, 2026 19:02
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