Repository navigation
fix(classify): a bare parameter or local returned as the changed tail reaches the return sink (#13037) - #16162
Conversation
… reaches the return sink (#13037) A changed tail that is one bare name (`amount + 5` changed to `amount` in the else branch of the returned `if`) had no return sink, so it read propagation_unknown even under an exact pin of the call that takes that branch. `bare_name_returned_tail` gives such a name the return sink when the parser places it, once on its line, at a position whose value the owner returns. Credit still comes from the RIPR-SPEC-0443 reached-tail pin. The bare owner name is also kept from confirming observation by token: a test local that only shares the name (`let amount = discounted(100, true)`) read exposed once the sink existed. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
|
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 24 minutes. View limit details
Summary by CodeRabbit
WalkthroughThe return-value classifier now recognizes qualifying bare parameter and local names in returned tail positions. Matching names alone no longer confirm observation. Regression tests, fixture reports, and cache schema generations are updated. ChangesBare-name return-tail attribution
Estimated code review effort: 4 (Complex) | ~60 minutes Possibly related PRs
Merge Risk:
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head 9a3e29a against #13037 item 2. I did not write this PR.
Inspected: bare_name_returned_tail and its call site in flow.rs, the bare_owner_name_tail change to owner_bound in reveal.rs, the five integration tests, RIPR-SPEC-0443, the three corpus cases and fixtures, and the three existing fixtures whose goldens moved.
Sink: the new path only adds a return_value sink. It requires a non-unit return type, a one-identifier probe whose text is the same before and after the edit is applied (probe.after), and that identifier exactly once on the line, in a returned position (body tail, plain block tail, or an if branch tail, recursively). Credit still comes only from the #14950 reached-tail pin. The three existing goldens that move (assertion_form_parity_assert_msg, assertion_form_parity_err_guard, multi_hunk_removed_line_wrong_target) go from an unknown sink to the returned name. The parity pair moves propagation_unknown to weakly_exposed, because their test takes the other branch. No existing fixture is promoted to exposed.
Over-credit probes, run with the binary built from this head on two-commit temp repos (base amount + 5, head amount, and similar). Only pins whose input selects the changed branch read exposed: discounted(100, false) == 100, a > 50 condition hit with f(100) == 100, and the middle arm of an if / else if / else with (false, true). Each of the following reads weakly_exposed: the other branch; a loop-supplied or runtime-derived flag; a bare > relation; a test local named amount bound from the other branch; the result bound but a different value asserted; the input asserted instead of the result; the result shadowed and recomputed before the assertion; two calls with only the other-branch one asserted; a struct field asserted instead of the method result; an early return path; and the else and if-true misses of the nested and conditional shapes. A method whose tail is a local copied from self.amount, and a tail after an early return, read weakly_exposed even when pinned. Those are missed credit, in the conservative direction.
Name-coincidence fix: cargo test -p ripr --test computed_return_tail_13037 passes 22 of 22 locally. Discriminating control: with owner_bound no longer gated on bare_owner_name_tail, a_test_binding_named_like_the_tail_does_not_confirm_it stops passing, so the gate is what holds that case.
Gates on this head: cargo xtask goldens check exits 0, and cargo xtask check-evidence-promotion-honesty exits 0 with the three new cases present in corpus-summary.json. git merge-tree against current main 8b1865f is clean.
Not run by me: the lib unit tests (the lib test binary does not link in this container). Hosted qualification is owed on this head.
Generated by Claude Code
|
Independent source review at The new sink matcher ( |
…; make the not-returned control non-vacuous (#16162 review) A one-identifier tail now reaches the return sink only when the owner binds it as a parameter or in a let pattern; a same-file constant spelled as one identifier gets no sink here. The not-returned initializer test now requires a successful analysis with a finding on the edited line instead of treating every error as success. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
|
Both findings repaired in 6a8fdbe.
On this head: Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head 6a8fdbe. My earlier review of 9a3e29a stands for the unchanged parts; this pass covers the whole PR at this head, with emphasis on the delta that answers review comment 7107017696.
Delta inspected: flow.rs (owner-binding requirement in bare_name_returned_tail), bare_name_tail.rs (new findings_on_edited_line helper, rewritten not-returned control, new only_a_name_the_owner_binds_gets_the_return_sink), the RIPR-SPEC-0443 paragraph and its test list, traceability and changelog.
- Vacuous control: the not-returned test now requires a successful analysis and at least one finding on the edited line before it checks that no
return_valuesink namesamountand nothing readsexposed. The helper also requires the edited text to appear on exactly one line. An analysis error or a missed line now surfaces as anErr, not a pass. - Constant sink: the reader now requires the name to be bound by the owner itself, as a parameter pattern or a
letpattern in its body. The new test pairs alet-bound local that reaches the sink with a same-fileconst FALLBACKthat does not. Discriminating control, run locally: with the binding check disabled,only_a_name_the_owner_binds_gets_the_return_sinkstops passing. With it in place,cargo test -p ripr --test computed_return_tail_13037passes 23 of 23.
Gates on this head, run locally: cargo fmt --check and cargo clippy -p ripr --all-targets -- -D warnings are clean. cargo xtask goldens check, cargo xtask check-evidence-promotion-honesty and cargo xtask verdict-corpus check-all exit 0 (traps credited 0/13). git merge-tree against current main f9e9873 is clean.
One observation, which does not hold this head back. The binding check scans every let in the body, regardless of scope. With pub const FALLBACK and an unrelated inner block { let FALLBACK = 1; }, a tail FALLBACK still gets the return_value sink; I checked this with the binary built from this head. The sink is still factually the returned value, and the finding stayed weakly_exposed even with an exact pin of that branch, so nothing is over-credited. Only the spec's "binds it itself" wording is looser than scope-exact. Closure, for, if let and match bindings are not counted, which is the conservative direction.
Not run by me: the lib unit tests (the lib test binary does not link in this container). Hosted qualification is owed on this head.
Generated by Claude Code
|
Re-review at |
…ts position (#16162 review) The owner-binding check counted a let anywhere in the body, so a let in the other branch could stand in for an imported or file-level constant returned on the changed line. The name now resolves lexically: a preceding let in a block enclosing the tail, or else a parameter. An item in an enclosing block that mentions the name makes the reader decline. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
|
Repaired in 0c5f898. The binding check now resolves the returned name lexically ( New test
Discriminating control: with the old any- On this head: Generated by Claude Code |
|
Exact |
… names (#16162 review) A let-else pattern is refutable, so a bare name in it may be a constant pattern rather than a new binding. The reader now declines instead of counting it as a local. The disjoint-scope test drops its compile-invalid file-level constant source and keeps the scoped-import negative. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
|
Repaired in 6b188b2.
Each of the new test sources compiles with On this head: Generated by Claude Code |
|
Exact At At |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head 6b188b2, answering PR comment 7111460489.
What I inspected:
- The delta from 0c5f898 (flow.rs
owner_binding_visible_at, bare_name_tail.rs, the RIPR-SPEC-0443 paragraph and test list, and the traceability entry). - The decline: a preceding
let .. elsethat binds the name now returns None. This is the right boundary. A plainletor a parameter must be irrefutable (E0005), so it cannot hold a constant pattern. That makeslet .. elsethe only refutable binding form this walker visits. Declining when a later plainletshadows an earlier let-else name is conservative, not a wrong credit. - Test sources: I compiled both the new let-else source (
const FALLBACKpluslet FALLBACK = amount else { return 0; }) and the kept imported-constant source with rustc. Both exit 0, so the compile-invalid source from the earlier head is gone.
Executed on this head (cloud Linux, shared target dir):
cargo fmt --check: clean.cargo test -p ripr --test computed_return_tail_13037: 25 of 25 pass.- Control: with the
binding.let_else().is_some()decline deleted,a_bare_name_in_a_preceding_let_else_is_not_read_as_a_localpanics at bare_name_tail.rs:252 while the other 7 bare_name tests still pass. The control was restored afterward. cargo clippy -p ripr --all-targets -- -D warnings,cargo xtask goldens check,cargo xtask check-evidence-promotion-honesty,cargo xtask verdict-corpus check-all(traps credited 0/13),cargo xtask check-traceabilityandcargo xtask check-spec-formatall exit 0.git merge-tree --write-treeagainst current main is clean.
Not covered here: the ripr lib unit-test binary (it cannot link in this container) and hosted exact-head CI. Those remain with hosted qualification.
Generated by Claude Code
…16162 review) Syntax cannot tell a binding from a path pattern: with struct Fallback in scope, let Fallback = x; is a unit-struct pattern. The reader now admits only names spelled as bindings (snake_case), documented as a spelling heuristic that admits only the return sink. The scope, item and let-else controls use lowercase names so each still tests its own guard; a unit-struct negative pins the casing rule. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
|
Repaired in 9dc3046, taking the first option (require binding-shaped evidence) and documenting its limit.
Discrimination, each run on this head:
Every source in On this head: Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
Not ready: one of the five guards has no test of its own.
Independent source review of head 9dc3046, answering PR comment 7112212023.
Finding: the enclosing-block item guard is not discriminated. In owner_binding_visible_at (flow.rs), the ast::Stmt::Item arm returns None when an item in an enclosing block mentions the name. When I deleted that return None, all 9 bare_name tests still passed. The imported case in a_same_named_local_in_a_disjoint_scope_does_not_bind_the_tail does not reach this guard. Its let fallback sits in the other if branch, so the scope walk already yields false.
The guard does real work. This source compiles (rustc 2024, price(100, false) == 7), and the tail returns the imported constant rather than the outer local:
pub mod defaults {
#[allow(non_upper_case_globals)]
pub const fallback: u32 = 7;
}
pub fn price(amount: u32, member: bool) -> u32 {
let fallback = amount;
if member {
amount
} else {
use crate::defaults::fallback;
fallback
}
}With findings_on_edited_line(source, "amount + 1", "fallback", "assert_eq!(price(100, false), 7);") and assert!(!returns_name(..)), the test passes on this head and stops passing with the item guard deleted. Suggested repair: add it as the item guard's own test, either in place of or beside the imported case, plus its traceability and spec test-list lines.
Per-guard controls on this head. Each control deletes or weakens one guard and runs the 9 bare_name tests:
- Casing rule restored to
is_ascii_alphabetic/is_ascii_alphanumeric: onlya_name_spelled_like_an_item_is_not_read_as_a_localstops passing. - let-else decline deleted: only
a_bare_name_in_a_preceding_let_else_is_not_read_as_a_localstops passing. - Binding check forced true: only
only_a_name_the_owner_binds_gets_the_return_sinkstops passing. Its lowercased constant now reaches the binding check rather than the casing rule. - Scope walk widened to every StmtList in the body:
a_same_named_local_in_a_disjoint_scope_does_not_bind_the_tailstops passing, along with two others. - Item guard deleted: nothing stops passing (the finding above).
Otherwise sound. The snake_case rule is labeled in code and in RIPR-SPEC-0443 as a spelling heuristic. It only narrows which names reach the sink, so it can miss credit but cannot add any. cargo fmt --check is clean, and 26 of 26 computed_return_tail tests pass. I did not run clippy, goldens, honesty or verdict-corpus on this head, and this repair would not change their inputs.
Generated by Claude Code
…ating test (#16162 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
|
Repaired in this push: the enclosing-block item guard now has its own test.
On this head: Generated by Claude Code |
…not name resolution (#16162 review) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
|
Copy reconciliation for comment 7112212023 (its 9dc3046 addendum) is in this push. Only the spec text and the The RIPR-SPEC-0443 amendment no longer says a unit struct or imported item never adds a sink. It now says three things:
The function's doc comment says the same. On this head: Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head b2c82e8. This supersedes my earlier review on 9dc3046, whose only finding (the enclosing-block item guard had no test of its own) is now repaired.
What changed since 9dc3046:
- 650019a adds
an_item_in_an_enclosing_block_shadows_an_outer_local, with matching traceability and RIPR-SPEC-0443 test-list lines. - b2c82e8 rewrites the
bare_name_returned_taildoc comment and the RIPR-SPEC-0443 paragraph. They now describe syntactic binding evidence, not name resolution, and name a module-leveluse .. as fallbackas a case the reader cannot see. The flow.rs change is comment-only. Production logic is the same as 9dc3046.
Per-guard controls (each guard deleted or weakened on its own, running the 10 bare_name tests):
- Item guard
return Nonedeleted (on 650019a): onlyan_item_in_an_enclosing_block_shadows_an_outer_localstops passing. - Casing rule restored to alphabetic/alphanumeric (on 9dc3046, same logic): only
a_name_spelled_like_an_item_is_not_read_as_a_localstops passing. - let-else decline deleted: only
a_bare_name_in_a_preceding_let_else_is_not_read_as_a_localstops passing. - Binding check forced true: only
only_a_name_the_owner_binds_gets_the_return_sinkstops passing. - Scope walk widened to every StmtList in the body:
a_same_named_local_in_a_disjoint_scope_does_not_bind_the_tailstops passing.
Wording check: the spec now says the reader withholds the item-like spellings it can see and does not claim to rule out every item. That matches the code. The guards only narrow which names reach the return sink, and credit still needs the reached-tail pin.
Executed:
- On b2c82e8:
cargo fmt --check,cargo test -p ripr --test computed_return_tail_13037(27 of 27),cargo clippy -p ripr --all-targets -- -D warnings,cargo xtask check-spec-format,cargo xtask check-traceability, andgit merge-tree --write-treeagainst current main all exit 0. - On 650019a (same logic and tests, comments differ):
cargo xtask goldens check,cargo xtask check-evidence-promotion-honestyandcargo xtask verdict-corpus check-allexit 0.
Not covered here: the ripr lib unit-test binary (it cannot link in this container) and hosted exact-head CI.
Generated by Claude Code
|
Independent source confirmation of inline At |
The bare-name tail refusal matched any owner-scoped token equal to the tail, and owner_scoped_tokens also holds digit-leading literals. A multi-digit literal tail (105) in an owner-bound assertion with a local call argument lost its #5830 token credit and read weakly_exposed. Exclude digit-leading tokens so the refusal covers names only; the new test fails on the previous head and passes here. Found by CodeRabbit review on b2c82e8. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head 3e2211e. It covers the one commit since my marker on b2c82e8: the reveal.rs fix for the CodeRabbit regression on multi-digit literal tails.
What I inspected:
- reveal.rs
bare_owner_name_tailnow skips digit-leading tokens.owner_scoped_tokensadmits only owner parameters, owner locals and digit-leading tokens, so after this change the bare-name decline matches exactly a parameter or local name returned as the tail, as intended.true/falseand other keywords never enter that token set, so no other literal class is affected. - The new test
a_numeric_literal_tail_keeps_its_owner_bound_token_credit: its tail is105, an owner-boundassert_eq!(fee(amount), 105), and a local argument the branch-reading pin does not fold.
Control: with reveal.rs restored to b2c82e8 and the rest of this head kept, the new test panics at bare_name_tail.rs:334. It reads WeaklyExposed where it expects Exposed. On this head it passes.
Executed on this head (cloud Linux, shared target dir), all exit 0:
cargo fmt --checkcargo test -p ripr --test computed_return_tail_13037(28 of 28)cargo clippy -p ripr --all-targets -- -D warningscargo xtask goldens checkcargo xtask check-evidence-promotion-honestycargo xtask verdict-corpus check-allcargo xtask check-traceabilitycargo xtask check-spec-formatgit merge-tree --write-treeagainst current main
My per-guard controls from b2c82e8 still apply: flow.rs is unchanged.
Not covered here: the ripr lib unit-test binary (it cannot link in this container) and hosted exact-head CI.
Generated by Claude Code
…ly change (#13037) The bare-name sink reads only the new-side owner. When the diff also deletes an early return beside the tail, the old owner may return the pinned value too (unary_tail_return_pin found f(5) == 5 credited). The direct return now needs owner_sole_change; otherwise propagation stays unknown (bare_name_tail_unpaired). Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
…ves more of an existing owner (#13037) A new owner (new file, nothing removed inside it) has no old return to agree with the pinned value, so it keeps its credit. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
…npaired bare-tail rule (#13037) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head 29c417f. It covers the commits since my marker on 1824472: the qualification repairs 3a1111f, 565ab97, 2b3a78f and 29c417f.
What I inspected:
bare_name_tail_unpaired(classifier.rs, evidence.rs, context.rs). The flag is set when three things hold: the probe's sink comes from the bare-name rule,owner_sole_changeis None, and the diff removes a line inside the owner's range. With the flag set, evidence.rs drops the propagation witness and reads propagate as Unknown, namingbare_name_tail_unpaired. The flag only withholds credit. A new owner, with nothing removed inside it, keeps its credit, and so does a tail line that is the owner's only change. It reuses the existingowner_sole_changereading rather than adding a parallel one.json_artifact_encoding::baseline_diff_reads_both_inputs_in_a_powershell_encoding. It now takes the gap count from its own baseline and requires at least one gap. The encoding contract it tests (every baseline entry compared, none read asmissing_current_input) is unchanged.multi_hunk_removed_line_wrong_targetrebless. In check.json, onlyone()'s return_value finding moves: propagate goes from Yes to Unknown and confidence from 0.48 to 0.35, and the class staysno_static_path. Because of the confidence drop, human.txt's "Start here" pick moves from line 4 to the line 2 static_unknown finding. Its stub line and the hidden-list grouping follow from that. No class changes.
Controls on this head:
- With
bare_name_tail_unpairedforced false,bare_name_tail::a_bare_tail_whose_owner_lost_an_early_return_is_not_creditedstops passing. So doesunary_tail_return_pin::an_old_owner_with_more_than_the_replaced_line_is_not_exposed, which is the over-credit that the full local integration run found. The sole-line control in the new test stays Exposed.
Executed on this head (cloud Linux, shared target dir), all exit 0:
cargo fmt --checkcargo test -p riprfor--test computed_return_tail_13037(31/31),--test unary_tail_return_pin(24/24),--test json_artifact_encoding(3/3) and--test base_owner_cfg_gates(23/23)cargo clippy -p ripr --all-targets -- -D warningscargo xtask goldens check,cargo xtask check-evidence-promotion-honesty,cargo xtask verdict-corpus check-all,cargo xtask check-traceability,cargo xtask check-spec-format,cargo xtask check-allow-attributesandcargo xtask check-doc-artifacts
Integration note: main moved to 706f08a, and #16554 also reblessed multi_hunk_removed_line_wrong_target. This head now conflicts with main in that fixture's expected/CHANGELOG.md. Its check.json auto-merges, but the combined goldens need a check on the merged tree. The next head that merges main needs its own marker covering that resolution.
Not covered here: the ripr lib unit-test binary (it cannot link in this container) and hosted exact-head CI.
Generated by Claude Code
…-0onf8e # Conflicts: # fixtures/multi_hunk_removed_line_wrong_target/expected/CHANGELOG.md
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
…tion 1.231 (#13037) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head fb1a367. This head merges main at 706f08a (#16554). It covers the merge resolution since my marker on 29c417f.
Resolution checked
- PR diff against main: byte-identical to 29c417f's PR diff, with three exceptions:
multi_hunk_removed_line_wrong_target/expected/CHANGELOG.mdkeeps main's entries and appends the #13037 bless as entry 49. That fixture's check.json carries the same PR-side change as before on top of #16554's base_line.- Two honesty reports that main added,
rust-repo-exposure-guarded-statement-boundariesandrust-test-local-rival-import-control, move from 1.229 to 1.231. Every other changed line in them is a dependent hash.
- Generation: main is still at 1.229/0.231, so the 1.231/0.233 claim stands.
- Integration:
git merge-tree --write-treeagainst current main (6a4c2d8) is clean. - Carried forward: my 29c417f review of
bare_name_tail_unpairedand its controls still applies, because no source file changed.
Executed on this head (cloud Linux, shared target dir). Every command exits 0:
cargo fmt --checkcargo test -p riprwith these targets:--test computed_return_tail_13037(31/31),--test unary_tail_return_pin(24/24),--test json_artifact_encoding(3/3),--test base_owner_cfg_gates(23/23) and--test lsp_lifecycle gap_corpus(21/21)cargo clippy -p ripr --all-targets -- -D warningscargo xtask goldens checkcargo xtask check-evidence-promotion-honestycargo xtask verdict-corpus check-allcargo xtask check-traceabilitycargo xtask check-spec-formatcargo xtask check-allow-attributescargo xtask check-doc-artifacts
Not covered here: the ripr lib unit-test binary (it cannot link in this container) and hosted exact-head CI.
Generated by Claude Code
…-0onf8e # Conflicts: # crates/ripr/src/analysis/classify/flow.rs # crates/ripr/src/analysis/seam_cache.rs # crates/ripr/tests/lsp_lifecycle/gap_corpus_currentness.rs # docs/OUTPUT_SCHEMA.md # fixtures/boundary_gap/expected/CHANGELOG.md # fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/after.repo-exposure.json # fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/agent-receipt.json # fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/agent-verify.json # fixtures/boundary_gap/expected/first-useful-action/unchanged-after-attempt/before.repo-exposure.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-field-snapshot-missing-expected.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-field-snapshot-wrong-receiver.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-async-fn-activated-unsupported.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-async-fn-entry.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-async-fn-intermediate.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-async-fn-last-hop.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-async-fn-method-entry.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-async-fn-method-last-hop.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-async-fn-operand.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-receiver-async-operand-helper.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-receiver-async-operand.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-receiver-dormant-body.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-receiver-foreign-helper.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-receiver-free-helper-identity.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-receiver-helper-scope-shadow.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-receiver-helper-type-parameter.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-receiver-local-wrapper.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-receiver-macro-discard.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-inherent-receiver-module-type-shadow.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-adapter-fed-error.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-bool-local-compared-with-true.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-branch-local-else-only.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-branch-local-rebound-let.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-field-snapshot-exact.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-field-snapshot-inline.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-field-snapshot-literal.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-field-snapshot-other.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-field-snapshot-settings.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-field-snapshot-weak.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-file-module-nested-block-renamed-other-function-outer-call-control.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-file-module-nested-block-renamed-other-function.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-guarded-boundary-guard-missing.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-guarded-statement-boundaries.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-integration-test-nested-block-renamed-other-function-sibling-mount-control.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-integration-test-nested-block-renamed-other-function.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-late-assert-eq-definition-match-arms.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-lib-test-false-skipped.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-local-binder-named-like-other-function.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-local-binder-named-like-owner-block-control.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-local-closure-named-like-owner-map.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-macro-held-owner-call.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-macro-held-owner-result-local.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-manifest-rebound-assertion-root.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-matches-compared-with-true.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-matches-or-pattern-of-values.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-matches-or-pattern-single-value-control.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-nested-block-renamed-other-function-outer-call-control.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-nested-block-renamed-other-function.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-ok-assertion-failure-seam.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-panic-marker-collision.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-panic-marker-neutral.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-proximity-other-function.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-rebound-assert-eq-match-arms.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-rebound-read-macro-unselected-arm.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-renamed-other-function-qualified-control.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-renamed-other-function.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-same-named-call-kinds.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-test-local-rival-bare-use.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-test-local-rival-glob-use.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-tuple-rebound-owner-unselected-arm.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-unselected-match-arm.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-repo-exposure-wrapper-fed-error.json # fixtures/evidence-promotion-honesty-corpus/reports/rust-test-local-rival-import-control.json # xtask/src/tests/rust_corpus_projection.rs
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY for head fb1a367
Independent native-Windows review of fix(classify): a bare parameter or local returned as the changed tail reaches the return-value sink (PR #16162, #13037) at 3a1111f.
Source review (verified against source)
Delta (PR vs merge-base: classify/flow.rs +327, seam-cache generation claim, reveal/context/classifier adjustments, integration and LSP-currentness test updates; ~765 insertions across 11 files):
-
The claim: a changed return that is one bare parameter or local (
amount + 5→amountin the else of the returnedif) readpropagation_unknowneven when a test pinned the branch call (assert_eq!(discounted(100, false), 100)).return_value_sinkaccepted only text spelling a literal, call, or arithmetic, so a bare name never reached the sink. -
The fix accepts the owner-scoped name as the returned value when the flow discipline holds, and — the load-bearing half — "the matching owner-scoped name alone no longer confirms observation": reading the name at the return is not, by itself, oracle evidence. That mirrors the repo's evidence-promotion invariants: reach is not observation, and a name that passes through unchanged cannot discriminate the change.
-
Follow-on commit at this head:
bare_name_tail_unpairedcontext — when the diff removes lines inside the owner without the tail line being the owner's only change (a deleted early return), the bare-name tail rule's new-side-only read cannot confirm the old owner did not also return the pinned value; the classification now carries that explicitly. Same #13037 scope; generation claim unchanged. -
Third push at this head (rebase onto current main plus refinement): the same four semantic files, slightly evolved (classifier 16, evidence 21, context 12, flow +327); generation claim re-verified unchanged at this head (1.231 with the #13037 note, sharded and compact 0.233 in lockstep).
-
Generation claim 1.231 / 0.233, taken in textbook lockstep at this head:
CACHE_SCHEMA_VERSION"1.231" with the semantic-transition comment ("a bare owner parameter orlet-bound local returned as the changed tail reaches the return-value sink, and the matching owner-scoped name alone no longer confirms observation", #13037), both sharded and compact constants at "0.233" with matching notes. Per the live generation map (#16466), 1.231/0.233 was the next free claim: unique, ordered above shipped main top 1.229/0.231, and sequential to 16447's in-flight 1.230/0.232 (no collision). -
Native proof (native Windows, worktree wt-16162 at head fb1a367): claim source-verified by direct read (CACHE_SCHEMA_VERSION "1.231", sharded and compact "0.233", each with the #13037 transition note);
cargo test -p ripr --lib classify::flow(exit 0);cargo test -p ripr --lib classify::reveal(exit 0);cargo xtask goldens check(exit 0 apart from the known pre-existingpython_parent_collected_test_shadowdrift);cargo xtask check-evidence-promotion-honesty(exit 0);cargo xtask check-traceability(exit 0).
Scope and non-goals
- Reviewed and proven at this head only; a later push restarts review.
- The claim ordering assumes 16447 (1.230/0.232) lands first or the map is re-checked at merge time; both are recorded on the map.
- Merge mechanics belong to the writer; this review is evidence only.
|
|
EffortlessSteven
left a comment
There was a problem hiding this comment.
Not ready: the main merge drops a line of main's public schema documentation.
Independent review of the merge resolution at head c675700, which merges main at a41fcf4.
Finding. In docs/OUTPUT_SCHEMA.md, near line 2592 in the ripr-check-artifact-v2 identity-gate paragraph, the merge reverts main's text back to the pre-#16528 wording. Main reads:
`root`, `mode`, `enabled_languages`, `uncompiled_configured_languages`
(present only when an inherited `ripr.toml` enables a language the binary
lacks), `analysis_options.*`,
This head reads:
`root`, `mode`, `enabled_languages`, `analysis_options.*`,
uncompiled_configured_languages is a real identity field on main (crates/ripr/src/app/check_artifact.rs:76, 274, 311), so the PR would silently remove its documented place in the fail-closed identity gate. It has nothing to do with #13037. The likely cause is that the conflict resolution took the PR side of that hunk.
Repair. Restore main's three lines, and keep this PR's two 1.230 to 1.231 changes further down the file.
How I found it. I swept every file in the PR diff against main for removed lines that were not part of the PR's earlier diff (at fb1a367 against 706f08a), after normalizing versions and hashes. Two files showed such lines:
- docs/OUTPUT_SCHEMA.md: the lost sentence above.
- flow.rs: the only extra lines are #16150's inline tail-if arm. They are rewrapped as
(flow_sink(..), false)insidereturn_value_readingwith the same arguments, which is correct.
Checked and correct on this head:
- seam_cache.rs keeps main's 1.230/0.232 history, then adds 1.231/0.233 with transitions 1.230 -> 1.231 and 0.232 -> 0.233.
- The 63 honesty reports, the 4 boundary_gap snapshots, gap_corpus_currentness.rs and rust_corpus_projection.rs change only version strings and dependent hashes against main.
- The PR diff contains no stray 1.230; the only 1.230 mentions are main's CHANGELOG history.
Generated by Claude Code
…dentity field lost in the merge Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoZSPSU6CDFd8S3Gv3
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Independent source review of head 7b180ea. This head carries the c675700 merge of main a41fcf4 (#16447, #16150) and the doc repair for my review 6102280511.
Merge resolution, checked against main:
- flow.rs: #16150's inline tail-if arm is kept inside
return_value_reading, wrapped as(flow_sink(..), false)with unchanged arguments. - seam_cache.rs: main's 1.230/0.232 history stays, and the PR adds 1.231/0.233 on top. The constants, docs and transition tests all read 1.230 -> 1.231 and 0.232 -> 0.233.
- Version-only fallout: in the 63 honesty reports, the 4 boundary_gap unchanged-attempt snapshots, gap_corpus_currentness.rs and rust_corpus_projection.rs, every changed line against main is a version string or a dependent hash.
- docs/OUTPUT_SCHEMA.md (7b180ea): the file now equals current main (814af41) apart from the two
1.230to1.231lines. #16528'suncompiled_configured_languagessentence is restored. The file also carries main's newer #16109 limit-kind line. - Lost main lines: I swept every file in the PR diff for main lines the merge removed, comparing against the PR diff at fb1a367 after normalizing versions and hashes. Only the #16150 tuple wrap and the now-repaired OUTPUT_SCHEMA hunk showed up.
- Source and tests: byte-identical to fb1a367, which I reviewed, so the earlier per-guard, cfg-gate and unpaired-tail controls still apply.
- Merge check:
git merge-tree --write-treeagainst current main (814af41) is clean.
Executed on this head (cloud Linux, shared target dir), all exit 0:
cargo fmt --checkcargo test -p riprwith:--test computed_return_tail_13037(31/31)--test unary_tail_return_pin(24/24)--test json_artifact_encoding(3/3)--test base_owner_cfg_gates(23/23)--test lsp_lifecycle gap_corpus(21/21)
cargo clippy -p ripr --all-targets -- -D warningsandcargo clippy -p xtask --all-targets -- -D warningscargo test -p xtask rust_corpus_projection(5/5)cargo xtask goldens checkcargo xtask check-evidence-promotion-honestycargo xtask verdict-corpus check-allcargo xtask check-traceabilitycargo xtask check-spec-formatcargo xtask check-allow-attributescargo xtask check-doc-artifacts
Not covered here: the ripr lib unit-test binary (it cannot link in this container) and hosted exact-head CI.
Generated by Claude Code
Main moved three more inline `cfg(test)` modules out of line (#16628) and landed the #13037 bare-name return tail (#16162) and the branch-call infection rule (#16631). The merge keeps both sides' analyzer behavior: - `classify/{boundary_pairing,constant_tail_change,flow}.rs` take main's `mod tests;` reference; the moved bodies are merged three-way into the new `tests.rs` files, so every item both sides carry survives. - `classify/reveal.rs` keeps the #12010 identity route's import, cross-package and shadowing defeats alongside main's bare-owner-name-tail and owner-scoped-token conditions. They are independent fail-closed conditions. - `test_grip_evidence.rs` imports both sides' added name. - `analysis/seam_cache.rs` takes main's generation comments; the joined tree carries two 1.231 claims, so it takes a fresh number in the next commit. - The corpus reports and the boundary-gap expectations differ only in provenance, so the branch's captures stand; the recapture rewrites them.
Requested by Steven · project thread
Summary
amount + 5changed toamountin theelseof the returnedif) readpropagation_unknowneven when a test pinned the call that takes that branch (assert_eq!(discounted(100, false), 100)).return_value_sinkaccepted only text that spells a literal, call or arithmetic, so the name had no return sink and the RIPR-SPEC-0443 reached-tail pin never got a chance. Reproduced on main195b362f.bare_name_returned_tail(classify/flow.rs) now gives the name the return sink when the parser places it, once on its line, at a position whose value the owner returns: the body tail, or the tail of a plain block or eitherifbranch in such a position. Only the sink moves; credit still comes from the existing readers.let amount = discounted(100, true); assert_eq!(amount, 90);, which takes the other branch) readexposedthrough the Rust analysis credits a self-computed expected value as exposed #5830 owner-bound token rule. A bare owner name is now never a confirming token (bare_owner_name_tailinclassify/reveal.rs).This is item 2 of #13037 comment 7079745005 (item 1 is #16154).
Swarm / Source Boundary
dependency, or repo-ops development for
ripr-swarmSource-of-truth Links
Proposal: n/a
Spec: docs/specs/RIPR-SPEC-0443-branch-local-return-value-grip.md (amended)
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #13037 (bare parameter/local changed tail)
Acceptance delta (one sentence): an exact pin of the call that takes the branch returning a changed bare parameter or local moves its
return_valuefinding frompropagation_unknowntoexposed; other-branch, far-input and same-named-local tests stayweakly_exposed.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
claude/project-thread-0onf8eStack 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
Searched open and recent PRs for #13037 and "return tail": #16017 (merged, name-only comparison tails) and #14950/#15927 (merged, reached-tail pin) are related, not duplicates.
Scope
crates/ripr/src/analysis/classify/flow.rs:bare_name_returned_tail, consulted inreturn_value_sinkbefore the unknown sink.crates/ripr/src/analysis/classify/reveal.rs:bare_owner_name_tailkeeps a bare owner parameter/local tail from settingowner_bound.cases/*.json), 5 integration tests incrates/ripr/tests/computed_return_tail/bare_name_tail.rs.assertion_form_parity_assert_msg,assertion_form_parity_err_guard(theamountelse-branch finding movespropagation_unknowntoweakly_exposed; the test takes the other branch, and both parity twins move identically) andmulti_hunk_removed_line_wrong_target(tailznow reads propagation yes; no related test, so the class staysno_static_path). No fixture moves toexposed.Scope Classification
Production delta:
Evidence/support delta:
Single acceptance criterion:
rust_bare_name_return_tail_reachedreadsexposed;rust_bare_name_return_tail_other_branchandrust_bare_name_return_tail_test_local_same_namereadweakly_exposed.Non-goals:
amount + 6withlet amount = discounted(100, true)) still readsexposedon main and here. It predates this PR and is left for a separate claim under agent loop: after tests that catch every mutant,ripr checkstill reports weak/unclear and contradicts itself #13037.matcharms, loops, closures andletinitializers as bare-name sinks.Support-tier Impact
Claim/proof notes:
changelog.d/13037-bare-name-return-tail.md.Policy Impact
Proof
Result, failures, or skipped proof:
Discrimination: reverting
reveal.rsalone failsa_test_binding_named_like_the_tail_does_not_confirm_it; revertingflow.rsalone fails the four sink tests.Scratch-crate replay with release builds of main and this head: reached pin
propagation_unknown→exposed; other branch, far input (for m in [true]), same-named local and a method whose other branch is pinned →weakly_exposed; bare-nameletinitializer branch unchanged.goldens checkin this container also reports about 35formatting_onlydrifts inhuman.txt("could not establish which revisions the check analyzed"), unrelated to analysis; hosted CI is the authority there.cargo test -p ripr --libcannot link in this 15 GB container; no unit tests were added inflow.rsfor that reason. Hosted CI is the full run.Classified seam cache generation 1.231 / 0.233 (claimed on the generation map, seam-cache generation coordination: #16449/#16453/#16419 all claim 1.215/0.217 off main 1.214; #16461 pre-recaptured to 1.216/0.218 #16466 comment 7245778984). The bump moves the portable
boundary_gapunchanged-attempt snapshots and the honesty-corpus repo-exposure reports to 1.231, with theirraw_json_placeholder_v1content commitments, verify commitments and receipt byte hashes recomputed. No class moves.Merged current main after the analysis hold lifted. The three new bare-name fixtures were re-blessed for main's human wording only.
Claim Boundary
May claim: a bare parameter or local returned as the changed tail is credited when an existing branch-reading pin reaches it. Must not claim: any wider credit for bare names, or a fix for the computed-tail token coincidence.
Binding resolution (reviews 6026060176, 6028496197 and comments 7110782677, 7112212023): the returned name must be spelled snake_case, a spelling heuristic rather than name resolution, since syntax cannot tell
let Fallback = x;(a unit-struct pattern whenstruct Fallback;is in scope) from a binding. It must also resolve, at its own position, to a precedingletin a block enclosing the tail, or else to a parameter. A same-namedletin a disjoint scope (the otherifbranch) does not count, and an item declared in an enclosing block that mentions the name (use crate::defaults::FALLBACK;) makes the reader decline, as does a precedinglet .. elsenaming it (refutable, so a bare name there may be a constant pattern). Macro-introduced bindings are not read (conservative).Rollback
Revert the commit; the three re-blessed goldens return with it.
Spec-Test-Code Traceability
crates/ripr/tests/computed_return_tail/bare_name_tail.rsclassify/flow.rs::bare_name_returned_tail,classify/reveal.rs(bare_owner_name_tail)branch_local_return_value_false_promotionsstays zero on the corpusStatic 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_01SvmPmoZSPSU6CDFd8S3Gv3
Generated by Claude Code