Skip to content

fix(classify): withhold override credit after a post-setter chain method - #12032

Merged
EffortlessSteven merged 2 commits into
mainfrom
cursor/builder-post-setter-chain-3306
Nov 1, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
cursor/builder-post-setter-chain-3306

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

A builder chain that applies a non-setter after a verified setter (RetryBuilder::new().attempts(5).reset().build()) no longer counts as an override of that field. The previous OR of every setter on the chain treated reset() as irrelevant, which produced a false weakly_exposed gap. The chain now fails closed to unknown when a later non-terminal method sits after the setter.

Swarm / Source Boundary

This PR targets EffortlessMetrics/ripr-swarm, the normal development trunk for trusted same-repo ripr work. Confirm the change belongs here:

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm
  • repair or follow-up for a same-repo swarm PR
  • swarm-only CI, runner, routing, source-of-truth, or agent-operating surface
  • other swarm-scoped work:

Source-of-truth Links

Proposal: none
Spec: RIPR-SPEC-0040 builder override (existing); no spec text change
ADR: none
Plan item: none
Governing issue or accepted claim: #7557
Advances #7557
Acceptance delta (one sentence): A non-setter method applied after a verified setter on the same builder chain is no longer counted as an override, so that read is not treated as a false weakly_exposed gap.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): cursor/builder-post-setter-chain-3306
Stack 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): none
Accepted winner and losing candidate disposition (when decided): this PR is the selected candidate for #7557 item 1; no competing candidate

Scope

  • One production behavior: chain_root in builder_override.rs returns a tri-state so a post-setter non-terminal method withholds override credit.

Scope Classification

This PR is scoped by:

  • One production behavior
  • One public contract
  • One architectural seam
  • Docs/spec/test-only evidence package
  • Other:

Production delta:

  • Walk the receiver chain outermost-in. Remember a non-setter seen before the setter is found. That method sits after the setter in source order; report unknown (no override, no gap).
  • Exempt the conventional zero-argument .build() terminal, which is the copy-through conversion to the owner's result used by every existing control.
  • value_state and binding_writes treat that unknown as fail-closed.

Evidence/support delta:

  • In-file tests: .attempts(5).reset().build() is not an override (failed before); .reset().attempts(5).build() is still an override; existing tests unchanged.
  • Changelog fragment changelog.d/7557-post-setter-chain-method.md.

Single acceptance criterion:

  • RetryBuilder::new().attempts(5).reset().build() does not appear in overridden_fields_read for attempts.

Non-goals:

Support-tier Impact

  • none
  • updates docs/status/SUPPORT_TIERS.md
  • changes a README, release, docs, CLI, JSON, editor, CI, or package claim

Claim/proof notes:

  • Classification still uses weakly_exposed / existing credit. No new class or public schema.

Policy Impact

  • none
  • doc artifacts
  • CI lane
  • package boundary
  • lint / Clippy
  • no-panic
  • file policy
  • generated artifact
  • dependency
  • process/network

Ledger or exception notes:

Proof

cargo test -p ripr --lib analysis::classify::builder_override::tests::method_after_verified_setter_is_not_an_override
# before the production change: FAILED (assertion that the overridden list is empty)
cargo test -p ripr --lib analysis::classify::builder_override::tests::
# after: 28 passed, 0 failed (26 existing + 2 new)
cargo clippy --locked -p ripr --all-targets -- -D warnings
# Finished `dev` profile, no warnings
cargo fmt --check
cargo xtask precommit
# failed at check-process-policy on the inherited first-pr run_chain allowlist orphan; other listed gates in that run passed including changelog-fragments

Result, failures, or skipped proof:

  • Discriminator failed before the chain_root tri-state and passed after.
  • Existing builder-override tests kept their answers.
  • Hosted Ripr Rust Small Result is not claimed yet.

Claim Boundary

What may be claimed after this PR? What must not be claimed yet?

  • May claim: a non-setter after a verified setter on the same chain no longer yields override credit; a setter after a non-setter still does; .build() remains the allowed terminal spelling.
  • Must not claim: body-verified terminals other than zero-argument build; item 2/3 of Builder override and call-built input: three hardening follow-ups from the #6792 review #7557; runtime mutation results; that reset() is proven to restore the default (the rule fails closed because it might).

