Repository navigation
fix(classify): a changed condition hidden behind an absorbing literal min/clamp has no value sink (#10875) - #11730
Conversation
… min/clamp has no value sink (#10875) A changed if condition that only picks a let binding which the owner's tail pins with .min(0) on an unsigned type or .clamp(L, L) now reads a propagation limit instead of exposed. Fail-closed: straight-line body, receiver read once, literal operands and arms, plain primitive return type, and a workspace with no no_implicit_prelude/no_core, include!, fn min/clamp definition or primitive-renaming item. Adds the runtime-labelled absorbing-min-literal-floor corpus case. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzURKRuX6rB4sZzfMME
|
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 37 minutes. View limit details
|
… absorbing min rule (#10875) Adds an evidence-level positive and negatives through check_workspace (parked r.min(cap) witness, custom min, no_implicit_prelude, macro-generated fn, primitive renames), refuses macro_rules bodies that declare items by computed name and extern crate renames, annotates typed lets in positives, documents that the condition is not proven pure, and cites the cargo replay of the corpus mutant. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzURKRuX6rB4sZzfMME
…literal-floor; static-language wording (#10875) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzURKRuX6rB4sZzfMME
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Required-check failures at head 41af688 are main-side, not this PR's: Generated by Claude Code |
There was a problem hiding this comment.
Confirmed findings
- The new absorbing-tail route is narrow and sibling-helper coverage is not demonstrated across other runtime/classifier entry points.
- The workspace guard detects trait declarations containing fn min/clamp, but an impl method defined under another name can still provide the selected method call.
Verification questions
- Confirm literal matching strips only a suffix equal to the owner's primitive, so equivalent bounds such as
0x0are not recognized even thoughmin(0x0)is absorbing. - Confirm the classifier replaces all ordinary flow sinks with one Unknown sink when the shape matches, so no sibling sink route can preserve observable behavior.
- Confirm the runtime test fixture itself is not a red/green discriminator: it asserts only the invariant output before and after the edit.
- Confirm the evidence-level tests cover positive, non-literal, and several workspace-dispatch controls but not an impl-defined min method.
- Confirm the evidence path replaces all local flow sinks with one Unknown sink when the absorbing shape matches, so unrelated sinks are discarded rather than merely suppressing the absorbing returned-value sink.
- Confirm the new rule is limited to one straight-line let-binding, an if condition matching the probe, and a tail literal min(0) or clamp(L,L); it is not a general absorbing-helper analysis.
Evidence gaps
- Execution evidence for the changed Rust paths remains incomplete because the cargo-test receipt is absent.
- The corpus subject metadata declares retained Cargo.toml and src/lib.rs hashes, but those files are not present under the declared subject directory in this diff.
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
- The PR documents that substituted std/core or ambient RUSTFLAGS can alter effective dispatch without index authentication.
|
Correction to my earlier comment: with main-side red cleared (#11734), Generated by Claude Code |
…rts first Corpus tests tamper with cases[0] and expect a discriminated case; the new not_discriminated case sorted first and broke validator_rejects_a_label_that_contradicts_its_mutant_outcomes. Rename only. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01SvmPmoGgSpmhPNEXS9fQN9
|
Review of record, head Repair on this round: the previous run's only failure (shard 4, Angles: correctness, tests, spec/contract, perf/security.
Findings: one (the corpus ordering break above), resolved. Merge is gated on a green Generated by Claude Code |
There was a problem hiding this comment.
Reporter summary
The implementation appears sound for its narrow contract: the matched local tail pins the returned primitive, the replacement with one Unknown sink is consistent with the single-read/straight-line body invariant, and the corpus fixture correctly demonstrates a surviving, non-discriminating mutant rather than a red/green oracle. However, the strongest remaining concern is that the textual workspace guard cannot authenticate standard Ord dispatch or fully exclude custom/generated impl-defined min/clamp dispatch; the named substituted std/core and RUSTFLAGS residual is also not closed. Verification is incomplete because cargo-test timed out after 900 seconds and ripr failed with exit code 2, so the author-reported passing precommit is not supported by a successful receipt in this review wave.
Governing issue or accepted claim: #10875
Acceptance delta (one sentence):
let r: u32 = if n == 5 { 1 } else { 0 }; r.min(0)(and.clamp(L, L)) no longer reads exposed through the returned value but reads a named propagation limit, with a runtime-labellednot_discriminatedcorpus case.Rule (fail-closed, new owner
classify/absorbing_tail.rs, called fromclassifier/evidence.rs)Body half: straight-line
letstatements plus one tail<r>.min(0)(unsigned return type) or<r>.clamp(L, L)(any primitive integer);ris read only by that tail; itsletisif <changed comparison> { int literal } else { int literal }on the probe line; plain primitive return type, no fn generics, no nested items. (An untypedlet r = ..; r.min(0)does not compile, E0689, so positives annotate the binding.)Workspace half (needs
workspace_complete): no indexed source holdsno_implicit_prelude,no_core,include!,fn min/fn clamp, atype/struct/enum/union/trait/modnamed as the primitive, ause/extern crate ... as <primitive>, or amacro_rules!body declaring an item by computed name (fn $n,type $n, ...).Method spelling alone is never the evidence: a real
#[no_implicit_prelude]crate with its ownminreturns the receiver and makes the condition observable (checked with rustc).Limits (named)
propagation_unknown; it never credits or flags a gap.std/corepackage or ambientRUSTFLAGSchanging the effective prelude is not authenticated by the index. Reviewer decision needed on whether that residual is acceptable.let cap = n / 6; ... r.min(cap)staysexposed(a known missed advisory), not misjudged.Verification (head 41af688)
fread exposed with sinkr.min(0). After:propagation_unknown;r.min(cap)unchanged exposed.absorbing_tail.rs(positives; negatives for non-literal operand, signedmin(0), non-primitive/generic types, extra reads/shadow/macro/return/else-if/nested fn/turbofish, wrong probe, hostile workspaces incl. macro-generated items and extern renames).check_workspace,app/tests/absorbing_tail_pipeline.rs): positive readspropagation_unknownwith the unknown sink; the parkedr.min(cap)witness keeps its returned-value sink; custommin,no_implicit_prelude, macro-generatedfn,use ... as u32andextern crate ... as u32workspaces each keep the ordinary sink.absorbing-min-literal-floor(new authored subject; sha256 of both retained files re-checked): the edit-itself mutant ran under rustc 1.95.0 withcargo testand survived;cargo xtask verdict-corpus relabel --case absorbing-min-literal-floorreplayed it, 0 drifted (the run report is a localtarget/artifact, not committed).check --casesscoresabstained;labeling_observation.ripr_commitis the candidate commit a57b3f5 whose code produced the observation (the final head only adds fixture metadata and wording).cargo xtask precommitpasses on this head.🤖 Generated with Claude Code
https://claude.ai/code/session_01YVdGzURKRuX6rB4sZzfMME