Repository navigation
fix(typescript): property-style tests no longer read exposed (ts-grid arithmetic and returns) - #9539
Conversation
…nd owner-only relations (#9515) Rule 2: a changed binary operator whose right operand is its identity in every tested call is not pinned. Rule 3: an assertion that compares one owner call with another holds for any constant. The grid arithmetic-property case now tests the post-image (scaled(1, u)), since the earlier mutants were taken from the pre-image and the node run showed them killed. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8
|
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 42 minutes. View limit details
Comment |
There was a problem hiding this comment.
Confirmed findings
- Re-pinned sha adfdbec7 in authored-ts-grid-arithmetic.json matches the new test/arithmetic.test.ts content; expected rows flip both ts-grid-arithmetic-property and ts-grid-returns-property from false_exposed/credited to ideal/gap. The changed_since_labeling flag moves to true in both rows, which is what the corpus re-bless expects. No public surface issue, but a manual spot-check of the sha in the subject JSON and the row flips in CI is recommended given the fipr sensor itself failed (exit 2) before the post-fix bless was applied.
Verification questions
- Confirm every TypeScriptAssertion struct literal in tests.rs and tests/value_hiding_tests.rs now sets dynamic_expected_text: None; the field is not unsafe and does not require an initializer for memory safety, only for test parity.
- Confirm oracle.rs now sets TypeScriptAssertion.dynamic_expected_text in 4 sites: expect_assertion_from_expression, ava_assertion_from_expression, assert_call_assertion, chai_expect_assertion_from_expression. No legacy TypeScriptAssertion constructor in tests.rs or other siblings was missed; value_hiding_tests.rs builds assertions via analyze_diff, not by hand.
- Confirm no JS-backed worker/async/GC/detach/transfer surface is touched by this PR. Diff is pure Rust analyzer logic plus fixture/text re-pins. Nothing to verify under the ub-worker-handoff lane.
- Confirm siblings of the new pattern: ts_dropped_additive_term and ts_dropped_term_witness still own the additive-term path, and the new value_hiding_guard module does not export through the public surface beyond ts_neutral_operand_change. value_hiding_tests reuses ts_unique_tempdir, ts_write_file, ts_analysis_options which exist in the existing tests module; no new public entry point is added. PR does not claim coverage of one-hop-local idempotence, the multiplicative identity from rule 1, or the delete trio (#9515 other thread).
- Confirm subject test was re-flipped from scaled(qty,1)=qty to scaled(1,unit)=unit; the property loop now exercises qty fixed at 1 (the identity). This is exactly the rule-2 pinned shape, so the corpus row flipping to gap is consistent with the spec amendment.
Refuted
- ts_observed_owner_call_arguments and ts_whole_owner_call_arguments might hold substrings of a backing buffer that could be detached or resized, leaving a stale active view of the test source.; refuted because: The argument text is captured into TypeScriptAssertion::dynamic_expected_text: Option at oracle construction time (see oracle.rs:1125-1127 and 1195-1203). String values are owned, grow on demand, and are not aliased to a resizable or detachable view. The ts_neutral_operand_change parser also returns owned String. There is no resizable buffer in the TypeScript analyzer path: the test source is read once and the assertions hold owned Strings. Allocation failure would not silently return a stale view; it would surface as a Rust panic or omit the dynamic_expected_text, and rule 3's
Some(...)branch would then fall through. This is a false-premise concern. - TypeScriptAssertion::dynamic_expected_text (Option) could carry a reference into the JS/TS source arena whose lifetime ends before the assertion is consumed, causing use-after-free in a worker thread that holds the assertion across the arena drop.; refuted because: dynamic_argument_text in oracle.rs returns source_text_for_argument(arg, source) and binds it as Option via .and_then(...). The returned value is an owned String copied out of the source slice; no &str/&[u8] borrow with a lifetime tied to the parser arena is stored. There is also no worker boundary in this codebase that retains the assertion past arena teardown.
- Adding Option to TypeScriptAssertion doubles per-assertion allocation cost and could leak via early-return paths in classifier; refuted because: String is owned and dropped with the assertion; classifier paths return verdict.missing: Vec already, and the assertion lives only inside the candidate scope. Drop ordering is standard; no manual drop, no leak. No allocation-failure object inserted into the diff (no Box::from, no Vec::from_raw_parts, no Cow), so the standard allocation-failure OOM convention is not engaged here.
Evidence gaps
- PR body claims 'TS false verdicts 22/264 → 20/264 on the pre-rebase tree'. The
riprsensor exited 2 (failed) per the sensor table, so the receipt that would carry this number is not trustworthy as published. The post-rebase count is also not in evidence. Without a cleancargo xtask verdict-corpus check --language typescriptreceipt, the only artifact in-tree that confirms the two target rows is the expected-rows JSON diff and the changelog wording. The expected rows are pinned, so a future re-bless would be needed to drift them; the bless hash onarithmetic.test.tsis updated (897b...→adfd...) and that is the file content the corpus uses. - Model proof intent was rejected by deterministic validation.
Parked follow-ups
- Author's claim boundary holds: only exposed -> weakly_exposed for two grid rows; no other TypeScript row should move. Active-view is silent because no view/buffer is involved.
…nd every owner call is accounted for (#9515) Review round 1: rule 2 now requires the changed line to rewrite a commutative operator's operands in place, and both rules keep credit when an owner call sits outside a recognised value assertion or a weak matcher names the owner. Also: displaced doc comment, spec wording, traceability entries. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8
Review of recordCode head reviewed:
Resolutions:
Local: Generated by Claude Code |
There was a problem hiding this comment.
Reporter summary
All specialist lanes failed preflight, so this verdict leans on the seeded PR thread, the diff, and the post-lane late evidence (cargo-test timed out at 900s, ripr sensor failed with exit 2). The strongest concrete objection is the string-concatenation false-demotion for rule 2: ts_neutral_operand_change in value_hiding_guard.rs and the new post-ladder branch in classifier.rs admit + reversal on identifier operands, but JS/TS + is concatenation, not commutative addition when one side is or coerces to a string, so return base + tip; vs return tip + base; can produce different strings even with tip = 0; no string-typed test pins this, and the rule is type-blind. A secondary concern raised by opposition is IEEE-754/coercion edge cases (NaN, -0, infinity) under the same right-operand identity check, also untested. Until rule 2 is bounded against string (and ideally mixed/coerced) operands by code or a regression test, and a passing test witness lands (cargo-test needs to complete under a longer lease and ripr needs to run clean), this PR is not safe to merge.
… on nested owner calls (#9515) Devin Review: '+' concatenates strings so its reorder and zero operand prove nothing, and scaled(1, scaled(3, 4)) has an inner call the reader never checks. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8
…se (#9515) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8
…nal semicolon (#9571) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8
…d from #9591 and #9588) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8
There was a problem hiding this comment.
Confirmed findings
- fixtures/typescript-verdict-corpus/spec-coverage.toml:831 — PR body asserts 'No [[known_false]] entries existed to remove' but this diff removes the two ts-grid-arithmetic-property / ts-grid-returns-property known_false blocks for #9515. Update the claim to reflect that the two rows were removed, since that is the entry condition for the corpus re-bless.
- Rule 2's identity operand is bounded to right operand only; the spec mentions IEEE-754/NaN/0 coercion as out-of-scope but no test asserts e.g. expect(scaled(0, 0)).toBe(0) under the new rule. A focused unit test would close the residual coercion gap without changing the rule.
Verification questions
- Confirm crates/ripr/src/analysis/language/typescript/tests/value_hiding_tests.rs:6 — The implementation adds five focused tests and re-blesses two corpus rows, but this packet contains no passing cargo-test or corpus-check receipt for the reviewed head; ripr exited 2. Do not treat the advisory sensors as proof that the new analyzer behavior and fixture pins execute successfully.
- Confirm the corpus SHA and changed expectation rows are internally consistent with the edited TypeScript test.
- Confirm value_hiding_guard.rs is a new sibling to dropped_term_guard.rs; both expose *Change structs consumed by ts_apply_post_ladder_rules. No shared operator-shape helper exists across guards.
- Confirm no successful compile witness confirms every TypeScriptAssertion construction initializes and populates dynamic_expected_text consistently.
Refuted
- Putting ts_neutral_operand_change / ts_operands_rewritten_in_place in a brand-new module is over-decomposition; they could live in classifier.rs as private fns alongside ts_dropped_additive_term.; refuted because: A dedicated value_hiding_guard.rs matches the existing decomposition (dropped_term_guard.rs, mock_payload_guard.rs) and keeps the new shape recognizer next to its spec rule. No new public surface, no new dependency.
- Adding Option dynamic_expected_text could extend a buffer lifetime across a worker thread or async task boundary and cause a UAF or detached use-after-free on the analyzer hot path.; refuted because: The diff is purely a TS analyzer library: no thread::spawn, async fn, channel, FFI, or JS/Rust bridge is added or modified. The new field is Option populated synchronously from a borrowed source slice inside the same analyze_diff call. There is no cross-runtime or cross-thread ownership transfer introduced.
- Rule 2 could be used as an oracle-confusion primitive to suppress exposed verdicts and hide a malicious arithmetic edit in adversarial CI of a downstream project; refuted because: The rule only moves exposed to weakly_exposed, never the other direction. It does not add credit and is bounded by an in-place commutative rewrite plus a whole-result value assertion plus a numeric identity literal. Worse case for an attacker is a false 'weakly_exposed' label, which is a demotion, not concealment. Tests pin the demotion direction.
Evidence gaps
- The claim is intentionally limited to two property rows, but the current packet lacks a clean deterministic witness.
- The updated Node fixture is tied to the post-image and supplies mutation evidence that the property test kills addition but not division by qty.
- Model proof intent was rejected by deterministic validation.
|
Review of record, head fdd1841 (main 969b0b8 merged in; no source change since ccedbad). Angles: correctness/edge cases (rule 2 requires an in-place Findings: earlier F1/F2 (unaccounted calls), Resolution of this push: removed none beyond my own two Generated by Claude Code |
There was a problem hiding this comment.
Confirmed findings
- fixtures/typescript-verdict-corpus/spec-coverage.toml:807 — PR body claim 'No [[known_false]] entries existed to remove' contradicts the diff which deletes two [[known_false]] blocks for #9515 (ts-grid-arithmetic-property, ts-grid-returns-property). Update the PR Summary so the entry condition for the corpus re-bless is not misstated.
Verification questions
- Confirm crates/ripr/src/analysis/language/typescript/classifier.rs:6037 — The analyzer and re-blessed corpus rows have no passing witness in this packet.
riprexited 2 and the seeded reporter records cargo-test timing out, so compilation, rule behavior, SHA consistency, and the claim that only two rows move are not established for the reviewed head. - Confirm public API surface change is a NEW post-ladder branch in ts_apply_post_ladder_rules for ProbeFamily::ReturnValue (rule 2) and ReturnValue|FieldConstruction (rule 3); no exported function signatures change. dynamic_expected_text is a new public-field on the crate-internal TypeScriptAssertion.
- Confirm rule 2 spec wording claims 'Only
*and/are read:+also concatenates strings, so neither its operand order nor a zero operand shows that a test cannot tell the edit apart.' Code in ts_operands_rewritten_in_place additionally requires new_op == '*' (so/swap-in-place is never read), and the spec example 11 only covers* -> *. Aqty / unitbecomingunit / qtyedit (the diff's own subject test mutant) is not read by rule 2. This is consistent with the listed known limit ('Rule 2 reads one operator between two operands') but the spec paragraph could read as if/is in scope; verify spec wording matches implementation narrowing.
Refuted
- Adding dynamic_expected_text as Option<&'a str> would tie the assertion lifetime to the oxc source borrow and risk use-after-free when assertions are stored past analyze_diff; refuted because: The diff uses Option (owned), confirmed in types.rs:552 and oracle.rs:2004; no lifetime parameter is added to TypeScriptAssertion.
- Adding dynamic expected-expression state would require a broad public API migration.; refuted because: The field and helper are crate-private, and the changed construction sites and tests are internally consistent.
- No sibling paths need further action.; refuted because: That absolute claim is unsupported; only the listed analyzer/oracle/fixture surfaces were checked. The duplicated guarded parser is explicitly parked, while unscanned sibling variants remain a coverage limitation.
- ts_neutral_operand_hides or ts_assertions_only_relate_owner_calls hold borrowed slices across a worker handoff (postMessage/transfer) such that the receiving worker observes a freed backing buffer or partial clone.; refuted because: Neither function crosses any worker or async boundary; both consume &TsPostLadderContext and &TypeScriptAssertion/&TypeScriptTest by reference within the same call stack. They produce only owned values (usize, bool, String) and return synchronously. The JS worker handoff in this crate is at the
cargo xtask/verdict-corpusprocess boundary, not inside the analyzer. - PR body 'No [[known_false]] entries existed to remove' is contradicted by spec-coverage.toml diff which removes the two ts-grid-arithmetic-property and ts-grid-returns-property [[known_false]] blocks for #9515. Author's own review comment from a prior round acknowledged this. Claim boundary text is stale.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- Execution evidence is absent for this packet: ripr failed with exit 2, and the seeded reporter says cargo-test timed out; advisory sensors do not prove analyzer behavior or fixture pins.
- Executable proof for the reviewed head is still absent from the supplied sensor evidence.
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8
There was a problem hiding this comment.
Decision
- Needs one verification check before upstream.
Verification questions
- Confirm no passing witness in this packet: ripr sensor exited 2 and cargo-test timed out at 900s per seeded reporter. Source-route claims (4 oracle.rs sites, 24 TypeScriptAssertion inits, two new post-ladder branches, 3 new module-level helpers, spec amendment, sha re-pin, two row flips) are not compiled-verified for the reviewed head.
Refuted
- Allocation failure on dynamic_argument_text cloning a long matcher argument into dynamic_expected_text could silently truncate or unwrap.; refuted because: The path is
argument.and_then(\|arg\| source_text_for_argument(arg, source))returningOption<String>; cloning here is a normal heap allocation that either succeeds or aborts the process (no graceful path), and the value is at most the size of one parsed Argument span, not the whole file. There is no in-scope allocation-failure analysis here because no Box::from(slice) / Box::from_raw / Vec::with_capacity pattern is introduced in this diff. - Added TypeScriptAssertion::dynamic_expected_text and the dynamic_argument_text helper could introduce an active-view/buffer UB path (stale slice, detach, transfer).; refuted because: The helper to_string()'s the borrowed &str into an owned String at oracle construction; no slice/buffer backing the field, no resizable region touched. Field is plain Option stored in a heap-allocated struct, with no aliasing and no length snapshot exposed. Outside this lane's domain.
- dynamic_expected_text is an owned String, not a borrow. The seeded github-actions comment questioning whether it requires an initializer for memory safety is a false premise: Option defaults to None and the field carries owned bytes, not a reference into the parser buffer.
- Allocation failure of source_text_for_argument (Box-from-slice style) could leave dynamic_expected_text as None and silently demote a finding via a non-rule path.; refuted because: TypeScriptAssertion.dynamic_expected_text is only consumed by ts_assertions_only_relate_owner_calls, which returns false (keeps credit) when the field is None. A None from allocation failure is the same as a literal/None dynamic argument under the current oracle sites (dynamic_argument_text is called only when has_dynamic_matcher_arg is true). There is no path where a None dynamic_expected_text causes a hidden demotion; rule 3 is opt-in by the field being Some, so an OOM in the String allocation degrades to the prior behavior. No new UB exposure introduced.
Parked follow-ups
- ts_neutral_operand_change and operands() in value_hiding_guard.rs duplicate the masked/identifier parsing already used by ts_dropped_additive_term in dropped_term_guard.rs; de-dup is a parked follow-up, not a regression.
- The classifier can conservatively retain exposure credit for unresolved or malformed expressions, but this is a correctness residual, not a security vulnerability.
- Other post-ladder families (SideEffect, ErrorOracle, MockExpectation) were not re-scanned for analogous relational or identity operands; if rule 2/3 shape recurs there, a sibling rule could be missing. Out of scope for this PR but worth a parked note.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- No live witness exists for this head: ripr sensor exit 2 and cargo-test timed out at 900s; the strongest concrete objection from the reporter cannot be refuted without re-running them.
EffortlessSteven
left a comment
There was a problem hiding this comment.
Disposition: REVIEW_INCOMPLETE for integration; no blocking finding from this bounded independent property-row source/CLI/runtime pass.
Refreshed exact head: fdaf8c39890180f0acc1034ab508e58847fd11ba, unchanged from the independently executed candidate. Inspected value_hiding_guard.rs, rule 2/rule 3 in classifier.rs and their caller, owner-call accounting, nested-call refusal, stable-parameter checks, dynamic expected-expression extraction/DTO construction, tests, SPEC-0248, traceability, fixture source/test pins, expected rows and the two known_false removals.
Observed focused results (Rust 1.95.0 default-feature CLI; Node 24.19.0):
| Case/control | Analyzer result | Runtime challenge |
|---|---|---|
| Revised arithmetic property | weakly_exposed |
post-image passes; unit + qty fails; unit / qty survives |
| Return idempotence property | weakly_exposed |
post-image and both constant-return mutants pass |
Add independent assert.equal(scaled(3, 7), 21) |
exposed |
post-image passes; division mutant fails |
Add independent assert.equal(normalize(" a "), "a") |
exposed |
post-image passes; empty-constant mutant fails |
Each target check has one anchored finding and exits 0. Seven selected corpus-row checks on this exact head also keep all five delete rows weak, consistent with this PR's boundary. The independent pins challenge false demotion through the real extractor/CLI rather than merely asserting the new helper's implementation.
The original main arithmetic fixture had a post-image truth mismatch: after qty * unit is rewritten to unit * qty, the old test with scaled(qty, 1) kills unit / qty. Its recorded surviving mutant qty / unit came from the pre-image. I reproduced that failure, then independently reproduced the revised fixture's surviving post-image division mutant with scaled(1, unit). This supports the concrete test/mutant alignment correction; it is not a blanket confirmation of the old row's false-exposed label.
Proof identity: CLI SHA256 2a968f15dfeec0c04f8ba184ff22931497d3d60ac6f81242ef13643408dd84f1; clean source fdaf8c39890180f0acc1034ab508e58847fd11ba. Current main was additionally source-inspected at 180b567e1699ac102b7098a89a23e5cbd57d7dd3; no combined main/PR tree was executed.
Limits: these are focused correctness and oracle controls, not fresh library-suite/precommit/full-verdict-corpus/goldens evidence and not full combined qualification or a merge clearance. The PR-body reported passes retain their own identities. Hosted required checks, current review threads/Conversation findings and integration effects still need their native qualification/final review. This pass does not resolve #9534 helper/table work, the newly confirmed #9548 field-update false promotions, or documented one-hop-local/inverse-pair follow-ups. Existing source ownership remains unchanged.
Requested by Steven · project thread
Summary
exposedrows from the TS grid (test(corpus): TypeScript operator grid, arithmetic constant delete returns #9502) now readweakly_exposedthrough two post-ladder rules (RIPR-SPEC-0248 rules 2 and 3).return unit * qtytested only with the identity (1) for the right operand (scaled(1, u)) cannot tell*from/. Only an in-place*operand reorder is read (+also concatenates strings, and/is not commutative; fix(typescript): widen identity-operand guard and keep credit on unreadable owner mentions #9579 widens to the inverse pair). Every owner call must sit in a whole-result value assertion; a nested owner call keeps the credit.normalize(normalize(t))againstnormalize(t)holds for any constant return, so an assertion made only of owner calls keeps no credit.ts-grid-arithmetic-propertywas mislabeled for its post-image: the old mutants (qty / unit) came from the pre-image, and a node run showsunit / qtyis killed by the old test. The subject test now callsscaled(1, unit)and the mutants are the post-image's (unit + qtykilled,unit / qtysurvives, both run with node 22).Source-of-truth Links
Spec: RIPR-SPEC-0248 (amended)
Governing issue or accepted claim: #9515
Acceptance delta (one sentence): The two property-test grid rows read
gapinstead of falseexposed, with no other TypeScript row moving.Scope
value_hiding_guard.rs, two evaluators inclassifier.rs, andTypeScriptAssertion::dynamic_expected_text(the dynamic matcher argument as written).[[known_false]]entries (typescript: five operator-grid corpus rows are false verdicts (delete trio false actionable, arithmetic/returns property false exposed) #9515); other PRs' drift was reconciled by chore(corpus): reconcile all known_false drift on main (#9430) #9588.Scope Classification
exposedtoweakly_exposed)Proof
Claim Boundary
May claim: those two shapes no longer earn exposed credit. Must not claim the delete trio (#9515, other thread) or one-hop-local idempotence spellings are covered (listed as known limits in the spec; follow-ups in #9571).
Rollback
Revert the commit.
🤖 Generated with Claude Code
https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8