Repository navigation
fix(classify): bool-owner next step names the deciding input; guard operands compare tokens (#15149) - #15537
Conversation
…erands compare tokens (#15149) A weakly exposed return value of a `-> bool` owner whose reaching related tests already assert its exact result (`assert!(f(..))`, `assert!(!f(..))`) no longer advises replacing broad assertions with exact equality; the next step asks for an input whose boolean result differs between the old and new code (RIPR-SPEC-0259). The dropped-guard agreement rule compares retained operands as Rust token sequences, so `a as u8 == 0` rewritten to `aasu8 == 0` is a rewrite, not a dropped guard (RIPR-SPEC-0197 rule 5). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
…ly from a clean tree (#15149) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
…tree (#15149) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
|
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 29 minutes. View limit details
|
…-owner rows (#15149) Review of #15537 at a5428fc: - operand_tokens keeps word and literal boundaries but merges each run of adjacent punctuation, so a layout-only edit such as `Vec<Vec<u8> >` vs `Vec<Vec<u8>>` stays a retained operand and the withholding is kept (splitting `>>` from `> >` dropped it, fail-open toward exposed). - bool_owner_exact_result_next_step keeps the family template when a reaching row is annotated missing_exact_assertion, as exact_oracle_gap_next_step does; the owner match by last path segment is documented. - Tests cover the core::/::std::/::core:: rooted forms and turbofish, bound result, double negation and closure negatives. RIPR-SPEC-0197 rule 5, RIPR-SPEC-0259 and the changelog fragment follow. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for head 9f8b54c
Exact-head review. An independent static review of a5428fc covered the decision.rs producer, the finding.rs call site, operand_tokens, the specs, traceability, the changelog and the 4 re-blessed goldens. It found no high or medium issues. Its low findings were repaired at 9f8b54c:
- operand_tokens now merges each run of adjacent punctuation, so layout-only edits such as Vec<Vec > vs Vec<Vec> keep the dropped-guard withholding (fail-closed). Word boundaries still separate a as u8 from aasu8.
- A reaching MissingExactAssertion row keeps the old advice, matching exact_oracle_gap_next_step.
- New positive and negative shape cases cover the spec claims.
I read the 9f8b54c delta directly. The new step changes guidance text only, with no class, stage or actionability change. Focused tests, goldens (no drift), honesty corpus, verdict corpus and precommit exit 0 on this head; hosted qualification is next.
Generated by Claude Code
…p needs the asserted call to be the owner (#15149) Review of #15537 at 9f8b54c: - operand_tokens no longer absorbs a decimal point into a number, so `x.0.0` and `x.0 .0` read the same and a tuple-field spacing edit keeps the guard-agreement withholding (fail-open fixed). - bool_owner_exact_result_next_step asks whether the asserted call itself is the owner: with a same-package rival the shared OwnerCallIdentity must settle the spelled call on the owner; otherwise only a bare call with no same-named function in the index counts. A test that calls the owner but asserts a rival keeps the family template. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
…-j1fibr-15149 Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
…r the bool-owner next step (#15149) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
…the asserted-call identity check (#15149) Restores the fixture's goldens to their main content: its thr owner has a same-named function in another package, so the bool-owner step fails closed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
EffortlessSteven
left a comment
There was a problem hiding this comment.
REPAIR_REQUIRED
Head: 9f8b54c
Stage: source review, published head
Disposition: red. The new token comparison reads a layout-only tuple-field edit as a rewritten operand, so the guard-agreement refusal is lost and an unchanged test result is credited as exposed.
Blocking finding
push_code_tokens (crates/ripr/src/analysis/classify/owner_pin/short_circuit.rs:443-471) keeps a . inside a word only when the word starts with an ASCII digit and the next character is a digit (lines 459-461). So 0.0 is one token, while 0 .0 is the word 0, the punctuation run ., and the word 0.
Trigger: change fn f(n: u32) -> bool { n != 0 && ((n,),).0 .0 == 4 } to fn f(n: u32) -> bool { ((n,),).0.0 == 4 }. Both spellings are the same consecutive tuple-field access, and tests asserting f(4) and !f(5) return identical results before and after. The retained operand's token sequences differ (["((n,),)", "0", ".", "0"] against ["((n,),).", "0.0"]), so the comparison at line 344 does not match it, it is pushed into differing, and parse_operand on a tuple-field access returns None. The ? at line 348 then makes attempt return None, ShortCircuitTail::parse returns None, and the pin keeps its current reading with no withholding.
Consequence: a false promotion. The previous whitespace-compacting comparison recognized the retained operand; the new one rejects it, so a test whose result is unchanged is credited as exposing the change.
Required repair
- Distinguish a decimal literal from consecutive tuple-field indices, so field-access spacing is layout while
1.5stays one token. - Add a
GuardOperandChange::readregression for both spacing directions and an integration control in the existing short-circuit-tail tests. Keep the cast-word separation and generic-closing punctuation controls.
Non-blocking
The second finding on decision.rs:781 (a rival same-named assertion accepted as the owner's) is plausible and unrefuted, but I did not verify it against call_identity.rs and reveal.rs on this head. It should be dispositioned in the same repair round rather than left open.
Not checked
No local cargo test on this head; the hosted shards are the execution evidence. I read the committed source at the head.
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for head d60f739
Exact-head review of the delta since 9f8b54c:
- af71f7c addresses both Devin threads and the matching published-head review. operand_tokens treats
.as punctuation, so tuple-field spacing keeps the dropped-guard withholding. The boolean-owner step now requires the asserted call to resolve to the owner via shared_owner_call_identity and OwnerCallIdentity::resolve_call; without a shared identity only a bare, rival-free call qualifies. I read asserted_call_settles_on_owner in finding.rs: every unsettled path answers false and keeps the family template. - b6a0227 merges main; 4d34877 re-blesses rust_predicate_appended_char_arm_old_input (guidance text only, deciding input ';'); d60f739 restores rust_nested_use_owner to main's goldens, the conservative direction.
Both review threads are answered and resolved. On this head: focused lib tests (25), bool_owner_next_step (2), short_circuit_or_tail (9), fmt, goldens check-with-fixtures (1023), honesty corpus, verdict corpus and precommit exit 0. Guidance text only; no class, stage or actionability change. Hosted qualification is next.
Generated by Claude Code
|
Correction to my readiness review for d60f739: "Guidance text only; no class, stage or actionability change" applies to the boolean-owner next step. The operand-token half intentionally changes one class reading. A word merged across a space ( Generated by Claude Code |
|
|
…-j1fibr-15149 Resolutions: RIPR-SPEC-0197 and RIPR-SPEC-0259 take both sides; the guard_operand_dropped_agreement and rust_predicate_appended_int_arm_old_input goldens take main's versions for re-blessing; the #15021 raw-string test from main is ported from compact_operand to operand_tokens. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
…n merge (#15149) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for head c07a79f
Exact-head review of the main refresh since d60f739. I compared the PR's decision.rs and finding.rs against main's side of merge dc6eccf. The production delta is identical to the previously reviewed change. The bool-owner branch sits after #16039's exact-oracle branch in build_finding_with_origins, so when both could apply the exact-oracle step stands. The conflict resolutions are a union of the spec test lists and linked issues, main's goldens plus one re-bless of guard_operand_dropped_agreement human.txt (the expected bool-owner step), and main's #15596 raw-string test ported to operand_tokens with the same assertions.
Both earlier review threads remain resolved. On this head: focused lib tests (29, including #16039's), bool_owner_next_step (2), short_circuit_or_tail (9), fmt, goldens check-with-fixtures (1133), honesty corpus, verdict corpus and precommit exit 0. Hosted qualification is next.
Generated by Claude Code
Governing issue or accepted claim: #15149
Acceptance delta (one sentence): A weakly exposed return value of a
-> boolowner whose reaching related tests already assert its exact result no longer gets the broad-assertion advice (it now asks for a deciding input), and the dropped-guard agreement rule compares retained operands as sequences of words, literals and punctuation runs, soa as u8 == 0→aasu8 == 0counts as a rewrite and is not read as a dropped guard.Source review: REVIEW_READY c07a79f
Why
Both halves of #15149 (deferred CodeRabbit findings on #14194):
decision.rsemitted "Replace broad assertions with exact equality..." for every weakly exposed return value. For a-> boolowner,assert!(f(x))isassert_eq!(f(x), true), so that rewrite checks the same values and cannot separate oldn == 1from newn == 1 || n == 2(fixtures/rust_predicate_appended_int_arm_old_input). The missing piece is a deciding input.compact_operandremoved every space outside literals, soa as u8 == 0andaasu8 == 0compared equal. The guard-operand rule then withheld credit for a genuine rewrite.Change
crates/ripr/src/analysis/classify/decision.rs: newbool_owner_exact_result_next_step. It applies to aweakly_exposedreturn_valueprobe of an owner declaring-> boolwhen every contributing reach-establishing row's oracle isassert!(owner(..))/assert!(!owner(..)). Plain,std::/core::rooted, path-qualified and message-argument forms are accepted. Any other row keeps the family template: compound, wrapped, method receiver, turbofish,debug_assert!,assert_ne!, or unreadable. The new step names the owner and asks for "a test with an input whose boolean result differs between the old and new code". It names no value, because the return-value finding has no deciding-input fact. This is guidance only: class, stages, evidence and repair eligibility are unchanged, and nothing becomes newly actionable.crates/ripr/src/analysis/classifier/finding.rs: the new step is called after the ux(suggest): generic Next step lines presume assertion shapes the related test does not have #7393 exact-oracle step, for non-assertion-shaped owners only, and only when every matched related row is listed (truncated windows keep the template).crates/ripr/src/analysis/classify/owner_pin/short_circuit.rs:compact_operandis replaced byoperand_tokens. Words and numbers are separate entries split at whitespace, each run of adjacent punctuation is one entry with inner spacing dropped, and literals stay verbatim. Layout-only edits (a % 2/a%2,Vec<Vec<u8> >/Vec<Vec<u8>>) still match, so withholding is kept. Identifier/keyword/type merges (a as u8/aasu8) do not. Indecision.rs, a reaching row whose miss isMissingExactAssertionalso keeps the old advice (review repair at 9f8b54c)..ripr/traceability.tomllists the new tests.cargo xtask goldens bless <fixture> --reason "RIPR-SPEC-0259: ...":rust_predicate_appended_int_arm_old_input,rust_predicate_appended_str_arm_false_side_only,rust_predicate_appended_char_arm_old_input(added on main, re-blessed after merging main),guard_operand_dropped_agreement. In each, the drift is confined torecommended_next_step/suggested_next_actionand their human rendering.rust_nested_use_owneris no longer changed: its ownerthrhas a cross-package rival, so the asserted-call identity check keeps the old advice.changelog.d/15149-bool-owner-guidance-and-operand-tokens.md(Fixed).Proof
Environment: Linux, bash.
CARGO_PROFILE_DEV_DEBUG=0 CARGO_BUILD_JOBS=1 CARGO_INCREMENTAL=0. Lib/integration tests used--no-default-features --features lang-rust.GREEN (candidate):
cargo test -p ripr --lib --no-default-features --features lang-rust -- bool_owner_exact_result operand_tokens a_space_that_separates layout_whitespace: exit 0, 6 passedcargo test -p ripr --no-default-features --features lang-rust --test short_circuit_or_tail: exit 0, 9 passed (includes the newa_word_merged_across_a_space_is_a_rewritten_operand_not_a_dropped_guard)RED (production reverted in a temporary edit:
bool_owner_exact_result_next_stepshort-circuited toNone;push_code_tokensword reading disabled, which reproduces whitespace-stripped comparison):bool_owner_exact_result_rows_name_the_deciding_input,bool_owner_exact_result_step_needs_every_reaching_row_to_assert_the_owner_result,a_space_that_separates_words_is_part_of_the_retained_operand,operand_tokens_split_words_and_read_punctuation_by_longest_match. The 2 layout controls still passed.--test short_circuit_or_tail: exit 101.a_word_merged_across_a_space_is_a_rewritten_operand_not_a_dropped_guardfailed at itsExposedassertion. The 8 existing guard/or-tail tests passed.cargo xtask goldens check-with-fixturesshowedrecommendation_changeddrift in exactly the four fixtures listed above.Discriminating negatives: the layout-only control (
n != 0 && aasu8==0→aasu8 == 0) still stays belowexposed. Broad or other-shaped bool assertions, non-bool owners, predicate probes, exposed class, no owner, no rows, and proximity-only rows all keep the family template.Gates on head:
cargo fmt --check: exit 0cargo xtask goldens check-with-fixtures: exit 0 (1015 fixtures compared)cargo xtask check-evidence-promotion-honesty: exit 0cargo xtask verdict-corpus check-all: exit 0cargo xtask precommit: exit 0Review repair (9f8b54c)
An independent review of a5428fc found that strict Rust-token comparison could read a layout-only punctuation edit (
Vec<Vec<u8> >vsVec<Vec<u8>>) as a rewrite and drop the withholding. It also asked for parity with the exact-oracle step onMissingExactAssertionrows, and for wider shape coverage. All three are repaired.a_layout_only_generic_close_keeps_the_dropped_guard_readandbool_owner_exact_result_step_needs_every_reaching_row_to_assert_the_owner_result(themissing_exact_assertionrow) failed.cargo test -p ripr --lib --no-default-features --features lang-rust -- bool_owner_exact_result short_circuit::testsexit 0, 19 passed;--test short_circuit_or_tailexit 0, 9 passed.Review repair (d60f739)
Two Devin findings on 9f8b54c were confirmed and fixed in af71f7c: tuple-field spacing (
x.0.0vsx.0 .0) read as a rewrite and dropped the withholding, and a same-named rival assertion could receive the exact-owner guidance. A word is now only identifier characters, with.always punctuation. The asserted call must resolve to the owner throughshared_owner_call_identity/OwnerCallIdentity::resolve_call; without a shared identity only a bare call with no same-named rival counts.a_tuple_field_spacing_edit_keeps_the_dropped_guard_read,operand_tokens_split_words_and_merge_punctuation_runs,bool_owner_step_needs_the_asserted_call_to_be_the_owner);--test bool_owner_next_stepexit 101 on the rival case while the positive control holds.bool_owner_next_step2 passed,short_circuit_or_tail9 passed; fmt, goldens check-with-fixtures (1023), check-evidence-promotion-honesty, verdict-corpus check-all and precommit all exit 0.rust_predicate_appended_char_arm_old_input(deciding input';'), and restoredrust_nested_use_ownerto main's goldens.crate::is_small(..)) keeps the old advice; it could be widened later.Main refresh (c07a79f)
dc6eccf merges origin/main after a week of movement. The spec test lists and linked issues are unioned.
guard_operand_dropped_agreementtakes main's goldens and is re-blessed (only the expected bool-owner step in human.txt).rust_predicate_appended_int_arm_old_inputtakes main's goldens with no re-bless needed. Main's #15596 raw-string test is ported fromcompact_operandtooperand_tokenswith the same assertions. #16039's exact-oracle step still runs first, and the bool-owner step only when that returns nothing; their preconditions (a strong exact oracle versus bareassert!(owner(..))rows) cannot both hold. On c07a79f: focused lib tests (29, including #16039's), bool_owner_next_step (2), short_circuit_or_tail (9), fmt, goldens (1133), honesty corpus, verdict corpus and precommit exit 0.Not established
n == 2), but this PR does not cross-link findings.Missing check: No strong assertion was detectedline on these findings is unchanged classifier wording.x.is_ok_flag()) or a bound result still get the template.goldens check-with-fixturespasses.https://claude.ai/code/session_01YVdGzSEGc73M5dJJGUFL6S
Generated by Claude Code