Repository navigation
fix(oracles): an ensure! disjunction or nested == is never exact - #7681
Conversation
classify_fallible_assertion credited the whole ensure! condition as exact_value / strong as soon as one == or != appeared anywhere in it, so ensure!(a != b || c == d), ensure!(f(|x| x == 1)) and an inequality whose operand holds a closure == all read strong. Exact credit now needs a top-level == in some top-level && conjunct with no top-level ||, and a disjunction never earns an exact error variant either (RIPR-SPEC-0231 rule 1). assert! already read these forms weak. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
New authored case spec0231-ensure-disjunction-not-exact: ensure!(score(2) != 0 || score(3) == 6) only rejects a zero score(2) (x * 3 survives). Its expected oracle is relational_check / weak under RIPR-SPEC-0231 rule 1 (example 13 is the same ensure! inequality without the || arm). Without the classifier fix ripr reported exact_value / strong, an overclaim. Oracle accuracy moves to 32/35 match and 0/35 overclaim; the [oracle] floor and the population pin follow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
…-4g2cqz-ensure-disjunction
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Note Reviews pausedIt looks like this branch is under active development. To avoid overwhelming you with review comments due to an influx of new commits, CodeRabbit has automatically paused this review. You can configure this behavior by changing the Use the following commands to manage reviews:
Use the checkboxes below for quick actions:
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Summary by CodeRabbit
WalkthroughThe Rust oracle classifier now limits exact classifications when assertion conditions contain deciding disjunctions. RIPR-SPEC-0231 and tests define the rule. The verdict corpus adds an ChangesEnsure Disjunction Classification
Currentness Fixture Output
Priority: ➖ Normal Estimated code review effort: 3 (Moderate) | ~25 minutes Change: Bug fix · Severity of issue fixed: Medium Possibly related PRs
Merge Risk: 🔵 Low · up to
|
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm pR body asserts '32/35 match, 0/35 overclaim' but the new case row only cites RIPR-SPEC-0231#13 and labels expected_oracle=relational_check/weak; chi-an exact spec example for a disjunction exists, so the citation is by analogy.
- Confirm changelog bullets include 'f(|x| x == 1)' and 'xs.iter().position(|x| *x == 1) != None' but the typed-units test only exercises 'ensure!(...)' wrappers, never a free-standing expression hitting classify_fallible_assertion by those paths.
Refuted
- A new top-level helper should have been a method on a shared Conjunct visitor to avoid two passes over the masked string.; refuted because: Branch only runs through split_top_level_conjuncts + has_top_level_disjunction when invoked; the conjunct visitor would add a type without removing a pass; cost outweighs a thin function.
Parked follow-ups
- Case
spec0231-ensure-disjunction-not-exactis hand-written and pinned to ripr_commit8f5e72ea4; PR body cites1.95.0for theverdict-corpus relabelreplay. The commit hash is the only cross-reference; mismatch risk is parked for follow-up. - PR body cites RIPR-SPEC-0231 example 13 instead of amending the spec; the corpus validator only accepts numbered spec examples, so a citation is the right bound, but it leaves the disjunction rule un-recorded as a numbered example.
- changelog.d/7558-ensure-disjunction-not-exact.md groups three forms (disjunction, closure-==, call-arg-==) under one bullet, which is fine but the PR body and the test table distinguish closure-== from call-arg-==; reader confusion risk is low but document hygiene suggests a follow-up note.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Extends #7558's cap from a top-level || to a || inside a parenthesized group that is the whole condition or a top-level && conjunct, for ensure!, assert! and the fallible path. A || inside a call argument or closure still does not decide the condition. RIPR-SPEC-0231 rule 1 and example 13 now state the disjunction forms; the old control that read a grouped '|| false' as exact now reads weak. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm stale-reference risk for removed contains_exact_comparison: a repo-wide grep proof is the cleanest way to confirm no orphan imports remain outside the two call sites shown in the diff; if any are found, the fix is no longer smallest-complete.
Parked follow-ups
- Smallest-complete fix: removed contains_exact_comparison and routed both call sites through has_top_level_exact_equality; no parallel classifier change duplicated elsewhere.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
…s decide Review of 153f168 found ensure!(c == d && (a || b)) read exact while the matches! form read weak, against the spec text. Both now read like the negated-pattern rule: the deciding group pins nothing and the remaining conjuncts decide, never below relational_check / weak. A leading comment no longer hides a parenthesized group, and a disjunction with a broad error arm (ready || r.is_err()) reads relational_check, not broad_error. RIPR-SPEC-0231 rule 1 now states which == pins, the conjunct rule and prop_assert!; example 13 gains the pinning-sibling form. Traceability, changelog and the corpus case's spec_examples follow. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- spec0231-ensure-disjunction-not-exact cites RIPR-SPEC-0231#13 by analogy because no numbered example spells a disjunction; the new paragraph in the spec describes it but no numbered example was added. Recommend adding example 13a / 13b to the numbered examples block so the corpus citation stops being an analogy.
- xtask/src/reports/dx_scoreboard/population_tests.rs:701 — Hard-coded pair (31,34)→(32,35) plus the expected_ids.len() guard (34→35) are the only test-side coupling to corpus size. A merge that adds/drops another labeled case would silently break the numerator/denominator without check-fail. Consider sourcing both numbers from fixtures/rust-verdict-corpus/spec-coverage.toml's match_floor and a counted labeled-case set so the dx-scoreboard pin can't lie. Pre-commit selector is source-only so it cannot catch this — material test-oracle weakness.
- fixtures/rust-verdict-corpus/spec-coverage.toml:24 — match_floor rose from 31→32 while total labeled went 34→35, so the underclaim rate denominator changed independently. The new floor/ceiling pair encodes an implicit assumption that the new case matches and no row moved; neither is asserted by a focused test. Add a unit test that verifies labeled-row count == population denominator and expected_oracle.observed_kind for the case row.
Verification questions
- Confirm patterns::spec_0106_tests renamed exact_comparison_ignores_string_contents_and_escapes to exact_equality_ignores_string_contents_and_escapes and added 9 #7558 cases. But the public test name is gone from the function; no leftover copy observed in this diff — rename is clean at the call-site (single function in that block).
Parked follow-ups
- populated corpus row tracks match_floor 32/35 and population_tests denominator/numerator moved 34->35, 31->32 in lockstep; new authored subject (authored-ensure-disjunction) keeps case authored and pinned to ripr_commit 8f5e72e with sha256 retained files.
- spec0231-ensure-disjunction-not-exact is partially_discriminated by runtime mutant kill: x3 passes (first arm holds), x0 and x-2 fail tests::score_is_nonzero_or_pinned. The case anchors lib.rs:2 and expected_oracle cites RIPR-SPEC-0231#13 by analogy since no numbered example spells a disjunction; authors flagged this as parked follow-up.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Flooring the rest at relational_check / weak would lift a smoke reading (assert!(opt.is_some() && (a == b || c))), and rule 1 never raises a strength. An empty rest still reads relational_check / weak. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm corpus case spec0231-ensure-disjunction-not-exact cites RIPR-SPEC-0231#13 by analogy; no numbered example spells a disjunction in the spec, so the citation is not a literal rule match.
- Confirm population_tests.rs hard-codes (32,35) for oracle_accuracy and expected_ids.len() > 35 guard; any add/drop of a labeled case will silently break the numerator/denominator because the values are not sourced from spec-coverage.toml's match_floor or a counted labeled-case set.
- Confirm spec-coverage.toml match_floor rose 31->32 while total labeled went 34->35; the underclaim-rate denominator changed independently, so the floor/ceiling pair no longer encodes the original underclaim count floor/ceiling pair it replaced; underclaim pin location is unclear.
- Confirm dx-scoreboard pin is hard-coded to (32,35) plus a
> 35guard. A merge that adds/drops a labeled case breaks the numerator/denominator without check-fail; coupling to spec-coverage.toml/match_floor is missing. - Confirm spec example 13 was extended in prose to cover the disjunction form, but no new numbered example (e.g. 13a/13b) was added; corpus case cites RIPR-SPEC-0231#13 by analogy. The spec text and case both rest on the analogy. If the analogy is challenged, the case's expected_oracle is no longer machine-citation-grounded.
- Confirm population_tests.rs hard-codes the (numerator=32, denominator=35) pair and the expected_ids.len() > 35 guard. A future corpus change that adds/drops a labeled case in a way that keeps the match floor at 32 can silently mismatch the hard-coded denominator without failing check-all, because the dx-scoreboard pin only asserts equality on (totals). Nudge is correct today, but the coupling is to a hand-counted count, not spec-coverage.toml's match_floor.
- Confirm match_floor rose 31→32 while labeled total moved 34→35 independently. The underclaim-rate denominator is not encoded in spec-coverage.toml; a future case could shift the underclaim rate without check-all failing because overclaim_ceiling=0 only constrains overclaim, not underclaim floor/ceiling.
- Confirm removed contains_exact_comparison could leave an orphan import elsewhere; the diff shows only the two classified call sites updated, but no repo-wide grep proof was provided in the seeded thread. Risk is low because the function is crate-internal and the import block in classify.rs is fully replaced.
Parked follow-ups
- Corpus case spec0231-ensure-disjunction-not-exact cites RIPR-SPEC-0231#13 by analogy (the spec describes disjunction forms in prose but no numbered example spells one). Spec validator only accepts numbered examples, so citation is by proximity.
- Prior reviewer concern still open: the new corpus case cites RIPR-SPEC-0231#13 by analogy because no numbered example spells a disjunction. The spec body gained a paragraph but no example number was added; corpus citation stays an analogy.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Re-review of ae238ff found that a trailing // comment on a kept conjunct swallowed the rest and the closing ); of the rewritten assertion, so the bare matches! substring read exact/strong. Both conjunct-rest rewrites (deciding disjunction and negated pattern) now put each conjunct and the closing ); on their own lines. RIPR-SPEC-0231 rule 1 now says a deciding group drops out before the negated- and compared-pattern caps. The whole-object gate under a deciding || is restored, and the RELATION and INEQUALITY doc comments are on the right constants. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
is_inequality_assertion no longer calls a condition an inequality when a deciding || group drops out and a pinning sibling decides, matching classify_assertion. RIPR-SPEC-0231's negated-pattern sentence now names that exception itself. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Corpus case spec0231-ensure-disjunction-not-exact cites RIPR-SPEC-0231#13 by analogy (no numbered disjunction example). Consider adding example 13a/13b so the corpus citation is a literal rule match rather than an analogy, and so future drift in #13 cannot silently invalidate the labeled expected_oracle.
- Boundary placement is correct: the new helper sits in patterns.rs and is reused by both classifiers; the cap order is consistent; the rest-step masks and re-joins conjuncts so a trailing
//cannot swallow the closing);. No parallel visitor was added. - docs/specs/RIPR-SPEC-0231-rust-oracle-kind-admission.md:491 — Adding example 13a/13b in the numbered block would let
spec0231-ensure-disjunction-not-exact.jsoncite a real example instead of RIPR-SPEC-0231#13 by analogy; the new prose already describes the disjunction form.
Verification questions
- Confirm dx-scoreboard oracle_accuracy pin (32,35) and >35 guard are hard-coded literals; spec-coverage.toml match_floor and a counted labeled-case set are not consulted, so an add/drop of a labeled case breaks numerator/denominator silently with no check-fail.
- Confirm hard-coded (32,35) and expected_ids.len()>35 in population_tests.rs break silently on any merge changing the labeled-case count; the dx-scoreboard pin is the only consumer of the corpus numerator/denominator.
- Confirm spec0231-ensure-disjunction-not-exact cites RIPR-SPEC-0231#13 by analogy; the spec's prose paragraph was extended but no numbered example (e.g. 13a/13b) was added for the disjunction form, leaving the corpus citation a rule-by-analogy pin.
- Confirm match_floor rose 31->32 while total labeled went 34->35; the prior floor encoded the underclaim-rate denominator count separately, so the (floor, ceiling) tuple now encodes different semantics than before (success floor over count, not overclaim floor over underclaim count).
Parked follow-ups
- Spec citation RIPR-SPEC-0231#13 is by analogy: no numbered example spells a disjunction; corpus validator only accepts numbered examples. Reviewer recommends 13a/13b numbered examples; spec prose extends example 13 in place.
- Architecture parking (pre-existing): the
population_tests.rs(32,35) pin plus the> 35guard is hard-coded;match_floor=32inspec-coverage.tomlis the analogous floor. Neither is sourced from the other, so an add/drop of a labeled case breaks the dx-scoreboard pin without check-fail. Pre-commit is source-only and cannot catch this. - The new authored subject's lib.rs.txt omits the
cargo testbuild/test command proof and the test fixture is hand-pinned to ripr_commit 8f5e72e; the PR body cites1.95.0for verdict-corpus relabel replay. Cross-reference drift between pinned commit and version string is parked in seeded thread; under the 'truth' block thetest_commandis 'cargo test' but no witness artifact is included.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
assert!(ready || events_sent.contains(&id)) passes without observing the event, so step 9's mock_expectation credit now caps to relational_check / weak under a deciding disjunction, as broad_error already does. Also bumps the spec0231 case-count pin to 29 for the new corpus case. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
…-4g2cqz-ensure-disjunction
…R-SPEC-0255 Main merged #7680's new fixture and #7577's config line in check output without re-blessing the fixture against both, so goldens check is red on main. Ported here so this PR's merge tree is green; no-op once main carries the same bless. Co-Authored-By: Claude Opus 5.5 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
|
The required e593a95 merges main and ports the re-bless ( Generated by Claude Code |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
There was a problem hiding this comment.
Confirmed findings
- Spec only extends example 13 in prose; adding numbered 13a/13b would let the corpus case cite a literal example instead of analogy.
- Other adjacent oracle modules (smoke/custom/snapshot/predicate) in the same oracles directory could share the splitters or pattern-admission logic but were not walked; if any of them re-implement a top-level disjunction check, rule 1's new helper would be wasted and a sibling observer might still over-claim.
- Corpus case spec0231-ensure-disjunction-not-exact cites RIPR-SPEC-0231#13 by analogy; no numbered example in the spec spells a disjunction. Spec prose (rule 1) now describes the disjunction form, but a future edit to example 13 could silently invalidate the labeled expected_oracle. Spec already extends example 13 with disjunction phrasing; adding numbered examples 13a/13b would convert the citation from analogy to literal. Author acknowledged in seeded review (2026-10-13T15:20).
- Inequality cap order in is_inequality_assertion now also blocks deciding_disjunction_conjunct_rest, but only when contains_negated_pattern holds. Cases like
ensure!(a == b \|\| c == d)(no !pattern) still rely on classify_non_negated_assertion's disjunction cap; the interaction is correct but undocumented in classify.rs header.
Verification questions
- Confirm deciding_disjunction_conjunct_rest mirrors negated_pattern_conjunct_rest shape (mask comments, split top-level conjuncts, drop deciding group, re-emit macro call with
\n &&join) and is only invoked at classify_assertion entry plus the inequality-cap probe.
Refuted
- A single conjunct-visitor type would remove the duplicated split_top_level_conjuncts/has_top_level_disjunction traversal between has_deciding_disjunction and has_top_level_exact_equality; refuted because: The two predicates traverse conjuncts once each, reuse the same existing splitter, and conjunct count is bounded by source line length; introducing a Conjunct visitor type adds an abstraction layer without reducing passes. Trade-off rejected as not worth a type.
- A disjunction
a \|\| binside a call argument likef(a \|\| b)would be misread as a deciding top-level disjunction and wrongly cap the outer reading to relational_check weak.; refuted because: Refuted: has_deciding_disjunction only descends into parenthesized_contents of split_top_level_conjuncts; call args aren't conjuncts. relational_tests rowassert!(matches!(pick(\|x\| x > 1 \|\| x < 0), Ok(3)))keeps ExactValue/Strong.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
- changelog.d/7558-ensure-disjunction-not-exact.md and the spec paragraph in RIPR-SPEC-0231 both enumerate the same disjunction/truth-table prose. The spec prose is normative, the changelog prose is user-facing; further edits risk drifting from each other unless one cites the other. Not blocking, but worth a follow-up note in #7558.
- Hard-coded (32,35) and
> 35guard in population_tests.rs coupled only to case count; a future add/drop of a labeled case can silently desync numerator/denominator without check-fail. - Corpus case cites RIPR-SPEC-0231#13 by analogy (no numbered disjunction example); spec only adds prose in example 13, not a new 13a/13b numbered example.
- Hard-coded (32,35) literals plus the >35 guard in population_tests.rs couple the dx-scoreboard pin to a hand-counted labeled-case set, which is the same drift surface flagged by a prior lane and unrelated to today's boundary change.
Review of recordHead: ea16a53. This is e593a95 plus a main merge. The only conflict was the CI: green on this head, including Local proof on the merged tree:
Angles
Findings and resolutions
Blocking findings: none open. All review threads are resolved. Generated by Claude Code |
Summary
Before:
classify_fallible_assertionread a wholeensure!condition asexact_value/ strong as soon as one==or!=appeared anywhere in it. So these all reported a strong exact oracle on the related test, although each only rejects some values:ensure!(a != b || c == d)ensure!(f(|x| x == 1))ensure!(xs.iter().position(|x| *x == 1) != None)ensure!(r == Err(E::A) || r == Err(E::B))After: they read
relational_check/ weak (RIPR-SPEC-0231 rule 1). Exact credit needs a top-level==in some top-level&&conjunct, and no top-level||. A disjunction also never earnsexact_error_variant.ensure!(a == b),ensure!(a == b, "msg"),ensure!(a != b && c == d)andensure!((x == 4) && ready)stay exact.How:
has_top_level_exact_equalityinpatterns.rs, which reuses the existing top-level&&/||splitters. It replacescontains_exact_comparison, which is removed.assert!repro:assert!already read these forms weak on main. I checked that with a probe on main 24dd3d0, and the regression test keepsassert!controls.Fixes #7558.
Swarm / Source Boundary
ripr-swarmSource-of-truth Links
ensure!(a != b || c == d)reads exact_value / strong #7558.ensure!whose only==sits in an||arm, a closure or a call argument readsrelational_check/ weak.Regression case and moved rows
spec0231-ensure-disjunction-not-exact. The test isensure!(score(2) != 0 || score(3) == 6). Runtime truth:x * 3survives, whilex * 0andx - 2are killed.verdict-corpus relabel --casereplays this clean on 1.95.0.exact_value/ strong. I confirmed this by runningripr check --jsonon the case with the classifier change reverted.gapeither way, because the owner pin is unconfirmed. So the case labelsexpected_oraclerelational_check / weak, citing RIPR-SPEC-0231#13, which is the sameensure!inequality without the||arm.[oracle] match_floorand thepopulation_testspin follow. No existing row moved.Proof
ensure_disjunctions_and_nested_equalities_are_never_exactand the extendedexact_equality_ignores_string_contents_and_escapes.cargo xtask verdict-corpus check-allpasses. Rust is 57/438 false; Python, TypeScript and Perl are unchanged.cargo xtask precommitpasses.🤖 Generated with Claude Code
https://claude.ai/code/session_01EAoMKstQhYv56x2g6gEHZG
Generated by Claude Code