Skip to content

fix(analysis): give a name-only comparison tail and path-valued tail-if arms their return sink (#15274) - #16017

Merged
EffortlessSteven merged 3 commits into
mainfrom
claude/project-thread-z2ojbt-15274
Nov 22, 2026
Merged

EffortlessSteven merged 3 commits into
mainfrom
claude/project-thread-z2ojbt-15274

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 21, 2026 •

Copy link
Copy Markdown
Member

Requested by Steven · project thread

Summary

  • A returned ordering comparison of one parameter against a constant (n >= LIMIT) had no return sink, so its return_value finding stayed propagation_unknown whatever the tests asserted. Its predicate twin on the same line already read the return sink and exposed. The return_value probe now reads the same whole-tail comparison its twin reads.
  • A tail if whose arms are paths (if n > 10 { Level::High } else { Level::Low }) had no return sink either, because an arm had to spell a literal, a call, arithmetic or a bare identifier. A :: path of plain identifiers is now a plain branch value, when the arms end in different names and the if opens its own statement.
  • The reading is narrow on purpose. An equality over names (a == b), two parameters (width <= limit), a field and a local keep the unknown sink: the verdict corpus showed each of those wider readings credits a test that no reader pairs to the boundary.
  • This is repros 1 and 2 of check: a correct exact-value test never clears propagation_unknown / infection_unknown, so verify stays refused forever #15274. Repros 3 to 7 are different readers and stay open there.

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: RIPR-SPEC-0001
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #15274 (repros 1 and 2)
Acceptance delta (one sentence): an exact boundary pin now moves the return_value finding of a name-only comparison tail, and the predicate finding of a tail if with path arms, from propagation_unknown to exposed.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): claude/project-thread-z2ojbt-15274
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): none
Accepted winner and losing candidate disposition (when decided): n/a

Related, not duplicated: #15322 (#14821) lets verify finish when only analyzer limits remain; it upgrades no finding. #15927 (#13037) credits a crate-qualified pin on a computed tail. Neither touches flow.rs sinks.

Scope

  • crates/ripr/src/analysis/classify/flow.rs: return_value_sink asks predicate_as_owner_tail before falling back to the unknown sink, and takes the tail only when it is an ordering comparison (is_ordering_comparison) of exactly one unrebound parameter against items (compares_one_parameter_to_items). tail_if_branch_value accepts is_plain_path arms, refuses arms that end in the same segment, and refuses an if whose preceding line does not end a statement.

Scope Classification

  • One production behavior

Production delta:

  • Two return-sink readings in flow.rs, each with its refusals.

Evidence/support delta:

  • 7 unit tests, 4 new fixtures, 3 honesty-corpus rows, 2 re-blessed verdict-corpus rows, changelog fragment, traceability fragment.

Single acceptance criterion:

  • With a boundary pin, rust_return_value_name_only_comparison_tail reads both findings exposed and rust_predicate_tail_if_path_arms reads exposed; with a far-input pin, the two _far_input fixtures stay weakly_exposed.

Non-goals:

Support-tier Impact

  • none

Claim/proof notes:

  • Changelog fragment changelog.d/15274-name-only-tail-return-sink.md.

Policy Impact

  • none

Proof

cargo xtask precommit                                   # exit 0 on 2028c258
cargo clippy -p ripr --all-targets -- -D warnings       # exit 0
cargo xtask goldens check                               # exit 0, no existing golden moves
cargo xtask verdict-corpus check-all                    # 0 false verdicts in all four corpora
cargo test -p ripr --lib classify::flow                 # 87 passed, see note
ripr check --base HEAD~1 --format json                  # scratch crates, before (main 7cf9cd6d) and after

