Repository navigation
feat(analysis): evaluate exactly resolvable match guards (RIPR-SPEC-0164 guard-arm) - #10414
Conversation
|
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 36 minutes. View limit details
Comment |
|
|
9a1fd0f to
851eeb7
Compare
|
|
851eeb7 to
8a6a3ce
Compare
|
|
5033474 to
8a3db6c
Compare
|
|
8a3db6c to
4762e45
Compare
4762e45 to
f9a7081
Compare
…ay exactly resolvable Devin review on #10414: `if (kind.len() > 2)` left parens attached to the operands, downgrading a resolvable match to unknown. Strip balanced outer parens around the whole guard (repeatedly) and around each operand, honoring quotes; unbalanced input stays fail-closed. Also update the module overview, which still claimed every guard refuses. Co-authored-by: Claude <noreply@anthropic.com>
|
|
A match arm guard now selects the arm when it evaluates to true over the exact bound inputs and falls through when false, exactly like the Rust match. The guard evaluator is fail-closed: one comparison whose operands each resolve through the shared #3295 evaluator (strings, chars, booleans, plain decimals) or str::len() on an exact string; ordering comparisons are exact for indices only, equality for every scalar. Anything else — boolean combinators, unsupported method calls, unknown operands, mixed types — refuses the whole match rather than guessing. Earns the spec-b-0164-guard-arm corpus row (RIPR-SPEC-0164; lane of match_arm_controls guard-variant probe moves infection_unknown -> weakly_exposed, mirroring the #10196 literal-callee/char moves; the bare-identifier variant stays fail-closed. Spec Behavior, Example #2, controls-fixture note and Non-Goals updated; guards remain a named limitation only in their unevaluable forms. Co-authored-by: Claude <noreply@anthropic.com>
Co-authored-by: Claude <noreply@anthropic.com>
wording Inherited combined-tree drift: #10444's caplog-override analysis change interacts with #10426's evidence-legend wording. The match-guard lane cannot affect these fixtures (no match arms in their inputs); carrying the re-bless so the merge gate sees a clean tree. Co-authored-by: Claude <noreply@anthropic.com>
e4ef730 to
552f9a0
Compare
…ay exactly resolvable Devin review on #10414: `if (kind.len() > 2)` left parens attached to the operands, downgrading a resolvable match to unknown. Strip balanced outer parens around the whole guard (repeatedly) and around each operand, honoring quotes; unbalanced input stays fail-closed. Also update the module overview, which still claimed every guard refuses. Co-authored-by: Claude <noreply@anthropic.com>
…ay exactly resolvable Devin review on #10414: `if (kind.len() > 2)` left parens attached to the operands, downgrading a resolvable match to unknown. Strip balanced outer parens around the whole guard (repeatedly) and around each operand, honoring quotes; unbalanced input stays fail-closed. Also update the module overview, which still claimed every guard refuses. Co-authored-by: Claude <noreply@anthropic.com>
552f9a0 to
9e6f485
Compare
Problem
Lane of #10304 (RIPR-SPEC-0164). The literal match-arm transfer refused any arm with an
ifguard, so a helper likelabel_guard(kind)with arm"word" if kind.len() > 2 => "alpha"left the caller-side boundary input unresolved (infection_unknown) even though the corpus row's runtime truth says the pinned test discriminates.spec-b-0164-guard-armsat attruth: discriminated / outcome: abstained.Change
analysis/classify/match_transfer.rs: an arm may now carry anif <expr>guard.split_guardseparates the guard atifoutside string/char literals;evaluate_guardevaluates it fail-closed over the exact bound inputs — one comparison whose operands each resolve through the shared #3295 evaluator (strings, chars, booleans, plain decimals) orstr::len()(Rust byte length) on an exact string. Ordering comparisons are exact for indices only; equality for every scalar. Selection requires pattern match AND guard true (false falls through in source order); an unevaluable guard refuses the whole match, preserving the all-or-nothing Required shape.Governing issue or accepted claim: #10304 (guard-arm lane; spec-b-0164-guard-arm).
Acceptance delta (one sentence): the guard-arm corpus row flips from abstained/limited to credited/exposed and the Rust missed-credit ceiling ratchets 143 -> 142, with the
match_arm_controlsguard-variant probe moving infection_unknown -> weakly_exposed (bare-identifier variant stays fail-closed).Evidence
committed_ceilings_equal_the_blessed_missed_creditpasses locally (ceiling 142 exact).goldens checkgreen after re-blessingmatch_arm_controlswith a spec-cited reason (RIPR-SPEC-0164).check-spec-formatandcheck-spec-numberingpass.cargo check -p ripr --lib); the lib-test crate cannot link within a 300 s local window, so unit tests execute on hosted CI.Spec and docs
docs/specs/RIPR-SPEC-0164-literal-match-arm-transfer.md: Behavior gains the evaluable-guard sentence; Example deps(deps): bump dtolnay/rust-toolchain from 1.95 to 1.100 in the github-actions-minor-patch group #2 becomes Accept/Reject conditional; the controls-fixture note moves the guard variant into the resolved class; Non-Goals now limits only unevaluable guard forms.Rollback
Revert the single commit; the blessed corpus row, golden, and ceiling line restore with it.
Non-goals
str::len()in guards.