Skip to content

fix(typescript): probe the numbers an edit changed so an in-range assertion stops crediting a moved clamp bound - #10120

Merged
EffortlessSteven merged 7 commits into
mainfrom
claude/ts-fixme-clamp-9436
Oct 25, 2026
Merged

EffortlessSteven merged 7 commits into
mainfrom
claude/ts-fixme-clamp-9436

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

#9436. clampPercent(40) == 40 passes for both Math.min(100, …) and Math.min(200, …), so the rule 18 probe grid (inputs shifted by 0/±1) never reached the changed bound and the row stayed falsely exposed. separated_on_probe_grid now also tries the numeric literals the edit added or removed (c, c-1, c+1) on each numeric axis, capped at 3 constants. Constants present on both sides are not used, so operator-edit fixtures (ts_return_comparison_boundary, ts_return_ternary_boundary) are unchanged. Unevaluable expressions stay conservative.

Swarm / Source Boundary

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge, dependency, or repo-ops development for ripr-swarm

Source-of-truth Links

Spec: RIPR-SPEC-0243 rule 18
Governing issue or accepted claim: #9436
Acceptance delta (one sentence): The pw-fixme-clamp-upper-bound row no longer reads falsely exposed, and its known-false file is removed.

Scope Classification

  • One public contract

Production delta: literal_eval.rs.
Evidence/support delta: four literal_eval unit tests (traceability entries), spec paragraph, re-blessed row, deleted known-false/pw-fixme-clamp-upper-bound.toml, changelog fragment.

Single acceptance criterion: the row is credited to the gap and the corpus gate passes with its known-false file gone.

Non-goals: enum work, a general JS evaluator, Playwright registration.

Proof

cargo xtask precommit                                    # exit 0 (only the offline owner_return_pin_fallible_literal goldens gap)
cargo test -p ripr --lib typescript                      # 1757 passed
cargo xtask verdict-corpus check --language typescript   # 338 cases, false 8/338, 0 contradictions

Only the target row moved. A paired live above-bound exact assertion still earns credit (unit test).

Claim Boundary

May claim: an in-range assertion no longer credits a changed numeric bound. Not claimed: runtime adequacy.

Rollback

Revert the commit.


Generated by Claude Code

@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

@coderabbitai

coderabbitai Bot commented Oct 24, 2026 •

Copy link
Copy Markdown

Warning

Review limit reached

Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available.
You're only billed for reviews past your plan's rate limits ($0.25/file).

  • Ask an admin to enable usage-based reviews

Open in CodeRabbit

Reviews can continue after your included limit without a manual trigger. An admin must approve usage-based billing.

Next included review available in 20 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 161 included PR review attempts over the past 7 days set your current allowance at 1 review per hour.

Learn how review limits work.

Review configuration:

Run configuration
  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Essentials
  • Run ID: e30ffa47-6e3d-4500-b04f-03e24d319946
Commits

Reviewing files that changed from the base of the PR and between 6212bda and b5ec834.

Files selected for processing: 6
  • .ripr/traceability.toml
  • changelog.d/9436-typescript-unexercised-bound-probe.md
  • crates/ripr/src/analysis/language/typescript/literal_eval.rs
  • docs/specs/RIPR-SPEC-0243-typescript-oracle-and-reach-rules.md
  • fixtures/typescript-verdict-corpus/expected/rows/pw-fixme-clamp-upper-bound.json
  • fixtures/typescript-verdict-corpus/known-false/pw-fixme-clamp-upper-bound.toml
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

Comment @coderabbitai help to get the list of available commands.