Rollback

Revert the squash of this PR. No schema, golden, or caller change.

Spec-Test-Code Traceability

  • Spec: RIPR-SPEC-0040 builder override
  • Tests: builder_override.rs method_after_verified_setter_is_not_an_override, method_before_verified_setter_is_still_an_override
  • Code: crates/ripr/src/analysis/classify/builder_override.rs (chain_root, ChainWrite, is_copy_through_terminal)
  • Golden outputs: none (goldens check skipped; no output-surface change)
  • Metrics: none
  • ADR/learning: none

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

  • LEM impact: n/a (ordinary analyzer PR; no workflow change)
  • Workflows touched: none
  • Branch protection impact: none
  • Failure mode caught: n/a
  • Cheaper signal considered: n/a
  • Required lanes affected: none
  • Advisory lanes affected: none
  • On-demand/release lanes affected: none
  • Labels that alter behavior: none until merge-ready
  • Artifact families affected: none
  • Rollback path: revert this PR

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • New non-Rust programming files are allowlisted with owner, surface, and reason.
  • New generated, dependency, process-spawn, or network surfaces are allowlisted with owner and reason.
  • Errors are reported with actionable context.
  • Public JSON/schema changes are documented.

Gates

Local focused: fmt, package Clippy, builder_override tests. Full workspace gates and hosted Ripr Rust Small Result are not claimed from this local run.

Current continuation

Owner / governing claim: #7557 item 1 (post-setter chain method).
Candidate: unpublished-to-draft head 939681e5169c1aa46c1dcbb3b1ae9bc466642f56 on cursor/builder-post-setter-chain-3306.
Next: exact-head source review, then merge origin/main before qualification, freeze the head, wait for Ripr Rust Small Result SUCCESS, mark Ready / merge-ready, stop without merging.

Open in Web Open in Cursor 

A non-setter such as reset() applied after a verified setter on the same
builder chain no longer counts as an override, so the field read is not
treated as a false weakly_exposed gap. A method before the setter, and
the conventional zero-argument build() terminal, keep the existing
override reading.

Advances #7557.

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Nov 1, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 58 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 149 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: 84e70593-4ad3-4684-acac-8bf898f3d070
Commits

Reviewing files that changed from the base of the PR and between 99b2e4d and cdbf6b4.

Files selected for processing: 2
  • changelog.d/7557-post-setter-chain-method.md
  • crates/ripr/src/analysis/classify/builder_override.rs
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Author self-review on exact head 939681e5169c1aa46c1dcbb3b1ae9bc466642f56. GitHub cannot record an approval from this author; this COMMENT is the inspection record, not a counted approval.

reviewed_head_sha: 939681e5169c1aa46c1dcbb3b1ae9bc466642f56
integration_basis: origin/main a69bf0214f7bd7e0537a1cdd07e95608e5a366e8
claim_boundary: #7557 item 1 only — a non-setter after a verified setter on the same builder chain must not count as an override (fail closed to unknown). Items 2 (activation.rs) and 3 (re-parse perf) are out of scope. Fenced paths untouched.
changed_surfaces_and_semantic_owners_inspected: crates/ripr/src/analysis/classify/builder_override.rs (chain_root, value_state, binding_writes, ChainWrite, is_copy_through_terminal) and consumer overridden_fields_read → reveal.rs RIPR-SPEC-0040 drop of overridden tokens. Changelog fragment only.
blocking_findings: none for source/oracle on this head.
non_blocking_suggestions: zero-argument .build() is recognized by call-site spelling rather than indexed-body copy proof, because threading the index would change busy reveal.rs or fenced owner_pin. Other terminal names fail closed. A later method on a different field (.attempts(5).delay_ms(1).build()) also fails closed; that is conservative and untested on purpose.
refuted_or_stale_findings: none.
proof_and_ci_observed: method_after_verified_setter_is_not_an_override failed on the pre-change binary (still returned attempts) and passed after. method_before_verified_setter_is_still_an_override passed before and after. All 28 builder_override tests passed. cargo clippy --locked -p ripr --all-targets -- -D warnings finished clean. cargo xtask check-pr-shape on this PR body exited 0.
proof_or_review_missing: hosted Ripr Rust Small Result has not run on this head. Local cargo xtask precommit failed at inherited check-process-policy orphan use std::process::Command in crates/ripr/src/output/first_pr/run_chain.rs (grouped import on main; this diff does not touch it).
affected_currentness_dimensions: production implementation, test stimulus, test oracle, public claim (changelog). Generated/goldens/conflict/integration unchanged.
residual_assumptions_and_non_claims: does not prove reset() restores the default; it withholds override credit because it might. Does not close #7557. Does not claim runtime mutation results.
disposition: REVIEW_INCOMPLETE for merge (hosted Small Result missing). Source/oracle on this exact head has no blocker. Not REVIEW_READY for merge convergence.

