Repository navigation
fix(typescript): no probe on the wrapped signature lines of a new function (#14097) - #14153
Conversation
…ction (#14097) A new function, method or arrow whose signature a formatter wrapped over several lines got one finding per physical signature line: the opening line, each parameter line (read as field_construction) and the `): T {` closer (read as predicate). The one-line spelling of the same signature already yields no header probe, so the result depended on line width. Read the header as one unit: from the owner's first line to the first line ending in `{` outside the parameter list, accepted only when the joined text passes is_signature_opening_line. A default value, a destructuring default, a parameter property, a computed key or a decorator keeps every line probed, as do a constructor, a changed signature of an existing owner, a header that is not all added lines, and a body with no added probe line. On 100 real commits of zod, hono, date-fns, axios and TanStack query this removes 397 signature-line findings (380 date-fns, 17 hono). Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EQRVmHPS5rKE967z5W6be
|
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 4 minutes. View limit details
Pre-merge checks:
|
There was a problem hiding this comment.
Confirmed findings
- The PR's substantive behavioral claim is not supported by a completed test receipt in this review packet; cargo-test is absent and the ripr sensor failed.
- Raw parenthesis counting can misidentify the header boundary when a string or comment contains parentheses, contradicting the stated fail-closed behavior.
- Header termination relies on raw parenthesis depth and a line ending in
{; punctuation inside comments or strings can misidentify the header boundary and skip body probes.
Verification questions
- Confirm the existing-owner control does not cover a wrapped owner whose opening line is unchanged while only later signature lines are added.
- Confirm the new helper suppresses every added line from a wrapped header through the body-opening brace when the joined text passes the existing signature-opening classifier.
- Confirm the '@' rejection is broader than the documented decorator case and may unnecessarily suppress valid headers containing '@' in ordinary text.
- Confirm the implementation uses raw parenthesis counting while scanning the header, so brackets inside strings or comments can misidentify the body boundary.
Evidence gaps
- Focused test evidence on the reviewed head is incomplete because ripr failed and the scheduled cargo-test receipt is absent.
- The focused test receipt is absent in this packet, so the claimed seven new regression cases and the existing TypeScript/Python suite are not independently established here.
- The central test receipt is absent, so the new regression coverage is currently proposed rather than demonstrated by an executed packet.
- The supplied evidence does not establish complete behavior preservation across the sibling TypeScript owner routes.
- Model proof intent was rejected by deterministic validation.
…des a body line (#14097) The wrapped-header reader counts round brackets only to pick the line where the parse is tried. Pin the consequence of a miscount: an unclosed `(` in a header comment costs a missed header (its lines keep their probes), a body comment that rebalances the count does not make a body line part of the header, a stray `)` still reads the real header, and a `)` inside a default string keeps the header probed. Co-Authored-By: Claude Fable 5.2 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_016EQRVmHPS5rKE967z5W6be
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY
Author self-review of head 804edd32 (source and oracle pass; hosted qualification results are still to be inspected before merge).
Inspected
- Complete diff (4 files, +372):
annotation_only.rs,mod.rs,new_declaration_tests.rs, changelog fragment. - Semantic owner and consumers: the new-declaration guard family in
annotation_only.rs, consumed only by the added-line loop ofTypeScriptAdapter::analyze_diff. The new skip sits beside the existing one-line guard and reusesis_signature_opening_lineas the only authority on what a plain signature is. No renderer, schema or config surface changes. - Merge subject: GitHub merge ref
b6e9b68fhas parentsabf2c72d(main) and804edd32, tree3d2f4b82, identical to a localmerge-tree. Main moved by a docs commit only since the branch point.
Wrong-behavior challenges
- Could a body line be skipped? Acceptance needs the joined text to parse as a signature whose body is an empty block. Text that reaches into the body has a non-empty body or unbalanced braces, so the parse refuses it. Pinned by
bracket_in_a_header_comment_or_string_never_hides_a_body_line. - Could runtime-bearing header text be skipped? Default values, destructuring defaults, rest defaults, parameter properties, constructors and decorated parameters keep a probe on the line that holds them (
wrapped_header_shapes_that_keep_their_probes,wrapped_signature_with_a_default_value_keeps_probes). - Could a changed signature of an existing owner be skipped? A header line that is not added, a removed line naming the owner, or a look-alike removed counterpart keeps the probes (
parameter_added_to_an_existing_wrapped_signature_keeps_probe,renamed_function_with_a_wrapped_signature_keeps_probes). - Removal experiment on
cf294475: with the skip disabled, the two positive tests go red and the controls stay green.
ub-review findings on cf294475
- "Raw parenthesis counting can misidentify the header boundary ... and skip body probes": refuted. The count only selects the line where the parse is tried; the parse decides. A miscount costs a missed header whose lines keep their probes. Four cases now pin this, including a body comment that rebalances the count on a body line ending in
{. - "Existing-owner control does not cover a wrapped owner whose opening line is unchanged while only later signature lines are added": covered by
parameter_added_to_an_existing_wrapped_signature_keeps_probe(the owner's first line is not an added line, so the header is never read). - "The
@rejection is broader than the documented decorator case": correct, and deliberate. Any@in the header keeps every probe; that is the conservative direction and matches the existing one-line guard. - Test receipt absent in its packet: the local receipts are in the PR body; the hosted run on this head is requested next.
Evidence still missing
- Hosted qualification on
804edd32. - CodeRabbit and Gemini returned quota notices, so there is no review from either.
- Platform: no platform-specific branch in this change.
Generated by Claude Code
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
ripr static exposure checkCommit Took 78s. |
|
Answer to the Devin info note on The observation is accurate and it is inherited, as the note itself says: a rename is recognised through the No change in this PR. Rename detection that does not depend on line pairing would have to change both paths together and is outside this claim. Generated by Claude Code |
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY
Final pass on head 804edd32febbc681f89744eb71e249a10d837e54 (basis abf2c72d). The source review recorded earlier on this same head stands; nothing in the diff changed since.
Hosted evidence inspected on this exact head, run 42980230684:
Admit PR Candidate: success.Ripr Rust Small on GitHub Hosted / Rust gates: success.- Rust tests shards 1 to 4 of 4: success, and
Rust test shards verify: success. Ripr Rust Small Result: success (completed 08:55:55Z).vscode surface, clean pip and uv Python journeys: success. Other jobs were routed out for this change set.
Review inputs read in full:
- ub-review findings: answered in the source review; the bracket-counting concern is pinned by
bracket_in_a_header_comment_or_string_never_hides_a_body_line. - Devin info note on rename pairing: accurate and inherited from the one-line path; answered in the conversation and the thread is resolved. No review thread is open.
- CodeRabbit and Gemini returned quota notices, so there is no review from those two providers; this pass and the source review supply the judgment.
- The ripr comment on this PR's own diff is advisory static evidence (61 findings, none
exposed); it makes no runtime claim and is not a gate.
Claim boundary unchanged: a new owner's plain wrapped signature yields no signature-line probe in the TypeScript preview; headers with a default value, parameter property, decorator or computed key, constructors, and changed signatures of existing owners keep their probes. Static evidence only.
Next: enqueue in the merge queue with squash, then reconcile #14097 after landing.
Generated by Claude Code
EffortlessSteven
left a comment
There was a problem hiding this comment.
Exact-head review (head 804edd3)
Independent pass over a PR whose review-of-record is the author's own self-review; fresh context and oracles.
Surfaces read
Full diff against merge-base cb95c5b0e15b1d5f37fdb4c4c8f0b63098377d10 (origin/main is at aabcf1d104d3; main's movement since the base touches no file under crates/ripr/src/analysis/language/typescript/, verified by empty git diff --stat cb95c5b0..origin/main -- <dir> — no integration conflict). Four files, +372/-0. Read in full at the head: annotation_only.rs (new new_owner_wrapped_header_lines at 431-505, its one-line counterpart is_new_owner_opening_line at 373-401, the parser-backed is_signature_opening_line at 306-329, runtime_skeleton at 127-152, mentions_identifier at 363-371), mod.rs (new computation at 1404-1431, the skip at 1439-1441, the surrounding probe loop 1432-1480 and the one-line guard's closures at 1449-1467), all of new_declaration_tests.rs including the pre-existing helper (TypeScriptAdapter::analyze_diff at line 84), the changelog fragment, plus types.rs owner records, probe_shape.rs:278-287 (should_ignore_typescript_changed_line), diff/model.rs:458-459 (lines_look_alike), owners.rs:2458-2464 (inside_private_member_boundary), the PR body, and issue #14097 (premise matches: wrapped signature lines probed as behavior, one-line spelling already exempt, formatting-dependent output).
Commands run (Windows host, Git Bash, toolchain 1.95.0 per rust-toolchain.toml, CARGO_TARGET_DIR inside the scratch worktree)
cargo test -p ripr --lib typescript::new_declaration_tests→ 18 passed, 0 failed, exit 0 (10 pre-existing + the 8 new). Matches the PR body's claim. First attempt failed with LNK1104 on a missing<worktree>/targettemp dir; created it and reran clean — infrastructure, not code.cargo fmt --check→ exit 0.cargo clippy -p ripr --all-targets -- -D warnings→ exit 101. Rerun scoped to--libcaptured the full list: 5 errors, all in files this PR does not touch —lsp/backend.rs:14644,14665,14691,14718(unix mount machinery) andedit_cage/mod.rs:2133; the--all-targetsrun additionally flagslsp/tests.rs:27424, whose only callers are#[cfg(unix)](27628, 27659). Attribution: inherited, Windows-cfg-only, not introduced by this diff — the files are byte-identical at the merge-base (git show cb95c5b0:...tests.rsshows the same 3 mentions) and unchanged on main since; hosted Linux gates are green at this head. Not counted as a finding against this PR; it is a separate inherited repair for whoever owns the Windows local-lane story.- Removal experiment (run in my scratch worktree, then reverted; tree verified clean at
804edd32after): disabled the skip atmod.rs:1439(if false && wrapped_header_lines.contains(...)) and reran the focused suite → exactly the 3 suppression-witnessing tests FAIL (wrapped_signature_of_a_new_function_is_not_probed,wrapped_header_shapes_leave_only_body_probes,bracket_in_a_header_comment_or_string_never_hides_a_body_line) while all 12 keep-the-probe controls stay green. The oracle has a real red witness; a wrong implementation of this behavior would be noticed. - CI at head:
gh api repos/EffortlessMetrics/ripr-swarm/commits/804edd32.../check-runs→ 30 runs: 13 success (all 4 Rust test shards + shard verify, the Rust gates lane, candidate admission), 17 skipped, 0 failed. gh pr viewat query time: OPEN, not draft, head unchanged,mergeable: UNKNOWN(GitHub had no answer yet — observation only, not a code fact).
Analysis
Semantic owner: wrapped-signature classification for NEW TypeScript function/method/arrow owners; sole consumer is the probe loop skip (mod.rs:1439). The condition set mirrors the one-line guard exactly — module-initializer and constructor exclusion, normalized path equality, removed-text-mentions-owner fail-closed, body-probe requirement (annotation_only.rs:431-505 vs 373-401) — and the walk is stricter (every header line must be an added, non-look-alike line), which fails toward keeping probes. Fail-closed audit: suppression additionally requires the joined multi-line text to pass is_signature_opening_line, which re-parses with oxc and demands an empty synthetic body plus plain params (no initializers, accessibility, readonly, override, =), rejecting @ and computed keys — so defaults, destructuring defaults, parameter properties and decorators cannot hide (tests assert each). The round-bracket depth count only chooses which line to try; a miscount inside a comment or string costs a missed header (probes kept), never a wrong suppression — the bracket-in-comment/string tests at head exercise both the miss direction and the early-zero direction. False-credit audit: mentions_identifier is whole-identifier bounded on both sides (annotation_only.rs:363-371), suppression keys on AST line ranges rather than text matching, and owner paths are normalized-compared, so cross-file owners cannot collide. Consistency: the has_added_probe_line closure (mod.rs:1424-1428) is byte-identical to the one-line guard's (1459-1463); the look-alike filter mirrors the guard's counterpart check (1449-1451). No golden or fixture deltas.
Findings
None. Zero substantive findings at this head; I state that plainly. One residual observation, not a defect of this diff: has_added_probe_line does not consult inside_private_member_boundary, so a wrapped header can in principle be suppressed while its body probe is separately boundary-suppressed, leaving the owner with no finding — but the pre-existing one-line guard has had exactly the same property since before this PR (same closure), so this is inherited parity, and I could not construct a reachable scenario (private-member ranges are member declarations, not method bodies).
Not established
- Local clippy on the exact base commit (not run; inheritance established via file identity, cfg-gate reading, and green hosted Linux gates instead).
- The PR body's 100-real-commit experiment (397 findings removed, 227 appearing at the output cap): body-claimed; not reproduced here.
- Hosted run logs/artifacts beyond the check-run conclusions above;
mergeablewas still UNKNOWN at query time. - The body's precommit pass was on the parent commit
cf294475, not this head (disclosed in the PR body; the head delta is one added test, which I ran here).
EffortlessSteven
left a comment
There was a problem hiding this comment.
REVIEW_READY
Head 804edd3, unchanged since the 08:56 readiness review. The 13:48 independent exact-head review found nothing on this head, but as the latest same-account review it replaced the readiness review for admission, so this queue entry would have been ejected at the front of the merge queue. This repeats the readiness review on the same head.
Generated by Claude Code
Requested by Steven Zimmerman · project thread
Summary
field_construction) and the): T {closer (read aspredicate). The one-line spelling of the same signature already yields no header probe, so the result depended on line width.ripr checkon 220 real commits of well-known Python and TypeScript projects (read-only clones). On the 100 TypeScript/JavaScript commits (zod, hono, date-fns, axios, TanStack query) this removes 397 signature-line findings (380 date-fns, 17 hono). date-fns18cbd43had 9 signature findings for a one-line body.Closes #14097
Swarm / Source Boundary
dependency, or repo-ops development for
ripr-swarmSource-of-truth Links
Proposal: n/a
Spec: n/a
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #14097
Acceptance delta (one sentence): a new owner's plain wrapped signature yields no probe on any signature line, and every runtime-bearing or not-all-new header keeps its probes.
Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
claude/project-thread-w844qlStack 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): none
Accepted winner and losing candidate disposition (when decided): n/a
Scope
typescript/annotation_only.rs:new_owner_wrapped_header_lines, the multi-line counterpart ofis_new_owner_opening_line. The header runs from the owner's first line to the first line ending in{outside the parameter list, and counts only when the joined text passes the existingis_signature_opening_line.typescript/mod.rs: compute the set once per changed file and skip those added lines.typescript/new_declaration_tests.rs: 8 tests throughTypeScriptAdapter::analyze_diff.changelog.d/typescript-wrapped-new-signature-14097.md.Scope Classification
Production delta:
Evidence/support delta:
Single acceptance criterion:
Non-goals:
Support-tier Impact
Claim/proof notes:
preview.Policy Impact
Ledger or exception notes:
Proof
Result, failures, or skipped proof:
cargo fmt --check: clean on804edd32.804edd32(8 new).cf294475(thewrapped_header_linesskip disabled):wrapped_signature_of_a_new_function_is_not_probedandwrapped_header_shapes_leave_only_body_probesgo red; the keep-the-probe controls stay green, as they should on both sides.cargo xtask precommitoncf294475: pass (40 policy checks,git diff --check,cargo clippy -p ripr --all-targets -- -D warningsand the same forxtask; report digestsha256:e0b38d1f...). An earlier run exited 1 after 21 minutes when the kernel killedrustcfor lack of memory; that was the machine, and the rerun used a lower-memory build profile.804edd32: precommit and Clippy. The delta fromcf294475is one added test function (bracket_in_a_header_comment_or_string_never_hides_a_body_line), formatted and passing. Hosted qualification covers it.merge-ready; results to be inspected before merge.Continuation record
Claim Boundary
Rollback
Spec-Test-Code Traceability
crates/ripr/src/analysis/language/typescript/new_declaration_tests.rscrates/ripr/src/analysis/language/typescript/annotation_only.rs,typescript/mod.rsStatic 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 precommit(oncf294475; see Proof for the one-test delta)🤖 Generated with Claude Code
https://claude.ai/code/session_016EQRVmHPS5rKE967z5W6be