Repository navigation
Credit claims::assert_ok!/assert_some! payload pins on a verified claims import - #10645
Conversation
…ims import (#9619) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TWhvd7eb6ejVMezcdd4sUZ
|
Review of record, head e6e53a3 Angles: correctness, tests/oracle grip, spec, security/fail-closed, blast radius.
Findings: none blocking. Generated by Claude Code |
|
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 23 minutes. View limit details
Comment |
There was a problem hiding this comment.
Code Review
This pull request implements support for claims payload owner-pins (assert_ok! and assert_some!), allowing them to pin Ok/Some payloads like .unwrap() when imported from a verified claims dependency. The changes include syntax and classification updates, extensive test coverage, and documentation updates. The review feedback highlights two main areas for improvement: optimizing the claims macro import check to parse the source file only once instead of redundantly for each macro, and improving the robustness of the macro operand parsing to handle trailing whitespace or comments.
… four claims rows (#9619) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TWhvd7eb6ejVMezcdd4sUZ
|
Review of record update, head 4debbb8 The first CI run (e6e53a3) failed
Also in this push: single-parse Findings: none blocking. Generated by Claude Code |
|
Run 40308542502 on 4debbb8 stopped at Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm tRUSTED_MACRO_NAMES is shared beyond owner-pin classification, so this lane cannot prove the absence of sibling behavior changes without inspecting those consumers.
Refuted
- The claims macro names are globally trusted and therefore could affect targeted_calls or field_selector outside a test scope.; refuted because: The trusted-name expansion is intentional test-scoped analysis behavior; the PR documents the existing expect-style exposure, and the changed classifier applies claims import gating before payload credit. No new incorrect public result is demonstrated by the diff.
- Qualified
claims::assert_ok!should be admitted by the PR claim.; refuted because: The specification and seeded resolution deliberately limit this feature to imported macros under their own names; qualified invocation is explicitly fail-closed and tested. - The shared trusted-macro list makes every claims-named macro trusted wherever TRUSTED_MACRO_NAMES is consumed.; refuted because: This change does not alter those consumers' existing behavior; the new claims credit route independently requires source_imported_claims_macros and a verified manifest import. The seeded thread explicitly identifies this as pre-existing expect-style exposure.
- Claims import recognition is limited to clean, unrenamed use trees from the claims crate; the surrounding binding/manifest machinery must still reject foreign, path, git, package, absent, or shadowed dependencies.
- Qualified claims::assert_ok!(...) invocations should receive payload credit according to the PR wording.; refuted because: The current claim deliberately scopes admission to imported bare macro invocations; the seeded thread records this as an intentional fail-closed exclusion and adds a refusal test.
Parked follow-ups
- The claims macro names are added to a shared trusted-macro list, which the PR body identifies as being consumed by targeted_calls and field_selector without an equivalent test-scope guard.
Evidence gaps
- Executable proof is not yet available in this packet because ripr failed and cargo-test is pending its late receipt.
- Current-head executable test proof is unavailable in the cached evidence.
- Model proof intent was rejected by deterministic validation.
- The successful cargo-test/ripr proof is not available in the packet: ripr failed with exit code 2 and cargo-test is still scheduled late.
#10564 added a poll_context first parameter to awaited_call_shape; the claims payload route keeps both behaviors valid by passing the same context the sibling unwrap route passes.
|
Review-of-record verification, head ee07c25 (main merged through c98fc80 + conflict repair) Completing the board review's one required verification check —
Neither sibling file is modified by this PR. The residual exposure — a foreign crate exporting an incompatible Merge conflict repaired: merging main surfaced one semantic conflict — #10564 added a Proof on the merged head: |
There was a problem hiding this comment.
Refuted
- Adding claims names to TRUSTED_MACRO_NAMES makes any foreign or renamed assert_ok!/assert_some! invocation trusted.; refuted because: The payload route independently requires a manifest-verified claims import under the macro's own name; tests explicitly refuse foreign, renamed, local, path, package, and absent-dependency cases.
- The changed corpus expectations weaken the oracle rather than proving the intended transition.; refuted because: Rejected: the target row advances to the implementation's claimed credited/exposed/ideal state and its missed-credit exception is removed; sibling rows remain limited and are not over-promoted.
- The payload credit could be widened to arbitrary macro operands or non-payload variants.; refuted because: claims_payload_call requires an exact parenthesized operand and only assert_ok/assert_some can produce a payload; wrapped operands, converted operands, assert_err, and assert_none are excluded or non-crediting.
Parked follow-ups
- The changed shared trusted-name list may affect sibling consumers beyond payload classification.
- The shared trusted-name expansion may alter sibling classifier behavior beyond owner pins; the seeded thread reports inspection of those consumers but no current executable proof.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- A successful cargo-test receipt is still pending from the late evidence phase, while the ripr sensor failed with exit code 2.
- The scheduled cargo-test proof is required to establish that the newly documented positive and negative cases pass with the complete workspace changes.
- The claims payload route appears to require a verified import and the existing unwrap and bound-variable gates, but failed ripr evidence prevents an independent end-to-end verdict.
|
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TWhvd7eb6ejVMezcdd4sUZ
|
Review of record update, head e1826df Main moved after ee07c25 (whose required run was green), so the label raised a conflict notice. Merge of main resolved two adjacent-addition conflicts (the Findings: none blocking. Generated by Claude Code |
There was a problem hiding this comment.
Refuted
- The shared trusted-name expansion makes foreign, renamed, local, or qualified claims macros trusted.; refuted because: The payload route independently requires a manifest-verified own-name claims import and exact operand; the PR explicitly refuses qualified invocation, renames, local macro_rules, and unverified dependencies.
- The claims payload implementation should admit qualified claims::assert_ok! calls or broaden operands beyond one exact call.; refuted because: The specification deliberately limits the feature to own-name imported macros, and qualified invocation is explicitly fail-closed and tested.
- The corpus changes weaken the oracle by promoting unrelated claims rows.; refuted because: Only the target row advances to credited/exposed/ideal; the related rows remain limited and are only marked weakly exposed.
Parked follow-ups
- Shared trusted-macro classification may affect sibling consumers beyond owner-pin classification.
- The shared trusted-name expansion's blast radius is verified only through the seeded consumer inspection, not by a new focused regression in this diff.
- Expanding the shared TRUSTED_MACRO_NAMES list can affect sibling classifiers; the seeded review records an intentional targeted_calls change, but field_selector behavior was not independently evidenced in this lane.
- The shared trusted-name expansion can affect targeted_calls and field_selector beyond owner-pin payload credit.
Evidence gaps
- Execution proof for the current head depends on the scheduled late cargo-test receipt, which is not yet available in this packet.
- Model proof intent was rejected by deterministic validation.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Review of record (exact-head sweep, head ee07c257920d1b29456cc685261ee50d16387a71)
Substantive review of the full head diff (12 files: two analysis source files, the syntax export, a new integration test, spec, traceability, changelog, four verdict-corpus rows, missed-credit ledger). The only prior review on this head (github-actions[bot], id 5659658968) is an automated notice whose own evidence section reports failed sensor evidence; this is the substantive record. It independently confirms that notice's parked follow-up about shared TRUSTED_MACRO_NAMES consumers with the concrete mechanism (Finding 3).
Verified
Read at head ee07c257 via gh api repos/EffortlessMetrics/ripr-swarm/contents/<path>?ref=ee07c257920d1b29456cc685261ee50d16387a71 (raw):
crates/ripr/src/analysis/classify/owner_pin.rs— the new claims arm inbound_whole(4117–4137),claims_payload_call(5646–5665),unwrap_wrapperderivation (3884–3908),expectedwrapper handling (4324–4331),ReturnPathGate::admits(5441–5462),bound_by_macro_with(8932–8945), the bare-call gate'sclaims_macros(4541–4575),TEST_SCOPED_TRUSTED_MACROS/is_bounded_macro(6400–6424),bound_owner_initializer(5560–5639),error_variant_key(6227–6262).crates/ripr/src/analysis/syntax/owner_pin.rs—TRUSTED_MACRO_NAMES(470–512),CLAIMS_CRATES/drop_in_crates/is_drop_in_assertion(1369–1410),source_imported_claims_macros(1417–1434),MacroBindingKind/macro_binding_scan(399–466),file_binds_value_name(3093–3174).- Sibling consumers:
classify/targeted_calls.rs:239–264(claims leaves fall through_ => opaque, so no operand credit is built there) andclassify/arm_selection/field_selector.rs:141–157. - Masking contract:
analysis/extract/mask.rs:274–400— the state machine emits exactly one output byte per input byte, soclaims_payload_call's reuse ofmaskedoffsets to sliceoperandis offset-safe; comments/strings after the closing paren mask to spaces, matching the trailing-comment positive test. - Parse caching:
parse_clean_source_file→parse_source_filewith a content-keyedPARSE_CACHEup to 512 KiB (syntax/nesting.rs:39–81), so the new per-assertionsource_imported_claims_macroscalls (classify 4122–4126 and 4547) are cache-served for typical test files. No performance finding filed. - Corpus honesty: read
fixtures/rust-verdict-corpus/cases/lib-claims-assert-ok-unwrap-then-eq.json(truth isruntime_mutant_killwith two failing mutants; the labeling observation records ripr5e385c644reportingreachable_unrevealedfor exactly this shape, so the new positive discriminates old vs new behavior) plus the three sibling claims cases (assert_ge!,assert_some_eq!, side-onlyassert_some!). None of the siblings uses the four added names as a payload pin; theirreachable_unrevealed→weakly_exposedmovement withchanged_since_labeling: trueand retained missed-credit rows is re-observation, not silent re-blessing. - Traceability:
.ripr/traceability.d/9619-claims-payload-owner-pin.tomlregisters the new test under RIPR-SPEC-0197; the spec gains the Claims payload pins section and Test Mapping; changelog entry present. Scope matches the body's claims. - Required gate:
gh api repos/EffortlessMetrics/ripr-swarm/commits/<head>/check-runs—Ripr Rust Small Result(the only required status check perbranches/main/protection/required_status_checks) succeeded on this head (run 40406711466, completed 2026-10-26T22:34Z; the failed/cancelled set at 21:44Z is a superseded run).
Not run in this review: the new integration test, cargo xtask goldens check, and any executable reproduction (review-only lane, no worktree). PR-body validation (precommit exit 0, 658 lib tests, corpus 0 false of 713) is Reported, not independently verified.
What holds up well: claims_payload_call is fail-closed (exact whole-operand shape, ! required, paren delimiter only, nothing after the close, non-payload assert_err!/assert_none! excluded, renamed/qualified invocations cannot match); the credit reuses the unwrap pin's existing binding/expected/exit gates; the new test's 19 cases cover a real refusal matrix; corpus bookkeeping distinguishes credited transition from abstained movement.
Findings
-
[P1] Claims payload arm credits an
assert_ok!/assert_some!pin under theErrVariantgate, inverting the panic direction — inline atcrates/ripr/src/analysis/classify/owner_pin.rs:4127. -
[P2]
source_imported_claims_macrosadmits a claims import from any module scope in the file — inline atcrates/ripr/src/analysis/syntax/owner_pin.rs:1426. -
[P2]
field_selectornow admits statement expansions of the four names by name alone, including locally redefined ones — inline atcrates/ripr/src/analysis/syntax/owner_pin.rs:477. The PR body discloses the shared-list blast radius; the inline comment adds the concrete fail-open mechanism found by readingfield_selector.rs:141–157andfile_binds_value_name(which seesFn/Const/Static/IdentPat/UseTree, notMacroRules).
Disposition: 1 blocking finding (listed: Finding 1, P1). Findings 2 and 3 are P2 follow-ups and do not block on their own. Resolve Finding 1 with a code change or a source-backed refutation; either way an ErrVariant + claims payload case in crates/ripr/tests/claims_payload_owner_pin.rs (credited: false, or a reasoned exclusion from scope in RIPR-SPEC-0197) would settle it.
…rt-scope limitation (#9619) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TWhvd7eb6ejVMezcdd4sUZ
|
Review of record update, head 0c8caa2 e1826df was green on the required result; the substantive review then found a valid P1, so this head supersedes it.
Local on this head: Findings: none blocking. Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- The claims payload arm lacks the direction gate required by the specification: an ErrVariant pin can still be read through assert_ok! or assert_some!.
Verification questions
- Confirm the corpus and test changes demonstrate the intended owner-payload transition, but they do not discriminate the opposite-direction ErrVariant regression.
- Confirm the Ok/Some direction guard has no discriminating negative test; the seeded thread confirms an Err-direction shape is exposed through an independent pre-existing route even when the claims arm is absent.
Refuted
- Qualified claims::assert_ok! invocation is an unsupported route rather than a regression.; refuted because: Rejected as a concern for this change: the spec and seeded resolution deliberately admit only own-name imports, and the integration test pins qualified invocation as refused.
- The payload route broadens the operand to arbitrary expressions.; refuted because: claims_payload_call requires one balanced parenthesized operand containing only the exact call, and existing bound-variable, mut, derived-expected, and method-use gates remain active.
Parked follow-ups
- The shared TRUSTED_MACRO_NAMES expansion can alter sibling classifier behavior outside the verified claims-import route.
- The new claims macro names are consumed outside the owner-pin route through TRUSTED_MACRO_NAMES.
- Import admission is file-wide rather than scoped to the asserting test's module.
- The shared trusted-name expansion has a separate fail-open-by-name blast radius, while claims import scoping remains file-granular.
Evidence gaps
- The PR claims the focused test fails without the source change, but this packet contains no negative-source execution receipt; the late cargo-test receipt can only prove the current head passes.
- Model proof intent was rejected by deterministic validation.
|
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01TWhvd7eb6ejVMezcdd4sUZ
|
Review of record update, head 3c91ef0 Main moved again (#10280); the only conflict was the shared RIPR-SPEC-0197 Test Mapping tail, resolved keeping both sides. The 00:12Z automated review's one "confirmed" finding (no direction gate) was written against a pre-fix snapshot: the gate is in 0c8caa2 ( Findings: none blocking. Generated by Claude Code |
There was a problem hiding this comment.
Verification questions
- Confirm the Ok/Some direction guard lacks a discriminating negative test.
Refuted
- Qualified claims::assert_ok! invocation should be credited.; refuted because: The feature contract deliberately admits own-name imported macros only; the qualified-path refusal is explicitly tested and specified.
- The trusted import route admits arbitrary claims operands or foreign/renamed/local macros.; refuted because: claims_payload_call requires an exact parenthesized operand; source_imported_claims_macros requires a claims import under the macro's own name, while the owner-pin route independently requires manifest verification and existing binding gates.
- The implementation admits renamed, foreign, local, qualified, or unverified claims macros.; refuted because: The payload route independently requires an own-name claims import, and the matrix explicitly refuses renamed, foreign, local, qualified, path/package, and absent-dependency cases.
- The implementation is architecturally too broad because it changes the shared trusted macro list and adds a separate claims-specific list.; refuted because: The separate claims list confines payload credit and import parsing to the intended feature, while the shared-list exposure is explicitly disclosed and already tracked as a follow-up; no new incorrect sibling result is demonstrated by this diff.
- The corpus updates over-promote unrelated claims rows and weaken the oracle.; refuted because: The target row advances from limited/reachable_unrevealed to credited/exposed/ideal, while sibling rows remain limited and are only changed to weakly_exposed; the target missed-credit entry is removed as claimed.
Parked follow-ups
- Adding four claims names to the shared trusted-macro list affects sibling consumers beyond the verified claims payload route.
- Adding claims names to the shared trusted-name list exposes sibling consumers to the same name-based trust model; seeded review identified field_selector as the remaining concrete follow-up.
- Import admission is file-wide, so an inner-module import can admit a test elsewhere in the file.
- Adding four claims names to TRUSTED_MACRO_NAMES may alter sibling consumers beyond owner-pin classification.
- The import check is file-scoped, so an import in one module can admit the macro name for a test elsewhere in the file.
- The claims import helper admits file-wide use-tree matches, so an import in one module can admit the macro for a test in another module; the specification records this as an accepted limitation.
Governing issue or accepted claim: #9619
Acceptance delta (one sentence):
let v = claims::assert_ok!(owner(..)); assert_eq!(v, literal)now credits the owner pin when the test file imports the macro from a manifest-verified registryclaimsdependency, and thelib-claims-assert-ok-unwrap-then-eqmissed-credit row is removed.What changed
assert_ok,assert_err,assert_some,assert_nonejoin the trusted macro names, scoped to a verifiedclaimsimport in the test file (theexpect!precedent). No import, a renamed import, another crate, a localmacro_rules!, or apath/git/package/absent dependency all refuse.bound_wholereadslet v = assert_ok!(<call>)/assert_some!(<call>)as the owner call whose payload isv, then reuses the existing unwrap-wrapper and bound-variable rules (mut, derived expected, method use of the local, wrapped operand and a bound opposite exit all refuse).claims_payload_owner_pin.rs, 4 credited and 13 refused cases; fails without the source change.Blast radius
TRUSTED_MACRO_NAMESis also read bytargeted_calls.rsandfield_selector.rswithout a test-scope guard (expectalready has this exposure). Lib tests covering owner_pin, macro, targeted_calls and field_selector pass (658).Local:
cargo xtask precommitexit 0.Generated by Claude Code