Lenses: maintainer (scope stayed inside builder_override.rs + changelog; no reveal.rs/activation.rs/owner_pin); test reviewer (discriminator is the production overridden_fields_read path, failed before / passed after; existing answers unchanged).

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review November 1, 2026 02:52
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Head frozen at 939681e5169c1aa46c1dcbb3b1ae9bc466642f56 (no further pushes). merge-ready is applied to request Ripr Rust Small Result on this exact SHA. Local precommit failed on inherited check-process-policy orphan use std::process::Command in crates/ripr/src/output/first_pr/run_chain.rs (grouped import on main; this diff does not touch it). If that red appears on this head and is still the mainline orphan, it is inherited, not candidate-caused.

Will comment merge-ready with this SHA once Ripr Rust Small Result is SUCCESS. Will not merge.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Hosted Ripr Rust Small Result on frozen head 939681e5169c1aa46c1dcbb3b1ae9bc466642f56 failed at inherited check-process-policy, not this diff.

Evidence:

Will not fix that allowlist here. Will not re-request merge-ready on this head while that mainline orphan remains. Resume when #11975 (or equivalent) lands on main: merge origin/main, freeze the new head, re-request merge-ready. Not merging this PR.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs verification checks before upstream.

Verification questions

  • Confirm the implementation treats any later non-terminal method as potentially affecting the analyzed field, including a later verified setter for another field; this is conservative but may reduce override recall.
  • Confirm the added tests cover reset after the target setter and reset before it, but do not cover a later unrelated-field setter or a chain with an intermediate binding.

Parked follow-ups

  • The tests exercise ordering and the fail-closed result but do not independently distinguish a field-preserving later method from one that mutates the target field.
  • The zero-argument build() exemption is a deliberate call-site convention rather than copy-through proof; expanding it would cross the stated consumer boundary.
  • The .build() exemption is based on call-site spelling and zero arguments, not indexed-body proof of copy-through behavior.
  • Override recall is reduced for chains containing a later non-setter, including a later setter for a different field.

Evidence gaps

  • The available sensor packet lacks the always-on cargo-test receipt, so the reported test and Clippy results remain author-reported rather than independently confirmed.
  • Model proof intent was rejected by deterministic validation.
  • No completed cargo-test receipt is available for the exact review head; the PR body reports the focused discriminator and 28 builder-override tests passing.

@EffortlessSteven EffortlessSteven left a comment •

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review (fresh-context reviewer, head 939681e): REPAIR_REQUIRED

First independent review on this PR. It is bound to the head below and rests on the source at that head and on the hosted checks at that head.

