Repository navigation
fix(python,typescript): credit a same-file assertion helper called with literals (#9636) - #9702
Conversation
|
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 33 minutes. View limit details
Comment |
…th literals (#9636) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
…aceability (#9636) Also restores a build break on main in agent/artifact.rs (undefined subject in validate_artifact_identity). Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
d59a1ce to
b4b9810
Compare
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
…prefix, reparse fallback) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
|
Review of record, head 9fb40cd (base main) Angles: (1) adversarial false-credit safety, (2) tests, spec/contract and repo gates, each as an independent reviewer on the first head; (3) a re-review of the fixes on 1411f74; the final commit is the hardening those reviews asked for.
Generated by Claude Code |
There was a problem hiding this comment.
Verification questions
- Confirm the Python route is test-file gated and recursively re-extracts only after parsing the rewritten module succeeds.
- Confirm
identifier_occurrencesis computed ints::substitutebut never used in span building — only the outerword_occurrencesdrives the span list. The wholeplaincount is effectively unused. Dead computation, not a credit bug. - Confirm the TypeScript route participates in the existing bounded expansion loop and rejects opaque or malformed rewrites before extraction retries.
- Confirm python inlining joins multi-assert helpers with
;, thenfinishkeeps total line count of original statement, sotest.body_text.lines().count() == 3test for a 2-assert helper expects 2 substituted lines + 1 def line. With;joining the rewrite is one physical line;extract_testsre-parses and line numbers of asserts are not the call's line. - Confirm typeScript helper inlining shares the suite-factory expansion rerun; interaction coverage is absent, so the combined rewrite path should be verified rather than broadened in this PR.
Refuted
- Literal substitution can syntactically fuse or corrupt assertions and turn a nominal test into a false credit.; refuted because: Signed literals are parenthesised, substitutions are UTF-8-safe, member/prefix hazards are rejected, whole-line ownership is required, and failed reparses fall back to original extraction.
- Relevant crypto/compression/runtime sibling helpers should be brought under this PR.; refuted because: The changed feature recognizes only syntactic same-file assertion wrappers. Runtime/crypto/compression behavior does not alter helper declaration uniqueness, literal-only admission, or ordinary oracle extraction, so broadening would add untested semantics rather than close this change's path.
- The rewrite may expose a stale active-view region after source mutation.; refuted because: This is a source-analysis rewrite, not a resizable buffer or view; the implementation reparses rewritten text before using it and otherwise follows the existing extraction fallback.
- The TypeScript helper route could conflict with or bypass the existing suite-factory expansion behavior.; refuted because: The new hook reuses SuiteFactoryExpansion in the same guarded rerun path; absent or invalid helper expansion does not preempt normal processing.
Evidence gaps
- Executable current-head test proof remains gated on the scheduled late cargo-test receipt.
- The strongest red/green objection lacks a post-merge automated witness in the packet, although the exact-output and negative controls address smoke-only and tautological concerns.
- Model proof intent was rejected by deterministic validation.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
…ss itself main's same-file assertion-helper pre-pass (decision 19) credits shapes the helper-inline pass refuses, so the refusal tests assert on the pass directly. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the PR claims twelve credited corpus rows, but only six Python rows and one TypeScript row are changed.
- Confirm helper inlining has one centralized implementation per language, with extraction hooks at the Python source-facts and TypeScript test-expansion entry points; no sibling runtime/crypto/compression helper path is implicated.
- Confirm the TypeScript shared expansion loop has no explicit interaction test for suite-factory expansion followed by helper inlining.
Refuted
- Byte-range replacement could leave aliased slices into the original source alive across mutation.; refuted because: Edits contain owned Strings and replace_range borrows only for each operation; no replacement borrows source text.
- The change may expose an active-view or backing-store resize/detach/transfer invariant.; refuted because: No active-view memory API is changed. Both implementations allocate and rewrite owned Rust strings using AST-derived source spans, then validate the rewritten source before recursive extraction.
- The analyzer may hand a JS-backed object or transferred memory reference across a worker/async boundary.; refuted because: The changed paths only own Rust strings and AST data. They do not invoke JavaScript, spawn workers, create GC-managed values, or expose ArrayBuffers/pointers; async callbacks are rejected.
- The helper-inline change could introduce an exploitable memory-safety or information-disclosure primitive.; refuted because: The diff adds ordinary owned Rust string processing with no unsafe blocks, raw pointers, external data, secret handling, network/process spawning, or public classification changes.
Parked follow-ups
- Related TypeScript suite-factory and named-callback extraction paths should remain parked rather than be broadened into this PR.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- The claimed twelve corpus-row movements are only partially visible in the supplied patch: six Python rows and one TypeScript row are shown.
…on 19, note helper_assertions Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
|
Review of record update, head 02078fb (merge of main 12733f9 at 126b841, then a docs-only follow-up). Angle: interaction of this PR with what main gained while it was open. An independent static reviewer read both TypeScript passes and the Python
No blockers. Not final-merge Generated by Claude Code |
…omputed argument A same-file helper called with a literal is now credited by helper_inline (RIPR-SPEC-0028); the unresolved-form check uses a shape it still refuses. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
|
Head moved 02078fb to f3a7f1a. Required CI on 02078fb failed on one test, Generated by Claude Code |
…umbered 19) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU
|
Head moved f3a7f1a to ad12d92 (merge of current main). Only conflict was RIPR-SPEC-0243, where main had since added rules 17 and 18 and decision 20, so this PR's helper rule is now Rule 19 (decision 19's pointer, the implementation-mapping line and the changelog fragment updated to match). No other review-relevant change. Reported on this head: Generated by Claude Code |
…-9636-helper-credit # Conflicts: # crates/ripr/src/analysis/language/python.rs # crates/ripr/src/analysis/language/typescript/mod.rs
…02/claude-fix-9636-helper-credit
…into convh-9702/claude-fix-9636-helper-credit
…se (merge repair of main 0285907)
Requested by Steven · project thread
Summary
check_pass(50, True)overassert passes(score) == want) now reads as the assertions that helper runs. Before, ripr reportedno_static_path/ 0 related tests and abstained although the tests catch the change.py-grid-*-helperPython rows andts-grid-returns-helper(string-literal arguments, which main's TypeScript decision-19 helper pass refuses). The other fivets-grid-*-helperrows were already credited on main by fix(ts): credit literal-table and same-file helper assertions for field updates #9717 before this PR merged main in, so this PR does not move them. This PR does not edit any ceiling.Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Proposal:
Spec: RIPR-SPEC-0028 (Helper Inlining Amendment), RIPR-SPEC-0243 rule 17
ADR:
Plan item:
Governing issue or accepted claim: #9636
Acceptance delta (one sentence): The six
py-grid-*-helperabstained rows andts-grid-returns-helpermove to credited; the other five TypeScript helper rows were already credited by #9717.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication): claude/fix-9636-helper-credit
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): n/a
Accepted winner and losing candidate disposition (when decided): n/a
Overlap with main: TypeScript
assertion_helper.rs(#9717, decision 19) runs first and expands helpers it fully understands;helper_inlineonly rewrites helpers it leaves untouched, so no helper is expanded twice. Pythonhelper_assertions(#9419/#9711) runs later on extracted tests and sees no call oncehelper_inlinehas rewritten it.Scope
python/helper_inline.rs, called fromextract_source_factsfor test files. Rewrites the file source before extraction.typescript/helper_inline.rs, called from the test extractor through the existing source-expansion path (the suite-factory precedent, no appended lines).class) helper with plain parameters and an assert-only body; a call that is a top-level statement alone on its line in a top-level test with no parameters or locals; literal arguments only (negative numbers parenthesised); parameters used only as plain values; every[/{in the asserts refused; no dynamic name binding in the file.describetests stay unknown.Scope Classification
Production delta:
python/helper_inline.rs(new) and its hook inpython/source_facts.rs;typescript/helper_inline.rs(new) and its hook intypescript/tests_extract.rs.Evidence/support delta:
helper_inline_tests.rsfor both languages: positive credit, exact rewrite text, line-number stability, and negative controls for every guard. TypeScript negatives measure the inline pass directly (test-onlyinline_rewrites()), because main's decision-19 pass now credits some of the same shapes end to end..ripr/traceability.tomlentries,changelog.d/helper-wrapped-assertion-credit.md.Single acceptance criterion:
Non-goals:
trap-*rows.Support-tier Impact
Policy Impact
Proof
On the merge of main at 12733f9 (head 02078fb; 126b841 plus a docs-only spec follow-up):
Review of record is on the PR (head 9fb40cd, plus an interaction review of the merge with main at 02078fb). The follow-up commit changes spec text, a changelog line and one doc comment only.
Result, failures, or skipped proof:
owner_return_pin_fallible_literal, dependency preparation failed offline); hosted CI owns it.Claim Boundary
Rollback
Spec-Test-Code Traceability
python/helper_inline_tests.rs,typescript/helper_inline_tests.rs, the verdict-corpus rows abovepython/helper_inline.rs,typescript/helper_inline.rsfixtures/{python,typescript}-verdict-corpus/expected/rows/*-grid-*-helper.jsonStatic 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.Gates
cargo fmt --checkcargo xtask precommitFull workspace gates are left to hosted qualification of the selected candidate.
🤖 Generated with Claude Code
https://claude.ai/code/session_01WJr6YizPnC777wfxAd9ubU