Repository navigation
Python: a literal zero-argument patch does not hide an edit around it - #10212
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVJ2F1oh39juHJ8AZR5fS3
|
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 51 minutes. View limit details
Comment |
There was a problem hiding this comment.
Verification questions
- Confirm the two blessed fixture rows now set changed_since_labeling=true, so their oracle does not require the changed behavior to be distinguished from the old behavior.
- Confirm the repository-evidence route passes an empty owner source, disabling the new literal-patch exemption even though the focused classification route passes actual owner source.
- Confirm the new tests cover many rejected mock forms but do not cover sibling with-context-manager forms such as nested with, parenthesized with, or multiple patch headers beyond a flat comma list.
- Confirm positive cases assert only that StaticLimitKind is None; they do not demonstrate that the exact assertion passes for the new owner and fails for the old owner.
- Confirm the repo evidence path passes an empty owner source into the shared static-limit routine, so the new literal-patch exemption cannot activate in that path even when repository source is available elsewhere.
- Confirm the repository-evidence route passes empty owner source, so literal_patch_calls always fails closed there; only the focused owner-change route can activate the new exemption.
- Confirm the repository-evidence route deliberately passes an empty owner source, disabling literal-patch analysis for that route rather than proving the exemption.
- Confirm the new focused tests exercise static-limit classification but do not execute old and new Python owners to demonstrate a red/green distinction.
- Confirm the owner-wide name check is textual, so it can misclassify a same-spelled attribute or local as use of the patched callable, producing an unnecessary mocked_module limit.
Evidence gaps
- The two blessed corpus rows record credited/exposed classifications but no execution-level red/green evidence that their assertions reject the pre-change behavior.
- Model proof intent was rejected by deterministic validation.
- The PR's validation claim is not independently supported by the available sensor receipts.
|
Independent bounded review: REPAIR_REQUIRED for the exemption safety contract; not merge qualification. Exact base acb0f4d; head 1d59da6; tree 81269a3ef4bd3618fdbf3a57c1ae3562e94a25f9. Head re-read unchanged. Canonical writer remains EffortlessSteven / claude/project-thread-s3tp41. Existing review 5641590842 contains verification questions, Gemini/CodeRabbit receipts are quota failures, and no equivalent completed counterexample proof or review threads were returned. Blocking contract defect at literal_patch.rs:62-74,112-115: equal call/int counts do not ensure a visible edit. Under patch("m.time.time", return_value=1), old Additional bounded gap at literal_patch.rs:175-190: a body containing the admitted patch plus Passed evidence: compiled/executed exact literal_patch.rs with installed rustc 1.95.0, existing rustpython_parser dependency, minimal owner/test/import scaffolding and equivalent expression parser. Positive control and both negative challenges returned Some. Python unittest.mock assertions verified patched old=new=2 and alternate old=10,new=2. Initial harness setup using Mod::parse failed compilation; corrected Suite::parse harness compiled/executed exit 0. No candidate source edits or author-branch writes. Review tree clean. These establish a helper safety-contract defect, not a final analyzer false-credit verdict. Reconciliation: repo-evidence passes old=None and empty owner source, so it deliberately fails closed. Textual name checks can conservatively abstain. Blessed-row execution discrimination, full CLI verdict, hosted qualification and additional context-manager cases remain unverified here; no full qualification rerun or dispatch. Canonical owner's next action: repair the same candidate's arithmetic admission, add production-path negative cases for arithmetic collision and dynamic namespace replacement, correct the visibility claim, then request affected-head review. No Ready/merge recommendation. |
…est bodies Review found equal call counts do not keep an edit visible (v + v against v - v + 2 agree at v = 1) and that a test line can rebind names. Require the patched call exactly once with the same sign, plain assert/assignment test lines only, and correct the spec claim. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVJ2F1oh39juHJ8AZR5fS3
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVJ2F1oh39juHJ8AZR5fS3
|
Repair pushed (head 01cabf6) for the REPAIR_REQUIRED review of 1d59da6. Both findings reproduce and are fixed in the same candidate.
Generated by Claude Code |
A third review showed a test could rebind the owner behind the patch with a semicolon, a chained or attribute assignment, a helper call, a default argument or a shadowed patch. Parse the test and admit only asserts, name assignments and patch blocks over names, constants, operators and calls of the owner or a safe builtin, with patch bound exactly once. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVJ2F1oh39juHJ8AZR5fS3
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- The exemption compares call counts and signs but does not compare the int-wrapper bit; old
int(time.time())and newtime.time()can therefore share the same count tuple.
Verification questions
- Confirm repository-evidence classification passes an empty owner source into the shared static-limit routine, preventing the literal-patch exemption from activating on that route.
- Confirm positive tests assert only the absence of a static limit and never execute the selected assertion against old and new owner behavior.
- Confirm the documented contract says the same int(...) wrapping is required, but the implementation's shape equality does not enforce that wording.
- Confirm the two moved fixture rows demonstrate credited outcomes but do not directly prove the old assertion fails while the new assertion passes.
Refuted
- A literal mock exemption could unsafely cross a worker or async handoff boundary.; refuted because: No such boundary exists in the changed Rust/Python analyzer paths; the implementation performs synchronous source parsing and classification only.
Parked follow-ups
- The helper recognizes only flat single-header patch contexts; nested, parenthesized, and comma-separated headers remain rejected by the strict header parser.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- Fixture expectations changed the two rows to credited with changed_since_labeling=true, but no fixture assertion demonstrates the corresponding old/new behavior distinction.
- The diff supplies focused negative tests for mock forms, arithmetic collisions, owner-name reuse, and namespace rebinding, but no executed cargo-test receipt is available.
- The mandatory late cargo-test receipt is not present in the supplied packet.
|
Head 54507f0 pushed (merge of main plus the AST test-body whitelist), Third review round and the bot's int-wrapper finding. The int-wrapper finding is refuted: the shape tuple
Local proof. The Python corpus check passes (0/245 false, ceiling 24) and the Python lib tests pass (1171). Local precommit stops only at (a) the CodeRabbit and Gemini are rate-limited, so those provider reviews are missing, not clean. Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm positive tests assert only StaticLimitKind::None; none demonstrates that the selected assertion passes for the new owner and fails for the old owner.
- Confirm the added tests cover rejection shapes extensively, but positive cases check only absence of a static limit rather than old-owner failure and new-owner success.
- Confirm the new fixture rows are credited without an executable assertion demonstrating old-owner failure and new-owner success.
Refuted
- The helper's scope is duplicated across routes and risks inconsistent policy.; refuted because: The patch logic is centralized in literal_patch.rs; route-specific source availability is an explicit input boundary, and all static-limit routes call the shared routine.
Parked follow-ups
- The strict production whitelist rejects many hostile test bodies, but focused tests do not cover nested, parenthesized, or multiple with-context-manager forms.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
…ched call Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVJ2F1oh39juHJ8AZR5fS3
|
Head 0f066fe, The same pass also checked unary minus, async tests, sign flips, int-wrap changes, dropped or duplicated calls, walrus, lambda, comprehension, IfExp, subscript, f-string specs and conversions, multi-line returns, float/bool/negative stand-ins, aliased or second Generated by Claude Code |
|
Reply to the ub-review verification questions (head 0f066fe):
Generated by Claude Code |
|
Generated by Claude Code |
A stand-in equal to a neighbouring string made a reorder invisible. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVJ2F1oh39juHJ8AZR5fS3
|
Head 60b5764, Devin finding (string stand-in equal to a neighbouring operand hides a reorder): valid, fixed. The shape now records the patched call's index among the line's operands, and old and new must agree, so Devin ceiling note: not a defect. The PR text's 28→26 was written before main moved; the committed value is the re-measured current count (26→24 after merging main, then 24 held). The corpus check enforces equality, so the committed 24 is the checked number. Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm positive Rust tests assert only StaticLimitKind::None and do not execute the selected assertion against old and new owner behavior.
- Confirm the exemption is evaluated per related candidate, but acceptance is aggregated across candidates; an unrelated non-exempt mocked candidate sets mocked=true and retains the limit.
- Confirm the focused route supplies owner source, while the repository-evidence route supplies an empty string, so the same mocked change is classified differently by route.
Refuted
- The exemption can activate in the repository-evidence route despite unavailable owner source.; refuted because: Both repository-evidence and generic static-limit callers explicitly pass empty owner_source; literal_patch_calls returns None when owner_source is empty.
- The repository-evidence route accidentally enables the exemption without repository owner source.; refuted because: It passes an empty owner source, and literal_patch_calls rejects empty owner_source, so this route fails closed.
- The PR description still reports the missed-credit ceiling as 28 to 26, while the committed ledger changes 26 to 24.
Parked follow-ups
- The two moved corpus rows now request discrimination and are credited against an existing oracle, but the new Rust unit tests assert only absence of a static limit.
- The seeded thread identifies module-level patch shadowing and same-last-two-segment patch targets as residual risks, with issue #10267 filed.
- Behavior-level discrimination is evidenced by the corpus truth rather than by executing the selected Python assertion in the Rust unit tests; the seeded review explicitly answered this concern, but no new independent execution proof is present.
- The seeded thread identifies module-level patch shadowing and same-segment target-module ambiguity as residual bypass risks.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
Review of record, head 60b5764. Required check: Review angles and findings:
Not covered: CodeRabbit and Gemini reviews are missing (rate limited), not clean. Two residuals, a module-level Generated by Claude Code |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVJ2F1oh39juHJ8AZR5fS3
Summary
with patch("m.time.time", return_value=<nonzero int or str>):no longer makes ripr abstain (mocked_module, thenmissing_import_graphontime.time()) when the edit is the text or+/-arithmetic around that call.literal_patch.rs). The changed line, old and new, must be onereturnof an f-string or+/-expression over names, int/str literals, the patched call andint(<patched call>), with the same call andint()counts on both sides. The patched name must appear in the owner only on the changed line, and the owner or its class must not be a segment of the target. Anything else keeps the limit.py-idioms-patch-clock-separatorandpy-idioms-patch-clock-offset, abstained to credited. Pythonmissed_credit_ceiling28 to 26.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Spec: RIPR-SPEC-0238 rule 8
Governing issue or accepted claim: #9271
Acceptance delta (one sentence): Two Python missed-credit rows (patch-clock-separator, patch-clock-offset) move from abstained to credited without letting a mock hide an edit.
Validation
cargo xtask precommit: pass.cargo test -p ripr --lib python::: 1067 pass, including negative tests for each rejected shape.cargo xtask verdict-corpus check --language python: false verdicts 0/245, contradictions 0; only the two rows moved.Claim Boundary
Static abstention rule only; no runtime mutation outcome is claimed. The
patchforms this recognizes arewith patch(...)headers with one literalreturn_value; decorators,patch.object,asbindings,side_effect,autospecand other mock names keepmocked_module.Generated by Claude Code