Skip to content

fix(rust): arms that return the first arm's value leave its condition without a sink - #10133

Merged
EffortlessSteven merged 7 commits into
mainfrom
claude/project-thread-9lsalp
Oct 25, 2026
Merged

EffortlessSteven merged 7 commits into
mainfrom
claude/project-thread-9lsalp

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Oct 24, 2026 •

Copy link
Copy Markdown
Member

Summary

Addresses the one-line form of #9843; the rustfmt-layout sibling is tracked in #10134. if units >= 100 { 1 } else if units >= 10 { 1 } else { 3 } as a function tail read exposed for the first condition, because the one-line tail sink treated the first arm as the returned value. When a later arm returns the same value, flipping the first condition can leave the returned value unchanged on some inputs, so the condition has no returned-value sink and reads as static-unknown instead of a false strong verdict. Later arms that agree only with each other keep the first sink.

New corpus trap trap-equal-arm-ladder (truth partially_discriminated, ideal gap, now limited; before this change it was a false exposed). trap_floor rises to 34. No other corpus row moves.

Cache generations advance to 1.100 / 0.107.

Swarm / Source Boundary

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

Source-of-truth Links

Spec: none specific; propagation sink shape in classify/flow.rs
Governing issue or accepted claim: #9843
Acceptance delta (one sentence): trap-equal-arm-ladder reads limited instead of false exposed, with a unit-test regression and a corpus floor; no other corpus row moves.

Candidate Relationships

