Repository navigation
fix(analysis): confirm a one-letter changed field through its read on the owner's result (#15274) - #16140
Conversation
… the owner's result (#15274) A changed field whose name is too short to be a token (`y: 0` to `y: 1`) gave an assertion no name to share, so `assert_eq!(origin_shift(3).y, 1)` left both the field_construction and the return_value finding at weakly_exposed with observation_unconfirmed, and verify stayed refused. Such a field now confirms through a `.y` read on the owner's own result, called directly or bound with `let`, under the direct-call defeats the assigned-field read uses. A read of another field, the same name on another value, or a read copied into the expected side still confirms nothing. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmmSMBuovLRPTFeSczf
|
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 19 minutes. View limit details
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY for head 64029f1
Independent native-Windows review of fix(analysis): confirm a one-letter changed field through its read on the owner's result (#15274 repro 5) at 64029f1.
Source review (verified against source)
-
Root cause is exact:
extract_identifier_tokensdrops identifiers of two characters or fewer, so a field namedy,xoridproduced no token and no assertion could ever confirm it — the PR body isolates this by the same repro readingexposedafter renaming the field tolift. -
The fix is narrowly scoped in
classify/reveal.rs: a changed field of the owner's returned record whose name yields no token confirms only through a.yread on the owner's own result, via the existing RIPR-SPEC-0225reads_owner_result_fieldrule, and only under the same direct-call defeats as the assigned-field read (direct owner-call relation, no foreign import, no cross-package namesake, no owner shadow, notshould_panic). The bare name never confirms. -
False-credit controls are pinned: a read of another field (
.x), the same name on another value, a longer name starting withy(.yaw), and a read copied into the expected side (assert_eq!(p, Point { x: 3, y: p.y })) still confirm nothing; a builder override of the field is narrowed away by the existing RIPR-SPEC-0040 pass. -
Evidence discipline: the fixture pair (
rust_field_construction_short_field_nameconfirming read,..._other_fieldcontrol) plus an honesty-corpus entry pin the reading in both directions, with traceability, changelog, and spec notes moving together. -
Native proof (native Windows, worktree wt-16140 at head 64029f1; batch-A redo after infrastructure worktree loss): sections
16140 lib confirms_a_short_field_write (redo)+16140 fixtures (redo)+16140 honesty (redo)=> 1 passed; 0 failed across 1 test-binary result(s) (all exits 0); fixtures green: 2; evidence-promotion honesty check green.
Residuals
None blocking. Fields of two characters that DO tokenize elsewhere keep their existing readings; only the no-token case changes.
…ead (#15274) The one-letter field credit added for repro 5 took `origin_shift(3).y()` as a read of the field `y`, so a `y()` method returning a constant confirmed a changed `y` initializer it never reads, and both findings read exposed on a test that passes on old and new code. The short-field path now asks `reads_owner_result_field_value`, which refuses a read whose next non-space text is `(` or `::`. Nothing reads that method's body there, so a getter of a short field stays unconfirmed (fails closed). The RIPR-SPEC-0225 assigned-field read keeps its existing reading: its same-named accessor credit is pinned by the verdict corpus (`mined-one-line-struct-literal-field`). Adds the rust_field_construction_short_field_name_method_call control fixture, two honesty-corpus rows and unit cases beside `.yaw`. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmmSMBuovLRPTFeSczf
…15274) Formatting-only movement from main's summary wording; the method-call control's next step follows the scoped short-field rule. Both findings of each fixture keep their class. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmmSMBuovLRPTFeSczf
…ive receiver (#15274) Two false confirmations of a changed one-letter field, both reported on review and reproduced with the built binary: - `assert_eq!(origin_shift(3).x, 3, "y was {}", origin_shift(3).y)` read the field in the failure message, which never fails the test. - `let p = origin_shift(3); ...; let p = Point::default(); assert_eq!(p.y, 0)` credited a receiver rebound to another value before the assertion. `reads_owner_result_field_value` now counts only reads inside the compared operands (the first two of assert_eq!/assert_ne!, the condition of assert!; any other form refuses) and requires a bound receiver's latest `let` before the assertion to bind from the owner call. The RIPR-SPEC-0225 reading is unchanged. Adds message_read and rebound_receiver control fixtures, four honesty-corpus rows and unit cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmmSMBuovLRPTFeSczf
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head de2cb21 by a session that did not write this change. This is a source review; hosted qualification and the final merge judgment belong to the owning session.
Read in full: the production diff in classify/reveal.rs and classify/activation.rs, the unit test, the three fixtures and their honesty-corpus rows, and the governing issue's repro 5.
Production: a changed field of the owner's returned record whose name yields no identifier token (y, id) can now be confirmed by a .y read on the owner's own result, under the direct-call conditions the assigned-field read already uses (direct owner call, no foreign import, no cross-package namesake, no shadow, not should_panic). The builder-override narrowing still runs after it. The short path calls reads_owner_result_field_value, which also refuses a read followed by ( or ::, so a method named like the field does not confirm.
Probes run here against a binary built from this head, each compared with the same case under a long field name and with a build of the PR's base bcb76da:
- Credited (exposed): an exact read on the direct call, and on a let-bound result.
- Stays weakly_exposed for y: a read of another field, a relational assertion, a self-comparison, assert_ne, a read on another function's result that wraps the owner call, the same name on another value, a nested record's outer field, a field overwritten before the read, a read copied into the expected side, and a method y() returning a constant. In several of these the long name is credited today and the short name is stricter.
- The method case read exposed on the first head I reviewed (64029f1) and reads weakly_exposed here; the new fixture rust_field_construction_short_field_name_method_call pins it.
Known limit that this head keeps, stated so nobody reads this review as covering it: when the owner builds the record in two branches and only one literal changes, a .y read through the other branch (origin_shift(-1).y against the unchanged literal) reads exposed for field_construction. Base does the same for a long field name, and #16524 tracks it for both. For short names this PR is what newly moves that case. I judge it a pre-existing weakness of branch activation and outside this change, and the owning session and coordinator should weigh that judgment.
Local evidence on this head: cargo build -p ripr, cargo xtask goldens check and cargo xtask verdict-corpus check-all exited 0. I did not run clippy, the unit suite or precommit; the author reports them, and hosted jobs are the full run.
Seam-cache generation: reveal_evidence is the only caller of analyze_related_assertions. I did not independently trace the classified-seam cache, so the author's statement that it does not store results of that path is unverified by this review.
Generated by Claude Code
#15274) Review found two more false confirmations of a changed one-letter field through a bound receiver: `let mut p = origin_shift(3); p = Point { .. }; assert_eq!(p.y, 1)` and `std::mem::replace(&mut p, ..)` before the read. Neither is a `let` or a field write, so the rebinding and overwrite checks let both through. The short-field path now accepts a bound receiver only when its latest `let` before the assertion is not `mut`. Nothing here tracks whole-value writes, `&mut` borrows or `&mut self` methods, so a mut receiver fails closed; `let mut p = origin_shift(3); assert_eq!(p.y, 1)` becomes a missed credit. The direct `origin_shift(3).y` read is unaffected. Adds the reassigned_receiver control fixture, two honesty rows and unit cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmmSMBuovLRPTFeSczf
… unshadowed (#15274) Review found three more false confirmations of a changed one-letter field through a bound receiver: a `for p in [..]` loop that shadows `p`, a pattern `let (p, _n) = ..` rebinding, and an initializer that only mentions the owner call (`let p = if false { origin_shift(3) } else { .. }`). The short-field path now requires the receiver's latest `let` to be exactly the owner call (optionally path qualified, optionally `?`), and every later mention of the name before the assertion to be a `p.` access; any other binding of the name fails closed. Adds the loop_shadow control fixture, two honesty rows and unit cases. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmmSMBuovLRPTFeSczf
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of 34b2e11 by a session that did not write this PR. Scope: the source delta since my earlier passes (64029f1, de2cb21, d929a8e, b18d635) read in full, plus a probe set run through a binary built from this head.
Probe set (33 cases, each run with field names y and lift, old and new owner source committed in a scratch repository, ripr check --base HEAD~1)
exposedfory, each a test whose result differs between old and new owner source: directorigin_shift(3).y, plainlet p, typedlet p: Point, path-qualifiedcrate::origin_shift(3), a read inside a compared closure argument.weakly_exposedfory, each a test that passes on old and new source: other field, relational, self compare,assert_ne!, wrapped by another function,.y()method, overridden field, another value with the same field name, outer field of a nested record, expected value copied from the read, read only in the failure message, reboundlet, reassignedlet mut,mem::replace,assert!(.. == ..), inner block shadow, tuple-pattern shadow, for-loop shadow,if letshadow, closure-parameter shadow, conditional initializer, chained initializer, struct-update initializer, record rebuilt around the owner call.- Match-arm shadow abstains (
static_unknown). - All seven findings from my earlier passes are closed on the short path.
Checks I ran on this head: cargo xtask goldens check, cargo xtask verdict-corpus check-all, cargo xtask check-evidence-promotion-honesty, all exit 0.
Limits that remain, stated so nobody reads this as wider than it is
- A read of a branch the changed construction does not produce still reads
exposedfor the field-construction probe (#16524). Present for long names on main; this PR extends the same reading to short names. - For
lift, the for-loop shadow readsexposedon this head. A binary built from current main gives the same result, so it is main's behaviour and is filed as #16551, outside this PR. - I did not verify the author's statement that the seam cache does not consume
analyze_related_assertions. - I did not run the unit tests, clippy or precommit; the author reports them and the hosted run covers them.
Generated by Claude Code
|
|
…-3dbg4z # Conflicts: # fixtures/evidence-promotion-honesty-corpus/corpus.json
…15274) Formatting-only: main's legend line for weak findings changed. Classes are unchanged. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmmSMBuovLRPTFeSczf
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of 1533419 by a session that did not write this PR. This pass covers the delta since 34b2e11, which I reviewed in review 6100988492.
What I compared
- The PR's patch to
crates/andxtask/against its merge base is identical before and after the merge of main (diffed hunk by hunk with index and position lines removed). The source I probed on 34b2e11 is the source on this head. - a3d6724 merges main. In the honesty corpus the PR's diff against the new merge base only adds rows; it removes none of main's.
- 1533419 changes one line in each of six
expected/human.txtfiles, the legend forweak(main's new wording), and adds the bless record to each fixture CHANGELOG. No class and nocheck.jsonchanges.
Carried from the earlier pass, on unchanged source: the 33-case probe set and the limits stated there (#16524, #16551, the seam-cache statement I did not verify).
Not run by me on this head: any build, goldens check, corpus checks, unit tests, clippy or precommit. The author reports them and the hosted run covers them.
Generated by Claude Code
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY
Final published-head review of 1533419 by the owning session.
Inspected on this head: the full production diff in classify/reveal.rs (the short-field confirmation in analyze_related_assertions) and classify/activation.rs (reads_owner_result_field_value, compared_operands_end, latest_binding_is_owner_call, is_exact_owner_call, only_field_accesses); the unchanged RIPR-SPEC-0225 reading (value = None takes the same path as before, pinned by verdict-corpus case mined-one-line-struct-literal-field); the unit cases; eight fixtures (one positive, seven controls) and their twelve honesty-corpus rows; traceability and changelog fragments.
Evidence on this exact head: every completed check run succeeded, including Admit PR Candidate, Ripr Rust Small Result, Rust gates and both Rust test shards (the first run of the new unit cases). The Merge-ready request run (02:47Z) is later than the last output change on main (02:38Z), so the new goldens match main's wording. Local runs on this head: goldens check, check-evidence-promotion-honesty, verdict-corpus check-all, clippy on ripr with all targets, and precommit, all exit 0. Independent source review 6101129442 on this sha, after five probe rounds (33 cases) on the unchanged source.
Review threads: three Devin threads, two repaired (message read, rebound receiver) and one answered as a fail-closed missed credit, all replied to and resolved. CodeRabbit and Gemini were quota-limited throughout, so their review is missing, not clean.
Limits kept out of the claim: #16524 (a field read through a branch the changed literal is not in), #16551 (main's long-name loop shadow), a single-field record's return_value finding staying unconfirmed, and a short-field getter staying unconfirmed. No seam-cache generation bump: seam_inventory and test_grip_evidence call neither analyze_related_assertions nor the changed activation helpers.
Generated by Claude Code
Requested by Steven · project thread
Summary
Point { x: dx, y: 0 }changed toy: 1, withassert_eq!(origin_shift(3).y, 1), readweakly_exposed/observation_unconfirmedfor both thefield_constructionand thereturn_valuefinding, soverifystayed refused.extract_identifier_tokensdrops every identifier of two characters or fewer. A field namedy,xoridhad no token, so no assertion could ever confirm it. Renaming the field toliftin the same repro readsexposedon main, which isolates the name length..yread on the owner's own result (origin_shift(3).y, orlet p = origin_shift(3); p.y) confirms. It reusesreads_owner_result_field, the RIPR-SPEC-0225 read rule, and the direct-call defeats the rust: a test that calls a&mut selfmethod and then asserts the written field readsmiss=no_call_path, so verify stays refused #14407 assigned-field read uses (direct owner call relation, no foreign import, no cross-package namesake, no shadow, notshould_panic)..x), the same name on another value, a longer name starting withy(.yaw) and a read copied into the expected side (assert_eq!(p, Point { x: 3, y: p.y })) still confirm nothing.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal: n/a
Spec: RIPR-SPEC-0001
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #15274 (repro 5)
Acceptance delta (one sentence): a test that pins a changed one-letter field through the owner's result moves both findings from
weakly_exposedtoexposed, while a read of another field staysweakly_exposed.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
claude/project-thread-3dbg4zStack parent or prerequisite PR (if any): none
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): n/a
Accepted winner and losing candidate disposition (when decided): n/a
Related, not duplicated: #16017 (merged) took repros 1 and 2 through
flow.rssinks. #12324 (#7894) aligns repo-evidence field grip with whole-value pins; it does not touch the supplied-diff token reading. #15322 and #16039 are noted under Non-goals.Scope
crates/ripr/src/analysis/classify/reveal.rs:analyze_related_assertionscollectsshort_record_fields(thefield_constructionprobe's record field when the owner returns a record it builds, or the changed fields of areturn_valuestruct literal) whose names yield no token, and lets an owner-result read of one sethas_token_matchunder the direct-call defeats. The existing builder-override narrowing still runs after it.crates/ripr/src/analysis/classify/activation.rs:reads_owner_result_fieldbecomespub(super); new unit testa_one_letter_field_read_holds_to_the_owner_result.Scope Classification
Production delta:
Evidence/support delta:
rust_field_construction_short_field_name,rust_field_construction_short_field_name_other_field), 2 honesty-corpus rows (must_not_promoteon the control), changelog fragment, traceability fragment.Single acceptance criterion:
rust_field_construction_short_field_namereads both findingsexposed;rust_field_construction_short_field_name_other_fieldreads bothweakly_exposed.Non-goals (the rest of #15274, traced on main bcb76da with the issue's repro inputs):
returnwith an out parameter) and repro 7 (self.items >= 3 && self.items < 20): the predicate keepsinfection_unknown/propagation_unknown. Repro 7'sreturn_valuefinding already readsexposed; its predicate twin keeps no sink because an&&operand can be masked by the other conjunct, which fix(analysis): give a name-only comparison tail and path-valued tail-if arms their return sink (#15274) #16017 kept on purpose. Both are analyzer limits under a strong reaching test, which is the shape Let the agent loop finish when only analyzer limits remain (#14821) #15322 lets end inverify=complete_with_limits.if x % 2 == 0 { Some(x) } else { None }to{ None } else { None }): noreturn_valueprobe exists for the changed arm, because a branch value on its condition's line gets no shape by design (fix(analysis): tail if/else branches written inline flow to the return value (#6781) #7626), and the two identicalNonearms defeat the edit-span cut inprobes/diff.rs. Fixing it is a probe-generation change with its own golden surface, not part of this PR.self.bal += ntoself.bal += n.max(0)): thecall_deletionfinding staysweakly_exposedfor long field names too (checked withbalance), and crediting it would also creditdeposit(3), which never activates.max(0). Its "Strengthen the related assertion" wording under an exact oracle is what fix(classify): name the unestablished link when the related assertion is already exact (#13037) #16039 replaces.checkoutput.Support-tier Impact
Claim/proof notes:
changelog.d/15274-short-field-read.md.Policy Impact
Proof
Result, failures, or skipped proof:
ripr check --diff fixtures/rust_field_construction_short_field_name/diff.patchreadsfindings=2 gaps=2 weakly_exposed=2with the main binary andexposed=2with this head. The control fixture readsweakly_exposed=2on both.findings=2 gaps=0 exposed=2andverify=complete. Controls in the same crate:let p = origin_shift(3); assert_eq!(p.y, 1)readsexposed;assert_eq!(origin_shift(3).x, 3), an unrelatedP { x: 0, y: 1 }with.yread, andassert_eq!(p, P { x: 3, y: p.y })stayweakly_exposed.riprlib-test binary does not link in the 15 GB authoring container, so the newactivation.rsunit test runs only in hosted CI. Clippy compiled it.cargo xtask precommitexit 0 on 34b2e11. Clippy evidence is the separatecargo clippy -p ripr --all-targetsrun above; xtask is unchanged.assert_eq!(origin_shift(3).y(), 7), with ay()method returning a constant, readexposedbecause.y(was taken as a field read. The short-field path now usesreads_owner_result_field_value, which refuses a read followed by(or::, so a short-field getter stays unconfirmed (fails closed). The RIPR-SPEC-0225 assigned-field read keeps its same-named accessor credit, whichmined-one-line-struct-literal-fieldin the verdict corpus pins (a first, blanket version broke it and was withdrawn). New control fixturerust_field_construction_short_field_name_method_callreadsweakly_exposed=2, with two honesty rows. All five commands above exit 0 on de2cb21; the three check: a correct exact-value test never clears propagation_unknown / infection_unknown, so verify stays refused forever #15274 fixtures were re-blessed for main's formatting-only summary wording..yread in the failure message (assert_eq!(origin_shift(3).x, 3, "y was {}", origin_shift(3).y)) and a receiver rebound before the assertion (let p = Point::default();afterlet p = origin_shift(3);). The short-field path now counts only reads inside the compared operands (first two ofassert_eq!/assert_ne!, the condition ofassert!; other forms refuse) and requires a bound receiver's latestletbefore the assertion to bind from the owner call. Controlsrust_field_construction_short_field_name_message_readand..._rebound_receiverreadweakly_exposed=2, with four honesty rows. A single-field record'sreturn_valuefinding stays unconfirmed (missed credit, fails closed; not claimed). All five proof commands exit 0 on d929a8e.let mutreceiver replaced without aletor field write (p = Point { .. },std::mem::replace(&mut p, ..)) readexposed. The short path now accepts a bound receiver only when its latestletbefore the assertion is notmut;let mut p = origin_shift(3); assert_eq!(p.y, 1)becomes a missed credit (fails closed). Controlrust_field_construction_short_field_name_reassigned_receiverreadsweakly_exposed=2, with two honesty rows. All five proof commands exit 0 on b18d635.for p in [..]loop shadow, a patternlet (p, _n) = ..rebinding, and an initializer that only mentions the owner call (let p = if false { origin_shift(3) } else { .. }) readexposedfory. The short path now requires the receiver's latestletto be exactly the owner call (optionally path-qualified, optionally?) and every later mention of the name before the assertion to be ap.access. Controlrust_field_construction_short_field_name_loop_shadowreadsweakly_exposed=2, with two honesty rows. All five proof commands exit 0 on 34b2e11. The long-name form of the loop shadow readsexposedon this head through the existing token path, which this PR does not touch; filed as rust: a for-loop variable shadowing the owner's bound result confirms the changed field #16551.analyze_related_assertionsand the changed activation helper sit on the diff-probe path (classify_probe); theseam_inventoryclassified-seam cache does not call either.Claim Boundary
May be claimed: a test that reads a changed one- or two-letter field on the owner's result now confirms it, as a longer name already did. Must not be claimed: that #15274 is resolved, or that repros 3, 4, 6 or 7 move.
Rollback
Revert the squash commit. No schema, config or output-contract change.
Spec-Test-Code Traceability
activation.rs::tests::a_one_letter_field_read_holds_to_the_owner_resultcrates/ripr/src/analysis/classify/reveal.rs,crates/ripr/src/analysis/classify/activation.rsfixtures/rust_field_construction_short_field_name{,_other_field}Static Language Check
killed,survived,untested,proven, andadequate.CI Economics
n/a
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.https://claude.ai/code/session_01SvmPmmSMBuovLRPTFeSczf
Generated by Claude Code