Result, failures, or skipped proof:

  • Before and after, same inputs. Issue repro 1 moves from propagation_unknown to exposed; repro 2's return_value finding moves from propagation_unknown to exposed. Repros 3 to 7 read the same before and after.
  • Parity with the literal twin. n >= LIMIT reads what n >= 1000 reads on main: boundary pin exposed, far exact pin weakly_exposed, far assert! weakly_exposed, smoke call reachable_unrevealed, and a loop of far values weakly_exposed.
  • Two verdict-corpus rows move, checkout-daily-limit-imported-const and checkout-minimum-same-file-const. Both are runtime-labelled discriminated cases of param OP CONST; their return_value finding leaves propagation_unknown for exposed, and the case verdict stays credited.
  • Head a6cedc2 failed hosted qualification, and the failure was this PR's. The first cut gave every name-only comparison tail a return sink. cargo xtask verdict-corpus check-all (not part of precommit) showed three wrong credits: spec-b-0158-dynamic-default (a local operand, where RIPR-SPEC-0158 example 5 requires abstention), grid-equality-property (a == b under a reflexivity loop, a false verdict), and the return_value finding of macro-table-far-rows and macro-module-child-far-rows (two parameters, far rows, read exposed). Each shape now keeps the unknown sink and is pinned in name_only_comparison_tail_over_a_local_keeps_the_unknown_sink.
  • Review findings repaired. Path arms that end in the same segment (Level::High and crate::Level::High) and a tail if that is an operand of a wider expression (force || on the line above) keep the unknown sink. The second refusal also covers literal arms, which had the same gap on main.
  • binding_value_counterpart_width is back at its main golden: its tail compares a local.
  • Unit-test caveat. The full ripr lib-test binary does not build in the 15 GB authoring container. The 87 classify::flow tests were run from a scratch copy of this tree with unrelated mod tests blocks compiled out. Hosted shards passed on a6cedc2; they have not run on this head.

Claim Boundary

May be claimed: an ordering comparison of one parameter against items, and a one-line tail if with distinct path arms, reach the return sink and are then judged by the existing infection and oracle readers, as their literal twins are. Must not be claimed: that #15274 is resolved, or that verify now completes on the issue's other five repros.

Rollback

Revert the squash commit. No schema, config or output-contract change.

Spec-Test-Code Traceability

  • Spec: RIPR-SPEC-0001
  • Tests: flow.rs::tests::{name_only_comparison_tail_reaches_the_return_sink, literal_comparison_tail_keeps_its_own_return_sink_text, name_only_comparison_off_the_owner_tail_keeps_the_unknown_sink, tail_if_with_path_branches_flows_to_the_returned_value, tail_if_with_unread_or_equal_path_branches_fails_closed, tail_if_that_is_an_operand_of_a_wider_tail_fails_closed, name_only_comparison_tail_over_a_local_keeps_the_unknown_sink}
  • Code: crates/ripr/src/analysis/classify/flow.rs
  • Golden outputs: fixtures/rust_return_value_name_only_comparison_tail{,_far_input}, fixtures/rust_predicate_tail_if_path_arms{,_far_input}
  • Metrics: n/a
  • ADR/learning: n/a

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.
  • Errors are reported with actionable context.
  • Public JSON/schema changes are documented. (none)

https://claude.ai/code/session_01SvmPmpjxCU5DuWyfHiiPiS


Generated by Claude Code