… probe (#9436)

Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01XpAVUDsopEyQGsGqf371E8
@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 24, 2026 22:33
@gemini-code-assist

Copy link
Copy Markdown

Warning

You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again!

Copy link
Copy Markdown
Member Author

Review of record, head 9e7d1de (gemini and coderabbit were quota-limited, so neither reviewed).

Angles: (1) correctness / false demotion, (2) tests, spec and contract. A separate reviewer read the diff; I verified its claims against source.

Findings and resolutions:

  • Demotion needs Some(true) on every strong assertion, and a 250 assertion returns Some(false) and blocks it. Grids over the 4096 bound return false, which means no demotion. Fine.
  • Identifier digits (a1, x1.5) yield no constants. Fine.
  • Raised: x*0.1 vs x/10 could demote through ulp differences. Not a defect: same_value compares bits (literal_eval.rs:181), which matches JS doubles, so those two expressions do differ at runtime. Same exposure existed on the 0/±1 grid.
  • Raised: two tests did not exercise the new path. Fixed in 9e7d1de by adding a literal-changing equivalent rewrite (n + 2 vs n + 1 + 1) that must stay None.
  • Remaining parser quirks (negatives lose sign, 1e3→1, hex, digits inside strings, cap of 3) only miss a demotion or add probes. Conservative, left as is.

Local proof on the prior head: precommit exit 0 (only the offline owner_return_pin_fallible_literal gap), 1757 TypeScript lib tests, TS corpus 8/338 false, 0 contradictions, only the target row moved. This head adds one assertion; literal_eval tests pass (10/10). Merging once Ripr Rust Small Result is green on this head.


Generated by Claude Code

Copy link
Copy Markdown
Member Author

Required check failed on head febdc87 in one test: xtask reports::verdict_corpus::known_false::tests::committed_ceilings_equal_the_blessed_missed_credit (rust ceiling 135, blessed 134). This PR touches only the TypeScript corpus, so the failure is not from this diff. Main fails the same test (135 against 143 on current main), and fix #10140 re-measures the ceilings but is still open and counts 134, so it will drift again as Rust corpus PRs land. I'm not porting a ceiling value here. Once main is green I'll merge it in, re-apply merge-ready and re-run the check.


Generated by Claude Code

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Confirmed findings

  • The new probe grid preserves the original asserted-value neighborhood and adds changed numeric literals with their neighbors, while retaining the 4096-combination cap.

Verification questions

  • Confirm the implementation extracts decimal literals from expression text rather than using the TypeScript AST, so syntactic variants beyond the tested decimal forms are not covered by the supplied evidence.
  • Confirm the numeric literal scanner is deliberately limited to decimal literals and caps extracted constants at three, matching the documented probe boundary.
  • Confirm the modified sibling route is confined to TypeScript literal evaluation and its probe grid; no crypto/compression/runtime helper is changed or directly invoked by this diff.
  • Confirm the changed probe route is documented and linked to the four unit tests, but the broader sibling-call surface is not shown in the diff.

Refuted

  • The changed-number probe grid could depend on a stale active view or mutable backing store and therefore misclassify buffer state.; refuted because: The relevant values are parsed numeric literals and expression-evaluation results in literal_eval.rs. The diff contains no active-view construction, backing-store mutation, resize, detach, transfer, or cached length, so this active-view failure mode is not applicable.

Evidence gaps

  • The seeded thread reports local precommit, TypeScript unit, and corpus checks, but also records an unrelated Rust corpus ceiling failure; current late cargo-test receipt remains pending.
  • The PR's claimed corpus transition from credited/exposed to gap/weakly_exposed depends on the failed ripr sensor and late cargo-test receipt, which are not available as completed evidence in this packet.
  • Repository-wide and corpus proof status is not yet demonstrated by the available sensor receipts.
  • The final test and corpus-gate result is not independently established by this lane because the ripr sensor failed and cargo-test evidence was pending.
  • Model proof intent was rejected by deterministic validation.
  • Package and corpus execution proof is pending rather than established by the available lane artifacts.

Copy link
Copy Markdown
Member Author

Dependency handoff for the existing owner: accepted main 6212bdafb24fc8af153a9ab8d77568f77c882f4a now has missed-credit ceilings Rust 143 / Python 30 / Perl 23 / TypeScript 23, with Rust floor 201 retained and the equality implementation unchanged (blob a0164d05d2197ce669ac9533cab18b7b35e05bf6). #10133 introduced the numerical corrections in accepted commit 81ceacdaae1033a610e50929a31e74c229d13bf4; #10152's subsequent accepted delta is changelog-only.

Upstream qualification is retained: #10133's accepted tree 947b8b89ebee12ebb94a0367d2c01ce0af573692 exactly matches tested merge d1593f29ef4b386f22a3a6a0dac6b16990f59903; required run 40144666917 passed equality, 20,784 tests (five skipped), and all four corpus checks. This resolves the main dependency described in 6391134231, not this PR's integration or required qualification.

Please resume the already-planned owner integration from accepted main, inspect/review the actual successor head and affected behavior, and admit one supported required-qualification campaign only if none is already admitted. Retain the original literal-eval positive/negative controls, 10/10 focused-test receipt, prior TypeScript suite/corpus evidence and review dispositions in 6390382085 with their original head identities; reuse them where the relevant subject is unchanged, and refresh affected proof after integration. The reported equality failure was on older febdc874, not automatically the current b60a3da57fe8b7fdece5c36dc328a0557f34d505. At handoff the current head is unchanged, and no new required campaign was found in the current-head or running/queued readback. No validation, branch mutation, or merge was initiated by this handoff.

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Verification questions

  • Confirm the numeric-literal scanner has bounded, documented behavior but does not establish broad coverage of sibling literal evaluators or AST-based extraction routes.
  • Confirm the scanner does not recognize JavaScript negative numeric literals because the minus sign is not part of the token.

Refuted

  • The added clones/closure capture could dangle, alias mutable backing state, or create an invalid pointer lifetime.; refuted because: The captured values are owned Strings, while parsed AST values and numeric vectors are consumed within the synchronous callback. No borrowed field escapes its scope, and the unsafe-review receipt reports no new gaps.
  • The corpus fixture update could merely bless a false gap without an oracle that distinguishes credit from non-discrimination.; refuted because: The row changes observed_verdict credited to gap and classification exposed to weakly_exposed, while the production route adds probe inputs derived from changed numeric literals. The known-false declaration is deleted because the fixture now exercises the intended gap.
  • Expanded probe grids could enable denial of service through excessive evaluation.; refuted because: The implementation explicitly caps extracted constants at three per side and total combinations at 4096; no unbounded loop or allocation path is present in the changed surface.
  • Moving old_text and new_text into parse_on_worker could leave the callback with invalid references or leak ownership across the worker boundary.; refuted because: The two values are independent owned Strings moved into the callback closure; the callback uses them before the closure returns, and no borrowed reference to either String escapes. Parsed expression lifetimes remain within the existing callback scope.
  • The new numeric probes can alter operator-only edits into an unexercised finding.; refuted because: The added constants are derived from numbers present on only one side of the edit; an operator-only edit introduces no changed literal, so it continues through the existing boundary-witness path.
  • The probe grid could misclassify because it observes a stale active view or mutable backing store.; refuted because: The modified path works on owned expression strings and parsed expression values; no ArrayBuffer, TypedArray, resize, detach, transfer, slice-length snapshot, or mutable backing-store state is introduced.

Evidence gaps

  • Corpus acceptance is not independently confirmed in the available packet because ripr failed and cargo-test is still scheduled.
  • The focused and corpus proof is asserted in the PR body but remains pending or unavailable in this packet.
  • Full compile/test behavior is not yet witnessed in the supplied receipts: ripr failed with exit code 2 and cargo-test is scheduled late.
  • Model proof intent was rejected by deterministic validation.

Copy link
Copy Markdown
Member Author

Review of record, currency note for head b5ec834. The review above covered 9e7d1de; since then the branch only gained merges of main (no code changes by me). Affected proof refreshed on this head: ceiling test passes on accepted main, TS corpus 8/351 false with 0 contradictions, check-spec-format passes, and the required run on b5ec834 is green (Rust gates and Ripr Rust Small Result). The two github-actions reviews raised only verification questions with no blocking findings, and there are no open review threads. Merging.


Generated by Claude Code

@EffortlessSteven
EffortlessSteven merged commit 66b228f into main Oct 25, 2026
51 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/ts-fixme-clamp-9436 branch October 25, 2026 02:03
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants