Repository navigation
fix(python): see through coroutine runners and read comprehension filters as boundaries (#9414) - #9600
Conversation
…ters as boundaries (#9414) asyncio.run, anyio.run, trio.run and loop.run_until_complete return the awaited result, so they no longer hide an owner call from a strong exact assertion (matched on the whole callee; a bare run() stays opaque). Making them transparent exposed a latent false exposed: a changed comprehension filter (sum(p for p in prices if p > 1)) was a return-value probe, credited by any exact oracle. It is now a predicate boundary, observed only when a test passes a literal list holding an element at the bound. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVJ2F1oh39juHJ8AZR5fS3
The case now credits: asyncio.run is a transparent wrapper, so the exact assertion on the awaited default is seen. 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 26 minutes. View limit details
Comment |
|
Review of record, head a413a32. Self-review from four angles; hosted providers are rate-limited, so they are missing, not clean.
No blocking findings in this diff. Required check pending. Generated by Claude Code |
…nging (#9414) Review found three holes in the comprehension-element rule: a parametrized list argument was never expanded into elements, an edit to the yielded element under an unchanged filter was asked for an input at the bound, and a filter with a further guard (`p > 1 and False`) was read as one comparison. Parametrize cases now carry their list elements, the predicate shape applies only when the filter differs from the old line, and the comparison must be the whole clause. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UVJ2F1oh39juHJ8AZR5fS3
|
Review of record, head 7d43c47 (supersedes the a413a32 note). Devin found three real defects my first self-review missed, plus one note:
Python corpus: no row moves beyond the two already described; the four Generated by Claude Code |
|
Correction to my earlier read: the first red Generated by Claude Code |
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm the implementation relies on heuristic lexical parsing rather than a Python AST, so unsupported syntax can silently fall back to opaque behavior or be parsed incorrectly.
Refuted
- The new element/argument handling could rely on mutable or resizable backing-store views and stale length snapshots.; refuted because: Reviewed changed code: values are Rust-owned Strings/BTreeMaps/Vectors, and filter iteration consumes the current collected Vec. There is no JS buffer, unsafe slice, shared mutable view, resize, detach, or transfer path.
- The prior unchanged-filter, extra-guard, and parametrized-list findings remain material.; refuted because: The current diff contains targeted source restrictions plus regression tests for all three: unchanged predicates retain ReturnValue, compound clauses remain ReturnValue, and parametrized list elements participate in boundary resolution.
Parked follow-ups
- Custom objects with run_until_complete can still invalidate the runner-transparency assumption.
- Transparent runner matching may over-credit an arbitrary custom receiver named run_until_complete.
- The broad receiver-based run_until_complete policy can classify a custom receiver as transparent, but seeded discussion explicitly accepted this tradeoff to preserve loop.run_until_complete spellings.
- Runner matching is conservative for bare and unrelated receivers but intentionally broad for method-based run_until_complete.
- Comprehension recognition is intentionally limited to simple identifiers, literal scalar elements, and exactly one relational clause.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
|
The Fix: merged main into the branch (clean, no conflicts) and pushed c68b456. On that head Generated by Claude Code |
There was a problem hiding this comment.
Refuted
- Could CallRow.elements alias state across rows and yield dangling references?; refuted because: Elements map is a freshly owned BTreeMap<String, Vec> constructed per row in bind_call_arguments and cloned into parametrize_case_row; bindings/elements never share &str references into source text. No borrows escape the local function scope.
- Parametrized list elements could be exposed through a mutable or resizable backing-store view.; refuted because: Each list, tuple, or set display is parsed into owned Strings and collected into an owned Vec before CallRow use; subsequent parametrize handling clones that Vec and iterates the clone.
- Parametrized list inputs bypass filter evidence and create false exact-oracle credit.; refuted because: The diff adds literal element extraction for direct and parametrized arguments, and tests assert hit and off-bound parametrized cases produce exposed and weakly_exposed respectively.
- Prior parametrized-list, unchanged-filter, and extra-guard oracle holes remain open.; refuted because: The current diff contains focused controls for each and routes all three away from the incorrect verdict path; this lane found no remaining oracle gap there.
- New list-element storage could expose a UAF or OOB through mutable/resizable backing-store views.; refuted because: Values are copied into owned Rust Strings, BTreeMaps, and Vecs; iteration consumes the current collected Vec and no slice, pointer, resize, detach, or transfer path is present.
Parked follow-ups
- Python comprehension-filter recognition is intentionally conservative but lexical; unusual syntax without covered regression cases may receive the fallback ReturnValue treatment rather than a dedicated proof.
- Corpus truth is updated to credited, but the expected row is static expected output and does not itself establish the mutant-red/original-green oracle pair.
- Runner transparency is recognized for asyncio/anyio/trio.run and any dotted run_until_complete receiver, but arbitrary custom receivers can still return unrelated values.
- The broad run_until_complete receiver match intentionally admits custom receivers, so runner transparency is heuristic rather than universally sound.
- Filter-boundary handling covers direct list/tuple/set displays and pytest parametrized lists, while computed or nested elements deliberately fall back to unresolved behavior.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
Summary
asyncio.run,anyio.run,trio.runand<receiver>.run_until_completeare transparent wrappers: they return the awaited result, so a strong exact assertion onasyncio.run(owner(..))is credited instead of reading as not observing the owner. Matching is on the whole callee; a barerun(..)ortask.run(..)stays opaque.sum(p for p in prices if p > 1)) was a return-value probe, credited by any exact oracle. It is now a predicate boundary. The rule isexposedonly when a strong test passes a literal list/tuple/set whose element meets the bound; otherwise it fails closed toweakly_exposed. A clause with several comparisons, a computed operand or a non-name iterable stays a return-value probe.py-shapes-async-defaultmoves gap to credited (correct; the test fails under the mutant), andpy-shapes-async-filter-boundarystays gap (correct; no element hits the bound). False verdicts on the Python corpus improve by one.py-shapes-async-defaultleaves theknown_falseledger.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Spec: RIPR-SPEC-0238 (Python preview verdict behavior); boundary activation per RIPR-SPEC-0028
Governing issue or accepted claim: #9414 (parent #9412)
Acceptance delta (one sentence): An
asyncio.run-driven exact assertion credits the owner it awaits, and a changed comprehension filter is credited only when a test input meets its bound.Verification
cargo xtask precommitpasses.run(..),task.run(..)) staying opaque, and which comprehension filters become predicate lines.cargo xtask verdict-corpus check --language pythonmoves exactly the two rows named above on this change.py-grid-*false verdicts from test(corpus): Python operator grid, arithmetic/constant/delete/returns #9508 (py-grid-arithmetic-property,py-grid-arithmetic-table,py-grid-delete-helper,py-grid-returns-property); they are untouched by this PR.Generated by Claude Code