…if arms their return sink (#15274)

A returned comparison whose operands are all names (`n >= LIMIT`) spells
no literal, call or arithmetic, so its return_value probe fell through
`is_obvious_return_expression` to the unknown sink and stayed
`propagation_unknown` whatever the tests asserted. Its predicate twin on
the same line already read the return sink through
`predicate_as_owner_tail`. The return_value probe now asks the same
reader first.

A tail `if` whose arms are paths (`Level::High`) had no return sink for
the same reason: an arm had to be an obvious return expression, a bare
identifier or a quoted literal. A `::` path of plain identifiers is now
a plain branch value.

Only the sink moves. A far-input pin still reads `weakly_exposed` and a
smoke call `reachable_unrevealed`, as the literal twins do.

Covers repros 1 and 2 of the issue; repros 3 to 7 are separate readers.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmpjxCU5DuWyfHiiPiS
@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 21, 2026
@coderabbitai

coderabbitai Bot commented Nov 21, 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 50 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 146 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: 4d636301-393a-42c1-8f44-4b7deccf7085
Commits

Reviewing files that changed from the base of the PR and between 1e0678b and 2028c25.

Files selected for processing: 38

  • .ripr/traceability.d/15274-name-only-tail-return-sink.toml
  • changelog.d/15274-name-only-tail-return-sink.md
  • crates/ripr/src/analysis/classify/flow.rs
  • fixtures/evidence-promotion-honesty-corpus/corpus.json
  • fixtures/rust-verdict-corpus/expected/rows/checkout-daily-limit-imported-const.json
  • fixtures/rust-verdict-corpus/expected/rows/checkout-minimum-same-file-const.json
  • fixtures/rust_predicate_tail_if_path_arms/SPEC.md
  • fixtures/rust_predicate_tail_if_path_arms/diff.patch
  • fixtures/rust_predicate_tail_if_path_arms/expected/CHANGELOG.md
  • fixtures/rust_predicate_tail_if_path_arms/expected/check.json
  • fixtures/rust_predicate_tail_if_path_arms/expected/human-full.txt
  • fixtures/rust_predicate_tail_if_path_arms/expected/human.txt
  • fixtures/rust_predicate_tail_if_path_arms/input/Cargo.toml
  • fixtures/rust_predicate_tail_if_path_arms/input/src/lib.rs
  • fixtures/rust_predicate_tail_if_path_arms_far_input/SPEC.md
  • fixtures/rust_predicate_tail_if_path_arms_far_input/diff.patch
  • fixtures/rust_predicate_tail_if_path_arms_far_input/expected/CHANGELOG.md
  • fixtures/rust_predicate_tail_if_path_arms_far_input/expected/check.json
  • fixtures/rust_predicate_tail_if_path_arms_far_input/expected/human-full.txt
  • fixtures/rust_predicate_tail_if_path_arms_far_input/expected/human.txt
  • fixtures/rust_predicate_tail_if_path_arms_far_input/input/Cargo.toml
  • fixtures/rust_predicate_tail_if_path_arms_far_input/input/src/lib.rs
  • fixtures/rust_return_value_name_only_comparison_tail/SPEC.md
  • fixtures/rust_return_value_name_only_comparison_tail/diff.patch
  • fixtures/rust_return_value_name_only_comparison_tail/expected/CHANGELOG.md
  • fixtures/rust_return_value_name_only_comparison_tail/expected/check.json
  • fixtures/rust_return_value_name_only_comparison_tail/expected/human-full.txt
  • fixtures/rust_return_value_name_only_comparison_tail/expected/human.txt
  • fixtures/rust_return_value_name_only_comparison_tail/input/Cargo.toml
  • fixtures/rust_return_value_name_only_comparison_tail/input/src/lib.rs
  • fixtures/rust_return_value_name_only_comparison_tail_far_input/SPEC.md
  • fixtures/rust_return_value_name_only_comparison_tail_far_input/diff.patch
  • fixtures/rust_return_value_name_only_comparison_tail_far_input/expected/CHANGELOG.md
  • fixtures/rust_return_value_name_only_comparison_tail_far_input/expected/check.json
  • fixtures/rust_return_value_name_only_comparison_tail_far_input/expected/human-full.txt
  • fixtures/rust_return_value_name_only_comparison_tail_far_input/expected/human.txt
  • fixtures/rust_return_value_name_only_comparison_tail_far_input/input/Cargo.toml
  • fixtures/rust_return_value_name_only_comparison_tail_far_input/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

Source and oracle review of head a6cedc2, by the authoring session. Hosted checks and bot reviews are not part of this record.

Inspected

  • The whole diff: 14 production lines in crates/ripr/src/analysis/classify/flow.rs, 5 unit tests, 4 new fixtures, 1 re-blessed fixture, 3 honesty-corpus rows, changelog and traceability fragments.
  • return_value_sink: the comparison-tail reader is asked only inside the branch that used to return the unknown sink, so every expression that already had a sink keeps its sink text. predicate_as_owner_tail requires the probe's own owner, a non-unit return type, the probe text to be the changed text, and the tail to be one single-line comparison (or the appended-equality || form it already admits).
  • tail_if_branch_value: is_plain_path is a superset of is_plain_identifier. Arms with generics, a leading ::, a qualified path, a cast or a field access are still refused, and the existing equal-arms refusal applies to paths.
  • Consumers: propagation_evidence_with_witness still demands a complete owner-bound witness for a return_value sink, so the new sink alone promotes nothing.

Oracle grip

  • Positive and negative fixtures for each shape: a boundary pin reads exposed; a far-input pin stays weakly_exposed and is held by must_not_promote corpus rows.
  • Before and after on 21 scratch crates with main 7cf9cd6 as the baseline. n >= LIMIT reads what n >= 1000 reads on main in four test shapes.
  • The first cut asked the reader before the literal check and moved rust_predicate_appended_str_arm_truth_assert from exposed to weakly_exposed. cargo xtask goldens check caught it; literal_comparison_tail_keeps_its_own_return_sink_text now pins the repair.
  • One existing golden moves, binding_value_counterpart_width: propagation stage yes, class unchanged at infection_unknown.

Local proof on this head

  • cargo xtask precommit: exit 0, 41 gates.
  • cargo clippy -p ripr --all-targets -- -D warnings: exit 0.
  • cargo test -p ripr --lib classify::flow: 85 passed, run from a scratch copy with unrelated test modules compiled out, because the full lib-test binary exceeds the 15 GB authoring container.

Not established here

  • The full ripr lib-test suite and the integration suites on this head. The hosted run is their first execution.
  • Bot review. None had reported when this was written.

Scope: repros 1 and 2 of #15274. Repros 3 to 7 are unchanged.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 22, 2026 00:06
@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!

@devin-ai-integration devin-ai-integration 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.

Devin Review found 3 potential issues.

Devin Review

…same-named path arms (#15274)

A returned comparison over a local is computed inside the owner, so the
name-only tail reading now holds only for parameters the body does not
rebind, fields and items (RIPR-SPEC-0158 example 5). A tail if that is an
operand of a wider expression, and path arms that end in the same name,
keep the unknown sink. binding_value_counterpart_width returns to its
main golden.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmpjxCU5DuWyfHiiPiS
…inst items (#15274)

The verdict corpus showed the wider reading credits what no reader
pairs: an equality over names under a reflexivity loop, and two
parameters under far rows. The return sink now needs an ordering
comparison of exactly one unrebound parameter against items. Two corpus
rows move, both discriminated cases whose return_value finding leaves
propagation_unknown for exposed.

Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01SvmPmpjxCU5DuWyfHiiPiS

@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

Source and oracle review of head 2028c25, by the authoring session. It replaces the record on a6cedc2, whose hosted qualification failed on a defect of this PR. Hosted checks on this head are outside this record.

What changed since a6cedc2

  • The name-only tail reading in return_value_sink is narrowed to an ordering comparison of exactly one unrebound parameter against items. An equality over names, two parameters, a field and a local keep the unknown sink.
  • tail_if_branch_value refuses path arms that end in the same segment, and an if whose preceding code line does not end a statement. The second refusal applies to literal arms too.
  • binding_value_counterpart_width is back at its main golden.

Why the first cut was wrong

  • cargo xtask verdict-corpus check-all is outside precommit. Run locally, it showed the wide reading crediting spec-b-0158-dynamic-default (a local operand; RIPR-SPEC-0158 example 5 requires abstention), grid-equality-property (a == b under a reflexivity loop), and the return_value finding of two far-row cases with two parameters. The returned-value readers hold a test to a boundary only where a literal twin exists, which is one parameter against a constant.

Inspected

  • The whole diff against main 7cf9cd6, production and tests.
  • compares_one_parameter_to_items: a field access refuses; a lowercase name that is no parameter refuses; a parameter or item bound by any let pattern in the body refuses; the count of parameter uses must be one.
  • is_ordering_comparison: needs < or > and refuses shifts, arrows and turbofish.
  • Consumers: propagation_evidence_with_witness still demands a complete owner-bound witness, so a sink alone promotes nothing.
  • Devin's three findings: two repaired, one answered in the changelog; all three threads replied to and resolved.

Oracle grip

  • Verdict corpus: 0 false verdicts in all four corpora. Two rows move, both runtime-labelled discriminated cases of a parameter against a constant, whose return_value finding leaves propagation_unknown for exposed.
  • Fixtures: boundary pin exposed, far-input pin weakly_exposed with must_not_promote corpus rows, for both shapes.
  • Scratch crates on this head: a loop of far values reads weakly_exposed for both findings; the RIPR-SPEC-0158 local case reads infection_unknown and propagation_unknown, as on main.
  • Refusal tests for each excluded shape, with a positive control beside them.

Local proof on this head

  • cargo xtask precommit: exit 0.
  • cargo clippy -p ripr --all-targets -- -D warnings: exit 0.
  • cargo xtask goldens check: exit 0.
  • cargo xtask verdict-corpus check-all: clean after blessing the two rows.
  • cargo test -p ripr --lib classify::flow: 87 passed, from a scratch copy with unrelated test modules compiled out.

Outside this record

  • The full lib-test and integration suites on this head. Hosted shards passed on a6cedc2 and have had no run on this one.
  • CodeRabbit and Gemini were rate-limited, so their review is missing. Devin reviewed a6cedc2 only.

Scope: repros 1 and 2 of #15274. Repros 3 to 7 are unchanged.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Native evidence for 2028c2587e9c8d864c0493ed03cb35be621fb94b: the rebuilt group 088301f441db6df6bcbe365c7c5da46f87978c7d stopped during Strict workspace Clippy because the runner received a shutdown signal (exit 143). The captured tail has no Rust diagnostic. The previous group succeeded but evaluated a different composition. No source change indicated by this failure; wait for the current native queue disposition rather than re-running an old group or overriding the failed result.

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