Inspected:

  • Head 939681e5169c1aa46c1dcbb3b1ae9bc466642f56; not draft; label merge-ready; mergeable: MERGEABLE, mergeStateStatus: BLOCKED; title "fix(classify): withhold override credit after a post-setter chain method"; governed by issue #7557.
  • The candidate's whole change against the current main tip a69bf0214f7bd7e0537a1cdd07e95608e5a366e8, which is also this branch's base, is 2 paths, +98/-9: changelog.d/7557-post-setter-chain-method.md (+7/-0, new) and crates/ripr/src/analysis/classify/builder_override.rs (+91/-9).
  • What the change does. chain_root (:446) now returns ChainWrite (:376) instead of a bool. Walking from the outermost call inward, a non-setter method seen before the setter is found is recorded in later_non_terminal (:453); at the end, later_non_terminal && setter yields ChainWrite::Unknown (:471). Unknown propagates to ValueState::Unknown in value_state and to None in binding_writes (:567), whose caller turns None into ValueState::Unknown. I checked that direction rather than assuming it: it is fail-closed — the field is not counted as overridden, so the override credit is withheld rather than granted.
  • I checked the walk direction, because the whole rule rests on it. The walk goes from the outermost call inward, i.e. from the latest call in source order to the earliest, so "seen before the setter is found" is exactly "later in source order than the setter". The two new tests form a discriminating pair in the right order: method_after_verified_setter_is_not_an_override (:2766) puts .reset() after .attempts(5) and expects no override; method_before_verified_setter_is_still_an_override (:2778) puts it before and expects the override.
  • I checked that the new tests really exercise the owner-verified setter path rather than passing for a trivial reason. is_setter (:512) requires the name to be one of setter_names(field) and to appear in the owner-verified owner.setters list, and the call to carry an argument. The test helper supplies the owner through OwnerCall::from_symbol(OWNER).with_setters(&setter_names("attempts")), so .attempts(5) is genuinely recognised as the setter and the second test's positive expectation is meaningful — the pair is not passing because no setter was found at all.
  • The exemption. is_copy_through_terminal (:492) returns true for a zero-argument method named exactly build, and nothing else.

Blocking:

  1. The exemption is keyed to one spelling, so every other conversion terminal now loses override credit and produces a false actionable gap. is_copy_through_terminal (:492) recognises a zero-argument .build() and nothing else. Any other method after a verified setter therefore sets later_non_terminal and the chain becomes Unknown, which withholds the credit. Concretely, for the ordinary fallible-builder shape:

    let retry = RetryBuilder::new().attempts(5).try_build()?;
    assert_eq!(retry.attempts, 5);

    the walk sees .try_build() — not a setter, not named build — before it reaches .attempts(5), so later_non_terminal is set, the chain becomes Unknown, and the field is not counted as overridden. The analyzer then treats the assertion as not observing the changed field and projects a repair gap. Before this change the setter on the chain granted the credit and no gap was projected. The same applies to .finish(), .make(), .create() and any other terminal spelling. The code doc acknowledges the intent — "other names fail closed as unknown later methods" — but the direction of the trade is the one the product contract names as the worse one: "A wrong actionable repair signal is worse than several missed advisories." This change removes a missed advisory for .reset() and introduces a false actionable gap for every other terminal. The repository already owns the mechanism to decide this by proof rather than by name: setter_plainly_writes verifies a setter's indexed body and is_setter consumes the verified owner.setters list. The terminal that converts the builder into the value being read deserves the same treatment, or the rule must at least be stated as "any method after a verified setter withholds the credit, except a zero-argument build" wherever the behaviour is promised.

  2. The user-facing fragment states the effect in the opposite direction for the shapes the change actually breaks. changelog.d/7557-post-setter-chain-method.md says the change means such a chain "no longer counts as an override of that field, so the read is not treated as a false weakly_exposed gap". For .reset() that is right. For .try_build()? the change does the opposite: it takes a read that was correctly treated as an override and turns it into a false weakly_exposed gap. The fragment should name the shapes that lose the existing reading, because that is the part a user of the tool will actually meet.

