Repository navigation
fix(oracles): inline unwrap_err equality against a named variant is an exact error-variant oracle (#12266) - #12290
Conversation
…d variant is an ExactErrorVariant oracle (#12266) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri
|
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 32 minutes. View limit details
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY — head ae56ea8
I read the diff, built this head, ran ripr check --mode fast --format json on a Rust subject with the control spellings, and recomputed the unchanged-after-attempt hash chain. I could not run the lib tests here; Ripr Rust Small Result had not run (Admit queued).
The two extraction paths agree. The same is_inline_unwrap_err_error_assertion(&text) is OR'd next to is_unwrap_err_bound_error_assertion in both the line scan (extract/oracles/scan.rs) and the rust-analyzer path (syntax/ra.rs::extract_parser_oracles), under the existing ExactValue|WholeObjectEquality and Strong precondition, and the helpers ends_with_unwrap_err/ends_with_expect_err are only widened to pub(super).
Behaviour on the built head (changed Err(E::Empty) → Err(E::Bad); the predicate finding's related tests):
assert_eq!(parse("", A).unwrap_err(), E::Empty)→exact_error_variant/ strong; the reversed operand order →exact_error_variant/ strong.assert_ne!(.., E::Bad)→relational_check/ weak (not upgraded).let expected = E::Empty; assert_eq!(.., expected)(opaque expected) →exact_value/ strong (not upgraded).assert_eq!(format!("{:?}", ..unwrap_err()), "Empty")(not anunwrap_err()operand) →whole_object_equality/ strong (not upgraded).
These match the negative controls the PR lists; its unit controls also cover an unwrappedOkread and.unwrap_err().kind().
One edge, not blocking. assert_eq!(parse("", A).unwrap_err(), parse("", B).unwrap_err()) (both operands error reads, the second containing a Mode::B path) is labelled exact_error_variant, because expression_pins_specific_error accepts any operand containing a Path::Variant token. Its strength stays weak on the built head, so it earns no strong credit, but the label is wrong for a comparison that names no variant. Cheap fix: when one operand is an error read, require the other not to end in .unwrap_err()/.expect_err(..). The bound-variable spelling has the same looseness.
Cache. Full 1.135, sharded and compact 0.138 and file facts 1.51 → 1.52 are consistent with the version asserts, OUTPUT_SCHEMA and both CURRENT_CORPUS_CACHE_SCHEMA_VERSION constants; the file-fact bump is the right one because the oracle fact changes. Hash chain recomputed with raw_json_placeholder_v1: before/after.repo-exposure.json hash to their stored f36590e9…, and agent-receipt.json and agent-verify.json carry matching hashes. The value is the same as on #12246 and #12254 (all three change only cache_schema_version to 1.135), so two of the three need to re-bump and re-chain to 1.136/0.139, with a delta review. One thing to confirm: fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-identical-inline-arms.json still says "cache_schema_version":"1.134" here; the previous bump PRs (#12211, #12157) updated it and #12246 does. I did not find a gate that compares it, so it may be harmless, but the last two bumps kept it in step.
Spec and proof as stated: RIPR-SPEC-0106 states the inline form, with traceability and a changelog fragment. The author's reported proofs (17363 lib tests, goldens, verdict corpus, zero per-pick pilot ranking change) were not rerun by me. The PR correctly says the rust-hex seam only changes once #12254 lands too.
Before merge: Result green on ae56ea8; re-bump if #12246 or #12254 merges first.
Generated by Claude Code
|
Triage at ae56ea8: required gate Ripr Rust Small Result is RED, completed-failure in run 41359792946. Same-head fellow failures: Rust tests shard 1 of 4, Rust test shards verify, Rust-only feature lane, ranking. Next: owner repair, start from the shard-1 log, then re-run. |
…variant pin; sync file-fact cache pins and the honesty report (#12266) - map_err replaces the error, so the inline pin refuses it (Devin finding) - grouped (parenthesised) error read is accepted; two error reads pin no variant - cache_clear_safety and OUTPUT_SCHEMA example follow file-fact 1.52 - identical-inline-arms honesty report recaptured at 1.135 - seam-level full/compact negative for the mapped error Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri
|
Delta since ae56ea8, new head 7c0f960 (merge-ready re-applied):
Needs a delta review on 7c0f960. Generated by Claude Code |
|
Independent delta source review of 7c0f960: the original method-chain mapped-error finding and grouped-positive issue are addressed, but the same false-credit family remains via standard UFCS spelling:
Changing parse from Err(Odd) to Err(Bad) leaves that assertion passing. patterns.rs:204,216–220 rejects only dot-prefixed map_err; scan.rs:2812–2840,2910–2934 accepts Result::map_err(...) as the first plain-path call without checking its arguments. The ErrorVariant consumer at test_grip_evidence.rs:4205,4249–4281 does not supply an exact-error-value preservation check. REPAIR_REQUIRED for this remaining spelling. Please extend the existing extraction/full–compact mapped-error negative control and repair the same owner path, retaining direct, reversed, expect_err and grouped positives. This is source reasoning, not independently executed mutation evidence. The cache/example corrections were inspected separately; dirty-tree fixture provenance is not exact-head runtime proof. Existing qualification 41368150651 remains owned and should not be duplicated. |
… as an inline variant pin (#12266) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri
|
Head 5a38a74 (merge-ready re-applied): repairs the UFCS The Generated by Claude Code |
|
|
|
Affected-source review of |
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY — head 5a38a74
Delta review since my review of ae56ea8 (two pushes: 7c0f960, 5a38a74). Unaffected dimensions (both extraction paths, cache constants, hash chain, schema pins) are carried from that review; I did not redo them.
What I ran. Built the lib tests at 7c0f960 and at 5a38a74 (debug info off) and ran inline_unwrap_err and spec_0106: 24 passed at each head. Then mutated the production code and reran at each head:
- at 7c0f960: dropping the
map_errrefusal failsinline_unwrap_err_requires_an_equality_with_a_specific_errorand the seam test; dropping the two-reads refusal fails the negatives test; disabling the grouping loop fails the grouped positive and the seam test. - at 5a38a74: disabling the
Result::/Option::owner refusal fails the negatives test (the new UFCSand/map_errrows). The identifier-boundary change inhas_error_replacing_adapteris not pinned: replacing it with "always true" leaves all 24 passing (the guard against matching inside a longer name liketry_map_err(). Cosmetic, not blocking.
Finding, non-blocking (recall, fail-closed). The new owner refusal also rejects the UFCS spelling of the thing being pinned. I added assert_eq!(Result::expect_err(parse("x"), "must fail"), ParseError::Empty) and the std-path variant to the positive list at 5a38a74: the positive test fails. Result::expect_err(call, msg) is a read receiver_keeps_call_error and ends_with_expect_err both support, and by reading is_error_read at 7c0f960 it was accepted there (I did not run that head with this row), so this push drops it. The direction is a missed credit (gap stays), not a false pin, and the spelling is rare. Either narrow the refusal to adapter names (and, or, ok_or, ..) or add that spelling as a deliberate negative so it reads as intended.
Other. Honesty-report recapture at 1.135 carries a -dirty analyzer_version and a local root path (/tmp/claude-0/ia); the other report in that folder has the same shape and nothing I found compares those fields, so I did not treat it as a defect. Main is still at cache 1.134, so the 1.135/0.138 collision with #12246/#12254 remains: whichever lands second re-bumps and re-chains.
Not run. Ripr Rust Small Result on this head (checks were queued when I looked); precommit; goldens.
Generated by Claude Code
…ize turbofish map_err Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri
|
Head 77348b5 needs a delta review. Three changes since the reviewed 5a38a74:
Ran locally: Generated by Claude Code |
|
Affected-source review of |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- expect_err is classified as an exact error-variant oracle even though it panics if the owner returns Ok; the assertion may therefore pass by panic rather than by observing the named error.
Verification questions
- Confirm full and compact seam routes agree on direct, reversed, grouped, and expect_err positives while rejecting mapped, turbofish, different-variant, and opaque expected forms.
- Confirm the implementation does not require the unwrapped result to be an error; direct owner tests can be classified as exact error pins even when the owner can return Ok.
- Confirm the new seam test exercises positive and negative classifications but does not test an owner returning Ok, so the panic/Ok behavior remains unspecified.
Refuted
- The modified code path handles source text and oracle classification rather than raw memory, secret material, network input, or executable payloads.
Parked follow-ups
- Result::expect_err UFCS recall loss is a known sibling path explicitly filed as #12336 and is not reopened by this diff.
Evidence gaps
- Hosted cargo-test evidence is still absent, so runtime execution of the new seam test is not established by this packet.
- Model proof intent was rejected by deterministic validation.
- No current-head executable receipt proves the changed tests fail against the pre-change implementation.
- Absent ripr and cargo-test receipts leave the behavioral claims without this lane's independent executable witness.
… pin Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri
|
Head be37e32 (on top of 77348b5) addresses the grouped-receiver finding. Delta review needed for this head.
Ran locally: Generated by Claude Code |
|
Independent affected-source disposition on The full-seam |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri
|
Head 61a7fb2 is be37e32 plus a clean merge of main (#12325, the Generated by Claude Code |
|
Independent integration-source disposition on |
There was a problem hiding this comment.
Parked follow-ups
- The PR's claim that all replacing-adapter spellings are refused is not fully proven at the full/compact seam layer: grouped Result::or is extraction-negative but omitted from the seam test, and the seeded thread says that seam route still returns Yes.
- UFCS Result::expect_err recall loss is outside this diff and explicitly parked in the seeded thread as #12336.
- Pre-existing full-seam Result::or(..., Err(...)) false-credit remains tracked separately in #12359.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- The exact-head cargo-test receipt is absent while the ripr sensor failed, so runtime completion cannot be inferred from scheduling or author-reported results.
- Exact-head cargo-test evidence is not present in the packet, so the changed extraction and full/compact controls are not independently witnessed by this lane.
- Exact-head runtime proof is incomplete because cargo-test is receipt-absent and the ripr sensor failed.
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY — head 61a7fb2
Delta review since 5a38a74. Three pushes: 77348b5 (main merge, cache 1.136 / 0.138 / file facts 1.52, turbofish map_err), be37e32 (grouped receivers), 61a7fb2 (main merge only: #12221, #12244, #12325; git diff be37e3253..61a7fb2b touches no extraction or syntax code). The code I ran is be37e32's, which is byte-identical to this head in every file this PR owns.
Run. Lib tests built at 77348b5 and be37e32 (debug info off): inline_unwrap_err, spec_0106, schema-version and cache filters pass, including the turbofish and grouped rows. The only failure in that set is fallible_literal_full_and_compact_warm_caches_invalidate_changed_inputs, which stops on its own message ("environment gap ... prepare canonical fixture dependencies"): offline fixture deps on this host, not this PR.
Mutations, each failing the intended test:
strip_turbofishreplaced by identity:inline_unwrap_err_requires_an_equality_with_a_specific_errorand the seam test fail.- leading-group trim in
has_error_replacing_adapterremoved: the negatives test fails on the new grouped UFCS rows. - (earlier heads)
map_errrefusal, two-reads refusal, grouping loop,Result::/Option::owner refusal: each fails its test.
Cache. Main is at full 1.135 / sharded and compact 0.137 / file facts 1.51; this PR moves them to 1.136 / 0.138 / 1.52 with the doc comments, the pinned-constant tests, CURRENT_CORPUS_CACHE_SCHEMA_VERSION, OUTPUT_SCHEMA and the file-fact blockers in cache_clear_safety.rs all agreeing. #12246 and #12368 also claim 1.136, so whichever merges after this re-bumps and re-chains.
#12359 (the Result::or(call, Err(V)).unwrap_err() credit): predates this PR, not blocking here. I added probes to the seam test and ran it with the inline pin switched off entirely (is_inline_unwrap_err_error_assertion returns false). Result::or(parse("1"), Err(Fault::Odd)), its grouped form and MyResult::or(..) all still read Yes; the plain parse("1").unwrap_err() drops from Yes to Weak. So the false credit comes from another route that is independent of the pin. The pin refuses the text (negatives test), which is what this PR owns. It is a real false credit (the asserted value is a literal), so #12359 should be fixed on its own; it must not be claimed fixed by this PR.
Carried from my earlier review: the non-blocking UFCS Result::expect_err(call, msg) recall loss (a missed credit, not a false pin).
Not run. Ripr Rust Small Result on this head (unstable/in flight when I looked), goldens, precommit, the honesty gate, and the hash chain recompute after the 1.136 re-chain; the owner could not run them locally either, so the hosted Result must cover them before merge.
Generated by Claude Code
…n exact error-variant oracle (#12266) (#12290) * fix(oracles): an inline unwrap_err/expect_err equality against a named variant is an ExactErrorVariant oracle (#12266) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri * fix(oracles): refuse a mapped error and two error reads as an inline variant pin; sync file-fact cache pins and the honesty report (#12266) - map_err replaces the error, so the inline pin refuses it (Devin finding) - grouped (parenthesised) error read is accepted; two error reads pin no variant - cache_clear_safety and OUTPUT_SCHEMA example follow file-fact 1.52 - identical-inline-arms honesty report recaptured at 1.135 - seam-level full/compact negative for the mapped error Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri * fix(oracles): refuse UFCS map_err and Result::/Option:: adapter calls as an inline variant pin (#12266) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri * Refuse grouped UFCS error-replacing adapters in the inline unwrap_err pin Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri --------- Co-authored-by: Claude <noreply@anthropic.com>
Governing issue or accepted claim: #12266
Acceptance delta (one sentence):
assert_eq!(f(..).unwrap_err(), MyError::Variant)(either operand order, also.expect_err("..")) classifies asExactErrorVariant/Strong, as the bound-variable spelling already did, so a direct owner test that pins the seam's variant discriminates anerror_variantseam.Cause
unwrap_err_bound_variables+is_unwrap_err_bound_error_assertionupgrade onlylet e = f(..).unwrap_err(); assert_eq!(e, E::V). The inline spelling staysexact_value, and anErrorVariantseam accepts onlyExactErrorVariant/GuardedResultMatch. On rust-hex,src/lib.rs:226(Err(FromHexError::OddLength)) wasstrongly_grippedonly becausetest_display(pinsDisplay, notfrom_hex) lent it credit. #12254 removes that credit and exposes this hole (#12263).Change
patterns.rs:is_inline_unwrap_err_error_assertion(equality only, one operand is theunwrap_err()/expect_err(..)result, the other names a specific error;assert_ne!, opaque expected values,Okreads and.unwrap_err().kind()are not upgraded).scan.rs) and the rust-analyzer path (syntax/ra.rs).unchanged-after-attempthash chain regenerated. fix(repair): a proximity test pinning another function cannot credit any seam kind (#12146) #12254 (also claiming 1.135 / 0.138) re-bumps if this lands first.Proof observed (by the author, on the pre-precommit tree of head ae56ea8)
expect_err, wrapped), negative controls, and a full/compact repo-seam test (own variant discriminates; other variant and opaque expected value do not).cargo test -p ripr --lib: 17363 passed, 0 failed.cargo xtask goldens check,fixtures,check-evidence-promotion-honesty,verdict-corpus check-all(4 corpora checked; typescript 0/373 false verdicts, the rest reported 0 false by the command's exit): exit 0.cargo xtask precommit: exit 0.Not established
🤖 Generated with Claude Code
https://claude.ai/code/session_01PResvVn1d7d3d4PYtRgdri