Candidate branch: claude/project-thread-9lsalp
Stack parent or prerequisite PR (if any): none (#9838 merged)

Scope Classification

  • Production change with spec, test and corpus evidence

Proof

cargo test -p ripr --lib classify::flow                  # 54 pass (2 new)
cargo test -p ripr --lib seam_cache                      # 196 pass (lockstep 1.100 / 0.107)
cargo test -p ripr --test lsp_lifecycle gap_corpus       # 27 pass
cargo test -p ripr --test cli_smoke first_useful_action  # pass after rehash
cargo xtask verdict-corpus check                         # trap-equal-arm-ladder limited; only new row
cargo xtask precommit                                    # exit 0

Claim Boundary

May claim: a one-line if/else tail whose later arm returns the first arm's value no longer gets a returned-value sink for the first condition. Must not claim: the equal-arm shape is repaired into a gap (it reads limited), or that other equal-value shapes changed: the multi-line (rustfmt) layout is still affected (#10134) and match arms are untraced.

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.

🤖 Generated with Claude Code

https://claude.ai/code/session_01JfeyhVjKnck3hhzL3soJz1

@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 24, 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 40 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 160 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: 3a8b86fe-d060-4f28-9117-d1c83fa8a54f
Commits

Reviewing files that changed from the base of the PR and between 2bf36c1 and b78113e.

Files selected for processing: 20
  • changelog.d/9843-equal-arm-ladder-no-sink.md
  • crates/ripr/src/analysis/classify/flow.rs
  • crates/ripr/src/analysis/seam_cache.rs
  • crates/ripr/tests/lsp_lifecycle/gap_corpus_currentness.rs
  • docs/OUTPUT_SCHEMA.md
  • fixtures/boundary_gap/expected/CHANGELOG.md
  • fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/after.repo-exposure.json
  • fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/agent-receipt.json
  • fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/agent-verify.json
  • fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/before.repo-exposure.json
  • fixtures/perl-verdict-corpus/spec-coverage.toml
  • fixtures/python-verdict-corpus/spec-coverage.toml
  • fixtures/rust-verdict-corpus/cases/trap-equal-arm-ladder.diff
  • fixtures/rust-verdict-corpus/cases/trap-equal-arm-ladder.json
  • fixtures/rust-verdict-corpus/expected/rows/trap-equal-arm-ladder.json
  • fixtures/rust-verdict-corpus/spec-coverage.toml
  • fixtures/rust-verdict-corpus/subjects/authored-equal-arm-ladder.json
  • fixtures/rust-verdict-corpus/subjects/authored-equal-arm-ladder/Cargo.toml
  • fixtures/rust-verdict-corpus/subjects/authored-equal-arm-ladder/src/lib.rs.txt
  • xtask/src/tests/rust_corpus_projection.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs verification checks before upstream.

Verification questions

  • Confirm the implementation removes the return-value sink when any later non-diverging arm text-equals the first arm, but its comment and changelog imply unobservability for some inputs without requiring that the equal arm is reachable.
  • Confirm the production change removes the first returned-value sink whenever any later non-diverging arm has the same textual value as the first arm.
  • Confirm the corpus fixture demonstrates the intended limited verdict, but its acceptable verdict includes gap and limited, so it does not prove the production route is complete for other equal-value shapes.

Refuted

  • The change might claim that every equal-arm shape is repaired into a gap.; refuted because: The implementation and PR claim are explicitly bounded to the one-line tail sink route; the authored corpus expected verdict is limited, with gap only an acceptable/ideal target.
  • The corpus mutant evidence is internally inconsistent with the stated truth.; refuted because: The two tests-passing mutants are explicitly documented as behavior-changing but not observed by the authored tests, which is consistent with partially_discriminated rather than fully_discriminated truth.
  • The corpus expects a stronger result than the implementation guarantees.; refuted because: The fixture explicitly accepts limited, matching the observed limited verdict and the PR's claim boundary.
  • The change requires a broader cache or fixture redesign to remain consistent.; refuted because: Existing version constants, parity assertions, lifecycle fixtures, documentation, and corpus artifacts are updated in place; no parallel versioning scheme is introduced.

Parked follow-ups

  • The implementation only suppresses the first condition when a later non-diverging arm has identical rendered text to the first arm.

Evidence gaps

  • The new corpus case consistently classifies the changed condition as limited rather than falsely exposed, and the required trap floor is raised without changing the false-credit ceiling.
  • Model proof intent was rejected by deterministic validation.
  • Execution-level red/green proof is not present in the available sensor.

EffortlessSteven commented Oct 24, 2026 •

Copy link
Copy Markdown
Member Author

CI on 82bf190 failed in the Rust gates on committed_ceilings_equal_the_blessed_missed_credit (xtask): each committed missed_credit_ceiling must equal the blessed count, and they had drifted (rust 135 vs 134 after the #9838 credit, python 33 vs 30, perl lowered to 23). The earlier verdict-corpus check passes because it only fails up and notes down, so it did not flag this. Fixed in aab5595 and b78113e (rust now 143 after the corpus cases that landed on main meanwhile; python 30; perl 23), verified with cargo test -p xtask committed_ceilings_equal. merge-ready re-applied on b78113e.

The independent review of the exact head found no blocking issue; its one substantive finding (the multi-line rustfmt layout takes next_branch_value and keeps the same false verdict) is #10134 and is stated in the PR's claim boundary.


Generated by Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs verification checks before upstream.

Verification questions

  • Confirm the new production branch removes the first return-value sink whenever any later non-diverging arm text-equals the first arm, including an arm whose branch may be unreachable.
  • Confirm the equal-arm check compares textual arm values and removes the first-arm sink whenever any later non-diverging arm matches, without proving reachability or semantic equivalence beyond textual equality.
  • Confirm the corpus fixture accepts either gap or limited, so it demonstrates the expected abstention but does not prove completeness for other equal-value layouts.

Refuted

  • The PR may claim that all equal-value shapes are repaired to gap.; refuted because: The implementation and corpus row explicitly limit the outcome to the one-line route and record limited; the seeded thread identifies the rustfmt-layout sibling separately.
  • This patch repairs every equal-value arm shape into a gap.; refuted because: The implementation and claim are explicitly bounded to the one-line tail route; the rustfmt-layout sibling is tracked separately and match arms are not traced.
  • The patch claims all equal-value Rust arm shapes are repaired.; refuted because: The implementation and claim boundary are limited to the one-line tail route; multi-line and match arms remain explicitly parked.

Parked follow-ups

  • The change intentionally does not claim completeness for multi-line rustfmt layouts or match arms; those are residual follow-up scope.

Evidence gaps

  • The scheduled cargo-test sensor is the remaining execution witness for the changed Rust behavior and fixture projections.
  • Model proof intent was rejected by deterministic validation.
  • Full test execution and the ripr sensor did not provide usable lane receipts here; cargo-test is scheduled late and ripr failed with exit code 2.

Copy link
Copy Markdown
Member Author

Review of record, head b78113e

Angles: (1) correctness of the equal-arm guard in tail_if_branch_value (text equality after trim, diverging arms, two-arm path, over-suppression), from an independent read-only reviewer; (2) tests: the new arms_that_return_the_same_value_leave_the_condition_without_a_sink fails without the guard, and later_arms_that_only_agree_with_each_other_keep_the_first_sink is a negative control against over-suppression; (3) spec and contract: cache 1.100 / 0.107 lockstep across seam_cache, OUTPUT_SCHEMA, boundary_gap fixtures, corpus floors and missed_credit_ceiling values.

Findings: no blocking defect. Non-blocking: inner-whitespace and (1) vs 1 variants stay falsely exposed because the guard compares trimmed text (an under-approximation, fail-open only for those spellings); if c {1} else if d {2} else {1} is suppressed although c is observable when d holds (a missed advisory, not a wrong one, which matches the repo's fail-closed rule). The multi-line rustfmt layout still has the same false exposed via next_branch_value: filed as #10134 and stated in the claim boundary. Bot reviews (github-actions) ask only for confirmation of the stated one-line boundary; CodeRabbit and Gemini are quota-limited, which is missing review, not clean.

Resolutions: hosted failure on 82bf190 was drifted missed_credit_ceiling values; fixed in aab5595 / b78113e.

Proof on this head: required Ripr Rust Small Result success, no open review threads, mergeable state clean.


Generated by Claude Code

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