Non-blocking:

  1. The module doc asserts a role the implementation does not verify. The new doc says "The conventional zero-argument .build() terminal is the copy-through conversion to the owner's result and does not by itself withhold override credit", while is_copy_through_terminal's own doc concedes "A zero-argument .build() is recognized here from the call site". The code recognises a name; the doc states a role. A type whose zero-argument build() mutates the field (fn build(self) -> Self { self.attempts = 0; self }) is granted override credit it should not have. This is the same name-keyed weakness as finding 1, in the opposite direction, and the doc currently states it as verified fact.
  2. No test in the repository exercises a terminal other than build. The two new unit tests end in .build(); crates/ripr/tests/builder_default_override.rs — the integration test that reaches the retained production path — also uses RetryBuilder::new().attempts(5).build(); and the calibration corpus that RIPR-SPEC-0040 names for builder override outcomes (mutation_calibration_runtime_fixtures_v3_builder_override_outcomes, fixtures/boundary_gap/calibration/runtime-fixtures-v3/mutation-calibration.json) shows a single builder_override entry whose terminal is likewise build. Every terminal in the corpus is spelled build, so the fail-closed path for other spellings is entirely unexercised. That is why finding 1 would not surface in any existing run.
  3. The new behaviour has no integration coverage at all. The two new tests are unit tests over the module's synthetic overridden() helper, which supplies the owner with owner.with_setters(&setter_names("attempts")) rather than resolving the owner through the Rust index and setter_plainly_writes. They prove the chain rule; they do not prove that a real owner is recognised, nor that a real post-setter chain is withheld. crates/ripr/tests/builder_default_override.rs is the surface that does that, and it was not extended.
  4. Efficiency: setter_names(field) allocates three Strings on every is_setter call. setter_names (:501) builds format!("{field}"), format!("with_{field}") and format!("set_{field}"), and is_setter (:512) calls it on every invocation — once per method call in every receiver chain, for every candidate field — to compare against a single name. This PR adds a second per-call name comparison on the same path (is_copy_through_terminal). The allocations are avoidable: compare by &str without formatting, or hoist the three names once per field. The allocation is pre-existing, but it sits directly on the line this PR changes and the fix is free.
  5. The module doc update is otherwise accurate. I checked the rewritten paragraph against the implementation: "a non-setter chained after the setter … leave the token confirming" matches the Unknown path, "A method before the setter … keep the existing override reading" matches the !setter guard at the point where the non-setter is seen, and the doc's claim that "everything here … fails closed toward the existing credit" is true of the Unknown propagation I traced through value_state and binding_writes.

Not run:

  • The Rust toolchain on this host is not on PATH: nothing was compiled, tested, linted, or run through cargo xtask. Every Rust-level statement above comes from the source at the reviewed head or from hosted job logs.
  • The hosted Rust gates at this head do not exercise the change. Run 41267116121, job 124732266721 fails at step 16 "Repository policy preflight" with the same base-side check-process-policy orphan — "crates/ripr/src/output/first_pr/run_chain.rs allowlist entry for use std::process::Command is orphaned: max_count=1 but pattern not found in any tracked file" — which is the known base-side red at main tip a69bf0214 (job 124707375551), repair carrier #11975. The candidate contributes two paths and spawns no process, so this red is not candidate-attributable. Steps 17-39 were skipped — including "All-features ripr target check", "Strict workspace Clippy", "Golden output contracts", "Fixture contracts", "Verdict corpora" and "Required Rust tests" — so the two new unit tests were never compiled or executed at this head, and the builder-override calibration labels were not re-validated.
  • The earlier "Admit PR Candidate" failure (run 41266952151, job 124731800917) is an infrastructure failure, not a source failure: the log ends with REASON: runner_api_failed / RUNNER_QUERY: failed and "CX43 disk-guard temp failed; GitHub-hosted fallback succeeded". I record it separately so it is not mistaken for a second source red.
  • The ub-review job (124731293057) and the re-run Windows Advisory / Rust-only feature lane / CI jobs were still in progress and were not read to a terminal state.

Suggested repair shape: recognise the conversion by proof rather than by a single spelling — the repository already verifies setters' indexed bodies through setter_plainly_writes and carries the result in owner.setters; if a name-based rule is kept, state it plainly in the changelog and the module doc as "any method after a verified setter withholds the credit, except a zero-argument build", add a try_build()? case to crates/ripr/tests/builder_default_override.rs beside the existing .build() case, and correct the module doc's assertion that .build() is the copy-through conversion.

Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 939681e5169c1aa46c1dcbb3b1ae9bc466642f56. Not an approval.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

