Repository navigation
fix(typescript): name a changed clause only for a single-token in-place substitution (#11442) - #11710
Conversation
…mpound conditions (#11196) The requested clause-level discriminator already ships (#10399): a compound &&/||/?? condition names the one comparison leaf whose tokens changed. Add the discriminating negative matrix (reorder, removed clause, moved parenthesis, operator swap, non-comparison edit, quoted/template clause, non-simple and nullish operands) and document in RIPR-SPEC-0027 that a named clause is not claimed to be independently steerable. No production change. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
…1196' into claude/ts-clause-single-token-11442
…ce substitution (#11442) Two changed tokens in one clause and an added comparison clause now keep the predicate-boundary refusal instead of starting a repair whose example cannot discriminate. Operand-deletion pins move to refusals. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
|
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 46 minutes. View limit details
|
Resolve boundary_label_tests.rs and RIPR-SPEC-0027 conflicts; refuse token-identical edits before the returned-ternary fallback; traceability and spec updates. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the end-to-end negative test claims to prove that no repair starts, but
repair_packet_readyis already false for TypeScript preview findings regardless of boundary selection. - Confirm the added-clause fixture does not test the claim that an added clause cannot be reached past an untouched prior clause; it only checks that no comparison is named.
- Confirm typeScript single-token selection has a production-path negative for the two-token and added-clause regressions.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- Execution evidence for the changed Rust tests is not complete in the review packet.
- The available receipt set does not include completion of cargo-test, and this lane did not enumerate all callers of selected_text or all boundary-site construction paths; a broad sibling-path proof remains useful.
- The PR's claimed test execution and policy-gate status are not independently established in this lane because the scheduled cargo-test receipt is absent and ripr failed.
- Executable validation evidence is incomplete: ripr failed, cargo-test has no receipt, and xtask/mutation replay are explicitly unestablished.
- The added end-to-end test module is feature-gated and registered as a Rust test module, but the exact-head cargo-test completion receipt is unavailable.
…ngle-token clause naming (#11442) The isReady edit changes two tokens (operator and literal), so it now names no clause boundary. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
|
Review of record at head Angles: correctness, tests, spec/contract, perf/security. This is a source review of the full diff (9 files). I did not run any code.
Findings: none blocking. Non-blocking: the golden diff and its CHANGELOG entry look hand-edited rather than blessed by the harness, so the hosted Review threads: none. Proof is the hosted exact-head Result. Generated by Claude Code |
…ause naming (#11442) The re-blessed typescript_jest_vitest_assertion_facts finding for isReady is now missing_target_shape (a two-token edit names no clause boundary), so the smoke-only corpus cases expect that actionability and its wording. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
…t_shape finding (#11442) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
|
|
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
…merging main (#11442) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm the negative app tests bundle three signals, but packet_ready and exposed are false independently of boundary selection; therefore only absence of a named comparison demonstrates the intended regression behavior.
- Confirm the production check-path tests distinguish named comparison discriminators from ordinary TypeScript preview non-actionability, so their negative packet assertions do not prove the boundary rule alone.
Refuted
- No JavaScript runtime, worker handoff, async task, GC, detach, or transferable-object boundary is introduced or modified by this PR.
Evidence gaps
- Model proof intent was rejected by deterministic validation.
- Executable completion evidence for the changed Rust tests remains absent in this review packet; ripr failed and the cargo-test receipt was not available to this lane.
- Exact-head Rust test execution is still unestablished in the review packet because cargo-test has no receipt and ripr failed; the PR body reports prior local runs but not an independent packet receipt for the final head.
- The packet lacks completed execution evidence for the changed Rust tests: ripr failed and the scheduled cargo-test receipt is absent.
There was a problem hiding this comment.
Independent review (fresh-context reviewer, head 12a9298): REPAIR_REQUIRED
Inspected:
crates/ripr/src/analysis/language/typescript/boundary_selection.rs— the rewrittenselected_text(the diff removesoperand_delimiterand the prefix/suffix edit-envelope filter, and replaces them with a changed-index computation plus a same-site-in-the-old-line requirement).docs/specs/RIPR-SPEC-0027-typescript-preview-static-facts.md:504-513(the rule this PR adds).crates/ripr/src/analysis/language/typescript/boundary_label_tests.rsandcrates/ripr/src/app/tests/typescript_clause_single_token_packets.rs(the new tests),.ripr/traceability.toml:3574-3589(nine new entries),changelog.d/typescript-single-token-clause-11442.md.- The golden re-bless:
fixtures/typescript_jest_vitest_assertion_facts/expected/check.json(+13/-25),expected/CHANGELOG.md(+24/-0), andexpected/human.txt(not in the PR) — the last read at both head and base and compared byte-for-byte. - The two corpus expectation files the PR updates:
fixtures/typescript-preview-false-actionable-audit/corpus.jsonandfixtures/typescript-preview-repair-loop/corpus.json. crates/ripr/src/output/preview_actionability.rs(the actionability projection the golden's category change flows through), and the classification gatefixtures/typescript-verdict-corpus/expected/.- Hosted evidence for this exact head: run
41243283685"Merge-ready request 12a9298", its Rust gates job124663492545(log lines 2365-2382), and main's own Rust gates job124667151683atfa621a32for comparison.
Blocking:
- The required Rust gates lane is red at this head because
fixtures/typescript-verdict-corpus/expectedwas not re-blessed, and the drift is attributable to this PR. Thecargo xtask verdict-corpus check-allstep in job124663492545fails with exit code 1 and reports fifteen drifted TypeScript corpus cases. Eight of them move the observed verdict, not just the row text:jest-discount-boundary-pinned,jest-mined-tobeinstanceof-bound-local,mocha-bonus-boundary-pinned,mocha-limit-async-await,nodetest-tier-boundary-pinned,ts-grid-boundary-helper,ts-nodetest-shipping-threshold,ts-vitest-bulk-threshold— each reported as "verdict moved; changed since labeling (line 11: expected"observed_verdict": "credited", got"observed_verdict": "gap")".- The other seven (
jest-mined-tobeinstanceof,jest-spec0249-ex05-wrapped-pin,jest-tier-test-each-table,ts-grid-boundary-exact,ts-grid-boundary-table,ts-nodetest-silver-legacy-assert,vitest-orders-tier-each-boundary-pinned) report "row moved" at the same line.
Attribution is direct, not inferred from a missing base lane: (a) the base commitc8effc97has no comparable routed run of its own (every run recorded against that SHA is a push-to-main run, mostcancelled), but main's tipfa621a32is comparable and its Rust gates job124667151683reportsVERDICT_CORPUS_RESULT: successandGOLDENS_RESULT: success— so the corpus is green on main and this lane is red only on this candidate; (b)crates/ripr/src/analysis/language/typescript/boundary_selection.rsis byte-identical betweenc8effc97and main's tipfa621a32(git diff --statis empty), so main did not move the clause-naming code and the drift cannot be main drift in that file; (c) the PR's own re-blessed golden demonstrates the exact mechanism — theisReadyeditcount > 0→count >= 1changes two tokens, socount == 1is no longer named,missing_discriminatorbecomesnull, and the finding reclassifies fromincomplete_repair_packettomissing_target_shape. That is the same narrowing that moved these eight cases fromcreditedtogap.
The gate states its own remediation, quoted from the job log: "If the change is intended, re-blessfixtures/typescript-verdict-corpus/expected(cargo xtask verdict-corpus bless --language typescript) and state why each moved row changed in the PR." Neither half was done: the corpus is untouched by this PR, and the PR body does not mention any moved row. The golden re-bless that was performed is correct — thegoldensstep passed before the corpus step failed — so the fix is scoped to the verdict corpus plus the required per-row rationale in the PR body.
- The PR body's blast-radius reasoning is contradicted by the corpus evidence, and it presents a real capability cost as free. The "Evidence gaps" section argues: "The 178-mutation replay was not re-run (inputs no longer present). The new selection is a strict subset of the old one, so no new start or exposed is possible from this change." The narrowing claim is correct as far as it goes — I checked it by hand against the old implementation and the new selection is a strict subset in all four cases (token-identical →
Nonein both; exactly one differing token → the new filter keeps the oldsite.first <= i <= site.lastcondition and adds the requirement that the same site range already existed in the old line, which the old code could not produce; two or more differing tokens → the old code could still select a site, the new code selects none; a token-count change → the old code could still select a site, the new code selects none). But "a strict subset of the named boundaries" does not imply "no change to the verdicts". Eight corpus cases that were labelledcredited— a real test pinning the change — are now observed asgap, because a withdrawn named comparison means the analyzer no longer recognises the test as pinning that behaviour. That is the fail-closed direction the product contract prefers over a wrong actionable repair, but it is a measurable loss of credit, and the PR body argues the opposite. The body should state plainly that eight labelled corpus cases losecredited, that this is the intended consequence of refusing to name a clause that may not be independently steerable, and that the fail-closed direction was chosen deliberately. - The changelog fragment claims a user-visible behaviour change that this adapter never had.
changelog.d/typescript-single-token-clause-11442.mdsays: "Two changed tokens in one clause and an added comparison clause no longer start a repair packet (#11442)." They did not stop starting a repair packet, because the TypeScript preview adapter never started one. The PR body's own "Evidence gaps" section states it: "The positive app tests do not assertrepair_packet_ready: the TypeScript preview ispreview_advisory_onlyand never emits a ready packet." The re-blessed golden agrees —repair_packet_readyisfalseandauthority_boundaryispreview_advisory_onlyboth before and after the change. What actually changed is that the finding no longer carries a named comparison clause, somissing_discriminatorbecomesnulland the actionability category moves fromincomplete_repair_packettomissing_target_shape. The fragment's first two sentences describe that accurately; the third sentence should say that no clause is named, not that a repair packet stopped starting. A user reading the fragment as written would look for a repair packet that was never emitted.
Non-blocking:
- The new tests have no executed evidence at this head. In run
41243283685theRipr Rust Small tests on GitHub Hostedjob (124669456124) is skipped, because the Rust gates job failed first and the shard job depends on it. The PR body's local evidence —cargo test -p ripr --lib -- boundary_label typescript_clause_single_token_packets: exit 0 (59 passed), pluscargo xtask precommit: exit 0 — was run on head48c3183383, not on12a9298c8; the body says as much for the later fixture-only commit. The four new app-level tests (single_operator_substitution_names_its_clause,single_literal_substitution_names_its_clause,two_tokens_in_one_clause_start_no_repair,added_comparison_clause_starts_no_repair) and the five newboundary_label_teststherefore still need a hosted run at the final head. - The negative app tests' discriminating signal is weaker than their names suggest, which the body discloses.
two_tokens_in_one_clause_start_no_repairandadded_comparison_clause_starts_no_repairassertpacket_ready()andexposedtogether with the absence of a named comparison. As the body notes,packet_readyandexposedare already false for TypeScript preview findings independently of boundary selection, so only the absence of a named==discriminator actually discriminates the rule. That is an acceptable oracle for a narrowing rule — a mutant that kept naming a clause would fail on the named-comparison assertion — but the two test names describe an axis that never varies. The body is honest about this; no change is required beyond making sure the assertion that does discriminate is the one the test would fail on. - The golden ledger records two pending blesses for one fixture with one reason.
fixtures/typescript_jest_vitest_assertion_facts/expected/CHANGELOG.mdgains "Pending — typescript_jest_vitest_assertion_facts (40)" and "(41)", both with the reason "RIPR-SPEC-0027: a two-token edit (operator and literal) names no clause boundary (#11442)". The ledger is append-only, so two bless attempts are plausible; it is only worth noting because the body describes a single re-bless. - The ledger lists
expected/human.txtas updated, but that file did not change. Both ledger entries listexpected/human.txtunder "Updated". I readhuman.txtat head and at base and they are byte-identical (6068 chars each), and the file never containedcount == 1; the human rendering of theisReadyfinding uses the unchanged "replace or augment the truthiness check with an exact-value assertion" wording and an unchanged next-step line. So the golden is not stale on that file andcargo xtask goldens checkis not endangered by it — the ledger lists files the bless wrote, not files whose bytes changed. Noted only so a later reviewer does not read the ledger as a claim thathuman.txtmoved. - The spec update matches the implementation.
RIPR-SPEC-0027:504-513now states that a clause is named "only when exactly one token was substituted in place (an operator, a literal, or a single operand token) in a comparison the old line already had", and that any insertion or deletion, two changed tokens in one clause, and an added comparison clause name no boundary. That is exactly what the newselected_textdoes: one differing token index, a site covering it, and a site with the samefirst/lastrange present inold.sites. The traceability entries name the nine new tests with their exact paths, and the changelog fragment is named for its governing issue (#11442).
Not run:
- No local build, test, lint or gate: the Rust toolchain on this host is not on
PATH, socargo test -p ripr --lib,cargo xtask verdict-corpus check-all,cargo xtask goldens check,cargo xtask precommitand the fixture commands were not executed. Every Rust-level claim above is taken from hosted job logs and from source, not from a local run. - The verdict corpus was not regenerated locally and the 15 moved rows were not individually re-derived; the move list is quoted from the candidate's own Rust gates job log at this head, and the attribution to this PR rests on main's
VERDICT_CORPUS_RESULT: successatfa621a32plus the byte-identicalboundary_selection.rsat base and main. - The 178-mutation replay referenced in the PR body was not re-run; its inputs are not present in the tree, as the body states.
- The base commit's own routed lane state could not be compared directly — the base
c8effc97has no routed run of its own, so main's tip was used as the comparison point instead, and that substitution is stated above rather than glossed.
Reviewed by an independent Mavis review agent on behalf of the maintainer; bound to head 12a9298c80cb988ec058c54602fbd8ecf4d29676. Not an approval.
…and added clauses (#11442) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
…restore added-clause negative (#11442) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
There was a problem hiding this comment.
Confirmed findings
- The blessed golden changelog records an expected/human.txt update that is not included in this PR's changed files, weakening the claim that the generated golden set is fully captured.
Verification questions
- Confirm the golden changelog says expected/human.txt was updated, but that file is absent from this PR's changed-file list.
- Confirm the production selector rejects edits with an added comparison site and rejects multi-token replacements except for a narrowly recognized mirrored operand swap.
- Confirm the production-path negative tests cannot independently prove that no repair starts because TypeScript preview packet readiness is always false.
Evidence gaps
- Exact-head executable validation is unestablished in the packet because ripr failed and the cargo-test receipt is absent; prior reported runs do not replace a completed final-head receipt.
- The production-path fixture is feature-gated under lang-typescript and exercises check_workspace_with_config, but the packet lacks a completed cargo-test receipt for the final head.
- No completed exact-head cargo-test receipt establishes that the changed Rust tests and golden expectations pass together.
- No active-view-specific execution evidence was present because the cargo-test receipt was absent and ripr failed.
- The packet lacks completed Rust test evidence for the final head; prior reported runs and fixtures are not an independent receipt.
- Model proof intent was rejected by deterministic validation.
- Exact-head test execution remains unestablished in the supplied packet.
- Exact-head execution and a broad sibling-caller sweep remain unestablished in the supplied review packet.
…eability names (#11442) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
There was a problem hiding this comment.
Confirmed findings
- crates/ripr/src/app/tests/typescript_clause_single_token_packets.rs:1 — Add or cite a completed exact-head test receipt for the changed unit and app tests. The current packet has a failed ripr sensor and no cargo-test receipt, so reported prior runs do not establish that the final tree passes.
- fixtures/typescript_jest_vitest_assertion_facts/expected/CHANGELOG.md:873 — The blessed changelog records
expected/human.txtas updated, but that file is not changed in this PR. Regenerate or include the corresponding human-readable golden so the documented artifact set and repository contents agree.
Verification questions
- Confirm the blessed golden changelog says
expected/human.txtwas updated, but that file is absent from this PR's changed-file list. - Confirm the re-blessed golden changelog records an expected/human.txt update, but expected/human.txt is not among the changed files.
- Confirm the app helper treats any missing-discriminator text containing ' == ' as evidence that a comparison clause was named, which can misclassify unrelated discriminator text.
- Confirm the blessed golden changelog claims expected/human.txt was updated, but that file is absent from the PR changed-file list.
- Confirm the blessed golden changelog claims expected/human.txt was updated, but that file is absent from the changed-file list.
- Confirm the production-path negative assertions are only partially discriminating because TypeScript preview is always non-actionable; absence of a named
==discriminator is the signal that exercises boundary selection.
Evidence gaps
- Exact-head Rust test execution is not established by this review packet: ripr failed and the scheduled cargo-test receipt was absent.
- Exact-head executable validation of the changed Rust tests is absent from this review packet: ripr failed and the scheduled cargo-test receipt was not available.
- Model proof intent was rejected by deterministic validation.
- The generated golden changelog says expected/human.txt was updated, but expected/human.txt is not among the changed files, leaving the blessed artifact set incomplete or stale.
…r and operand (#11442) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq
|
Note on head fdfca4c: the installed-journey failure on 574b970 ( Coverage loss, stated honestly: those two rows used to exercise the "boundary operand is not bound to a concrete value" refusal (#9107) end to end; they now fail closed earlier, at selection. The operand-binding logic stays unit-tested in Local exit codes on this head: installed_python_typescript_journeys 0 (48 passed), blind-journey-contract 0, blind-journey-execute 0, verdict-corpus check-all 0, goldens 0, fixtures 0, check-fixture-contracts 0, check-traceability 0, precommit 0. The shard-4 failure on 574b970 ( Generated by Claude Code |
Governing issue or accepted claim: #11442
Acceptance delta (one sentence): The TypeScript boundary selector names a changed clause of a compound condition only when exactly one clause is touched, so a multi-token edit within one clause or an added comparison clause no longer names a clause that may not be independently steerable, while a pure operand swap (
total >= 100to100 <= total) keeps its label.Summary
boundary_selection.rs: withholds a clause when the edit adds a comparison site or replaces more than one token on either side. Exception: a pure operand swap that is the whole edit (operands exchanged around the one comparison operator, operator mirrored or unchanged for==/===/!=/!==, every other token identical at the same index). Token-identical edits (comment/whitespace) refuse before the returned-ternary fallback, as on main.Verdict corporashowed it lost 15 correct TypeScript credits (operand swaps such as100 <= total), so the swap exception was added; the verdict corpus is NOT re-blessed and all 15 rows stay credited.boundary_label_tests.rs,app/tests/typescript_clause_single_token_packets.rs: positives and refusing negatives, including the two cases deferred from ux(typescript): only 1 of 178 real-repo mutations offered a repair start; suggested test shape (as any) is refused by the verifier #11196, swap positives, unmirrored-exchange negatives, and swap-plus-another-edit negatives.typescript_jest_vitest_assertion_facts(check.json+ CHANGELOG). ItsisReadyedit (count > 0tocount >= 1) changes two tokens in one clause, so it no longer namescount == 1. Intended consequence of this PR. The two TypeScript preview corpora (typescript-preview-repair-loop,typescript-preview-false-actionable-audit) were updated to the resultingmissing_target_shapewording.Review
Independent fresh read-only reviews: (1) found a returned-ternary regression, fixed; (2) confirmed that fix; (3) on head 90529ac found the swap exception applied per site (a swap plus an edit in another clause still named the swapped clause) and a wrong traceability test name, both fixed; (4) on head 574b970, the delta review found no defects (REVIEW_READY).
Validation actually run (local, final tree)
verdict-corpus check-all0,goldens check0,fixtures0,check-fixture-contracts0,check-traceability0,cargo test -p ripr --lib -- boundary_label typescript_clause_single_token_packets0 (67 passed),cargo xtask precommit0 (two earlier runs were SIGKILLed by the box's memory limit during the clippy compile, then passed). Hosted CI on the exact head is the final proof.Evidence gaps (stated honestly)
repair_packet_ready: the TypeScript preview ispreview_advisory_onlyand never emits a ready packet. The negatives'packet_ready()check is a tripwire only; the discriminating signal is the named==discriminator.🤖 Generated with Claude Code
https://claude.ai/code/session_01UNUoLStjTeXK7R7aoSnBBq