Adopted the externally advanced published head cdbf6b43071deaed30f7dcd9b40b787fc6c7b017 (merge of origin/main 99b2e4d08e / #11995 into this branch). Unique delta vs current main is still only builder_override.rs + changelog.d/7557-post-setter-chain-method.md. Local check-process-policy now passes; the two #7557 discriminators still pass.

In-flight merge-ready request on this exact SHA: https://github.com/EffortlessMetrics/ripr-swarm/actions/runs/41269313054 (Admit PR Candidate success; GitHub-hosted Rust gates running). Will not re-apply merge-ready over that run. Head frozen. Will not merge.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Decision

  • Needs one verification check before upstream.

Verification questions

  • Confirm the regression suite does not exercise a later setter for an unrelated field or an intermediate binding after the target setter.

Parked follow-ups

  • A later non-terminal method conservatively withholds override credit even when it is a setter for another field, reducing override recall on common multi-field chains.
  • The implementation exempts any zero-argument method named build by spelling, without indexed-body proof that it copies the analyzed field.
  • The build exception is intentionally call-site-spelling based rather than body-proven, narrowing the immediate fix but leaving a parked opportunity for indexed-terminal proof.

Evidence gaps

  • The always-on cargo-test sensor has no receipt in the supplied packet, so the focused test result and existing-test regression check remain unverified by this lane.
  • Model proof intent was rejected by deterministic validation.
  • Current-head cargo-test evidence is absent even though cargo-test was scheduled late.
  • The always-on cargo-test receipt was absent at packet time, so local source inspection cannot substitute for execution evidence.
  • The cargo-test evidence receipt is absent, while the hosted gate failed on an inherited policy allowlist mismatch outside the two changed paths.

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Independent review (fresh-context reviewer, head cdbf6b4): REPAIR_REQUIRED

Supersedes my earlier review on this PR, which was bound to head 939681e51. The head has since moved to cdbf6b4307 and the earlier blocking finding is now runtime-verified rather than read from source, which is why this is a new review rather than a note.

Inspected:

  • Head cdbf6b43071deaed30f7dcd9b40b787fc6c7b017; not draft; label merge-ready; mergeable: MERGEABLE, mergeStateStatus: BLOCKED; title "fix(classify): withhold override credit after a post-setter chain method"; governed by issue #7557.

  • The candidate's contribution against the current main tip 99b2e4d08e5dbed103d661e89cf1c6fabb6a7b62 is still 2 paths, +98/-9: changelog.d/7557-post-setter-chain-method.md (+7/-0, new) and crates/ripr/src/analysis/classify/builder_override.rs (+91/-9).

  • The delta from 939681e51 to this head is a merge of main and nothing else. git log --oneline 939681e51..cdbf6b430 returns two entries: the merge commit and 99b2e4d08e ("fix: repair main after #11950 … (#11995)"). git diff --stat between the two heads touches 12 paths — crates/ripr/src/lsp/diagnostics.rs, crates/ripr/tests/cli_smoke.rs, six verdict-corpus case rows, two verdict-corpus result rows, three changelog.d/ fragments, and policy/process_allowlist.d/11720-first-pr-run-chain.txt. crates/ripr/src/analysis/classify/builder_override.rs is not among them, so every finding and every measurement made at 939681e51 still applies to this head.

  • Runtime proof of the blocking finding. I added a temporary probe test to a scratch worktree's crates/ripr/src/analysis/classify/builder_override.rs (not committed, and not part of the candidate) that calls the module's own overridden() helper over five chain shapes, and ran it on both sides:

    for (name, src) in shapes {
        println!("PROBE {name} -> {:?}", overridden(src));
    }
    cargo test --locked -p ripr --lib tmp_probe_terminal_shapes -- --nocapture
    

    An empty result means the field is not counted as overridden, so the analyzer treats the test as not observing the changed field and projects a repair gap.

    chain shape origin/main (99b2e4d08e) this PR (939681e51)
    RetryBuilder::new().attempts(5).build() ["attempts"] ["attempts"]
    RetryBuilder::new().attempts(5).reset().build() ["attempts"] []
    RetryBuilder::new().attempts(5).try_build()? ["attempts"] []
    RetryBuilder::new().attempts(5).finish() ["attempts"] []
    RetryBuilder::new().attempts(5).build().reset() ["attempts"] []

Blocking:

  1. The change withholds override credit from every conversion terminal that is not spelled build, and the table above shows that this is a regression against main, not a pre-existing behaviour. is_copy_through_terminal (builder_override.rs:492) recognises a zero-argument method named exactly build and nothing else. Every other method after a verified setter therefore sets later_non_terminal (:453), the chain becomes ChainWrite::Unknown (:471), and the field is not counted as overridden. On main all five shapes are credited; on this head three of them are not.
    The two shapes that lose credit for the wrong reason are ordinary conversions, not mutations: try_build()? — the canonical fallible-builder terminal, and chain_root explicitly supports the ? operator (builder_override.rs:465, ast::Expr::TryExpr) — and finish(). A builder that ends in either is now reported as a test that does not observe the field it sets, and the analyzer projects a repair gap against it.
    This is the product contract's worst direction. The PR removes a missed advisory for .reset() — correct — and introduces a wrong actionable repair signal for every other terminal. The trade is not stated in the changelog fragment, which says only that such a chain "no longer counts as an override of that field, so the read is not treated as a false weakly_exposed gap"; for .try_build()? and .finish() the change does the opposite of what that sentence claims.
    The repository already owns the mechanism to decide this by proof rather than by name: setter_plainly_writes verifies a setter's indexed body, and is_setter consumes the verified owner.setters list. The terminal that converts the builder into the value being read deserves the same treatment. If a name-based rule is kept, then it should be stated plainly — "any method after a verified setter withholds the credit, except a zero-argument build" — in the changelog and in the module doc, and it should be tested against a non-build terminal.
  2. The user-facing fragment states the effect in the opposite direction for the shapes the change actually breaks. changelog.d/7557-post-setter-chain-method.md frames the change as removing a false weakly_exposed gap. The measurement above shows the gap count moving the wrong way for try_build()? and finish(). The fragment should name the shapes that lose the existing reading, because that is the part a user of the tool will meet.

Non-blocking:

  1. The module doc asserts a role the implementation does not verify. The doc says "The conventional zero-argument .build() terminal is the copy-through conversion to the owner's result", while is_copy_through_terminal's own doc concedes "A zero-argument .build() is recognized here from the call site". The code recognises a name; the doc states a role. A type whose zero-argument build() mutates the field (fn build(self) -> Self { self.attempts = 0; self }) is granted override credit it should not have. Same name-keyed weakness as finding 1, in the opposite direction, and the doc currently states it as verified fact.
  2. The repository's whole corpus uses the one spelling the code special-cases, so the fail-closed path is invisible. The PR's two new unit tests end in .build(); crates/ripr/tests/builder_default_override.rs — the integration test that reaches the retained production path — also uses RetryBuilder::new().attempts(5).build(); and the calibration corpus RIPR-SPEC-0040 names for builder override outcomes (mutation_calibration_runtime_fixtures_v3_builder_override_outcomes, fixtures/boundary_gap/calibration/runtime-fixtures-v3/mutation-calibration.json) has a single builder_override entry, likewise spelled build. That is why the measurement above was needed: nothing in the suite would have shown the regression.
  3. The new behaviour has no integration coverage. The two new tests are unit tests over the module's synthetic overridden() helper, which supplies the owner with owner.with_setters(&setter_names("attempts")) rather than resolving the owner through the Rust index and setter_plainly_writes. They prove the chain rule; they do not prove that a real owner is recognised, nor that a real post-setter chain is withheld. crates/ripr/tests/builder_default_override.rs is the surface that does that, and it was not extended.
  4. Efficiency: setter_names(field) allocates three Strings on every is_setter call. setter_names (builder_override.rs:444) builds format!("{field}"), format!("with_{field}") and format!("set_{field}"), and is_setter (:458) calls it on every invocation — once per method call in every receiver chain, for every candidate field — to compare against a single name. This PR adds a second per-call name comparison on the same path (is_copy_through_terminal). The allocations are avoidable with a predicate that is provably identical to the current one, because the current set is exactly {field, "with_"+field, "set_"+field}:
    name == field
        || name.strip_prefix("with_") == Some(field)
        || name.strip_prefix("set_") == Some(field)
    Each arm reconstructs exactly one member of that set, so it accepts exactly the same names — including the self-referential case where field is itself named set_x — and rejects everything else. The allocation is pre-existing, but it sits on the line this PR changes and the fix is free.

Not run:

  • Not run: the hosted Rust gates at this head. The required check Ripr Rust Small Result is absent at cdbf6b430 — not red. The merge-ready label was applied before the last push, and the Rust lanes only start on a label-addition event (.github/workflows/routed-rust.yml, pull_request: types: [labeled]), so a commit pushed after the label gets no Rust lane. The remedy is to remove and re-add the label. A Ripr Rust Small on GitHub Hosted / Rust gates run was still in progress when I read the state, so that lane is unobserved, not green.
  • Run locally, with receipts: cargo check --locked -p ripr --all-targets on this repository exits 0. The probe measurement above was produced by cargo test --locked -p ripr --lib tmp_probe_terminal_shapes -- --nocapture against a scratch worktree checked out at 939681e51 and at 99b2e4d08e, sharing one CARGO_TARGET_DIR. The probe test was added only to the scratch worktree and was not committed.
  • Not run: cargo xtask precommit, the full workspace suite, and the verdict-corpus gate. A full-workspace run is out of budget for a single-PR review, and the verdict-corpus rows that RIPR-SPEC-0040 pins for builder override outcomes were not regenerated at this head.
  • The repository's Rust toolchain is present on this host and is used above; it is simply not on the default PATH (%USERPROFILE%\.cargo\bin holds cargo.exe/rustc.exe, and the repo's rust-toolchain.toml pins 1.95.0, which is installed). No Rust receipt in this review is inferred from the hosted lanes.

Suggested repair shape: recognise the conversion by proof rather than by a single spelling — the repository already verifies setters' indexed bodies through setter_plainly_writes and carries the result in owner.setters; if a name-based rule is kept, state it plainly in the changelog and the module doc as "any method after a verified setter withholds the credit, except a zero-argument build"; add a try_build()? case to crates/ripr/tests/builder_default_override.rs beside the existing .build() case so the regression is visible to the suite; and correct the module doc's assertion that .build() is the copy-through conversion.

Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head cdbf6b43071deaed30f7dcd9b40b787fc6c7b017. Not an approval.

Copy link
Copy Markdown
Member Author

Review of record, head cdbf6b43071deaed30f7dcd9b40b787fc6c7b017. Disposition: REVIEW_READY.

Inspected: full diff (2 files), semantic owner analysis/classify/builder_override.rs. chain_root walks outermost to innermost; a non-setter, non-.build() method seen before the setter is found sits after it in source order, so the chain becomes ChainWrite::Unknown, which value_state and binding_writes treat as no override credit (fail closed: fewer actionable gaps, not more). A method before the setter and the zero-arg .build() terminal keep the prior reading. Two tests cover the after (no override) and before (override) cases. Doc comments and the changelog fragment (7557-..., cites (#7557)) match the behavior. No wire/golden surface. Ripr Rust Small Result completed/success on this exact SHA, mergeable_state clean, no unresolved threads.

Non-blocking observation: a sibling setter for a different field after the target setter (.attempts(5).timeout(3).build()) also takes the Unknown path and withholds credit. That is conservative and matches the documented "other names fail closed"; a follow-up could refine it if it proves to lose real signal.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven merged commit e843917 into main Nov 1, 2026
61 checks passed
@EffortlessSteven
EffortlessSteven deleted the cursor/builder-post-setter-chain-3306 branch November 1, 2026 09:30
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants