Repository navigation
fix(rust): credit a Display write! tail pinned by an exact to_string assertion - #9682
Conversation
…assertion (#9608) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JfeyhVjKnck3hhzL3soJz1
|
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 14 minutes. View limit details
Comment |
There was a problem hiding this comment.
Verification questions
- Confirm the literal detector treats any quote-delimited text as a string literal, so malformed Rust syntax such as a prefixed raw string or a non-string byte literal is not exercised or rejected explicitly.
- Confirm the changed test route covers constructor and local-variable receivers, but does not establish a complete sibling scan for method-call syntax, qualified paths, macro-generated assertions, or alternate direct-output owners.
- Confirm observation matching duplicates source-offset reconstruction already performed by the fmt-dispatch module and assumes the literal operand text occurs once verbatim in the test body.
- Confirm literal detection appears delimiter-based rather than AST-based, so valid Rust string literal forms may be rejected inconsistently.
- Confirm the assertion parser accepts only an exact no-space
.to_string()spelling despite valid Rust whitespace before the call parentheses; this is an untested compatibility edge in the newly recognized oracle.
Refuted
- The PR changes an active-view consumer whose snapshot can become stale after resize, detach, or transfer.; refuted because: The diff is confined to Rust static analysis, syntax parsing, fixtures, and documentation. None of the reviewed code reads or mutates JavaScript buffer state, so this lane has no applicable object-lifetime or active-view transition to review.
- The change may credit neighboring write!, format!, Debug, or assertion routes that are not the requested exact Display pin.; refuted because: Changed witness and observation guards constrain the route to a sole write into the owner's formatter and an exact literal-versus-typed-to_string assertion; documented exclusions cover the neighboring forms.
- The new credit path may be gated by ordinary owner-return or fallible-check evidence, making the corpus fixture insufficient.; refuted because: The changed evidence closure explicitly recognizes
fmt_write_owner_tailand callsassertion_pins_display_string, so the PR includes a distinct route for this credit.
Evidence gaps
- Execution-time safety and regression behavior still depend on the scheduled cargo-test receipt; this lane found no static lifetime defect.
- The implementation leaves the scheduled cargo-test receipt unobserved in this lane.
- Model proof intent was rejected by deterministic validation.
Parked follow-ups
- Offset-based recovery of the compared to_string expression could theoretically choose a duplicate textual receiver in a malformed assertion representation.
… the Display pin (#9608 review) Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JfeyhVjKnck3hhzL3soJz1
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JfeyhVjKnck3hhzL3soJz1
Review of record, head 683084b (code reviewed at 1f75548, then repaired)Two independent reviewers inspected the diff from different angles. Correctness / false credit. Confirmed one real problem: the Display pin admitted any exact Tests / spec / contract.
Proof (before the final main merge). State. Main currently fails to compile (E0425, #9701), so I have not applied 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! |
There was a problem hiding this comment.
Confirmed findings
- No unsafe, raw-pointer, native FFI, reference-storage, or thread-sharing seam was introduced; the flagged native-risk surface is consumed advisory-only.
- The added write-tail parser keeps syntax-tree borrows local and converts syntax text to owned strings before matching or returning.
Verification questions
- Confirm the exact Display-string oracle uses byte offsets only within the existing masked test-body string and rejects ambiguous occurrences before dispatch.
- Confirm literal recognition is delimiter-based rather than Rust-AST-based, leaving valid literal forms unsupported and incompletely tested.
- Confirm the observation parser recognizes only the compact .to_string() spelling.
- Confirm the observation route is narrower than the PR's broad wording: it requires assert_eq!, exactly two operands, one quote-delimited side, an exact .to_string() spelling, and a uniquely located receiver occurrence.
Refuted
- A passing static packet is sufficient despite failed ripr evidence.; refuted because: That premise is false: ripr exited 2, so the central late cargo-test receipt and ripr output remain required evidence before a merge verdict.
- This Rust classifier change may cross a JavaScript worker/GC/detach/transfer lifetime boundary.; refuted because: The inspected production and test paths contain no JavaScript execution, asynchronous handoff, managed-memory conversion, or transfer/detach operation; all new evidence operates on owned Rust source text and indexed facts.
- The exact to_string oracle could falsely credit a changed argument such as self.0 to self.0 * 2 at test value zero.; refuted because: The evidence requires before/after probe text to differ only inside string literals; an argument-only or mixed change fails closed.
- The new exact literal oracle broadly credits any exact to_string assertion.; refuted because: It additionally requires Display ownership, typed receiver, dispatch reach, no competing inherent to_string, unique operand occurrence, and literal-only mutation.
Evidence gaps
- End-to-end execution evidence is incomplete in the supplied packet because rip r failed and cargo-test was only scheduled, although focused negative tests and seeded review evidence address the main concern.
- Model proof intent was rejected by deterministic validation.
…ma 1.93 Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JfeyhVjKnck3hhzL3soJz1
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01JfeyhVjKnck3hhzL3soJz1
There was a problem hiding this comment.
Verification questions
- Confirm the observation oracle silently rejects valid whitespace between to_string and its call parentheses.
- Confirm the newly added sibling oracle recognizes only compact .to_string() syntax and quote-delimited string literals, leaving valid syntax variants uncredited.
- Confirm the source route remains syntactically narrower than broad Rust string-literal and method-call parsing, especially for escaped strings and whitespace before to_string parentheses.
- Confirm the literal-only gate is delimiter-based rather than Rust-syntax-based, so its admitted mutation boundary is narrower and differently shaped than the documentation's generic string-literal terminology.
- Confirm the seeded parser questions remain coverage boundaries rather than claim violations: the implementation recognizes ordinary quote-delimited literals and the exact compact .to_string() suffix.
Refuted
- Static evidence is sufficient despite the ripr sensor exiting 2.; refuted because: Not accepted: the failed analyzer receipt and scheduled cargo-test receipt remain required before a merge-level verdict, although this lane found no separate source-route defect.
- The change introduces a native safety or thread-sharing risk.; refuted because: unsafe-review reported no new/worsened gaps, and the changed logic uses owned strings and local syntax matches without unsafe or FFI additions.
- No ArrayBuffer, TypedArray, resize, detach, transfer, or stale-length backing-store state is introduced by the changed Rust analyzer paths.
- The active-view matcher could read beyond a resized or detached view and misclassify a Display pin.; refuted because: No resizable active-view abstraction or asynchronous backing-store lifecycle exists in the changed surfaces. The matcher validates the current masked body and requires a unique operand occurrence; malformed or unsupported syntax fails closed.
- The native-risk classification could conceal a memory-safety issue.; refuted because: unsafe-review completed with no new gaps, and the changed Rust paths contain no unsafe or raw-pointer operations; syntax borrows remain local and strings are owned before classification.
Evidence gaps
- Required executable red/green evidence is not closed in the supplied packet because ripr failed and the late cargo-test receipt is absent.
- Model proof intent was rejected by deterministic validation.
|
Review of record for head 2973d6c (changes since the reviewed 688cea7 are the main merge, recommitted Angles reviewed by independent agents: correctness and edge cases, tests and regressions, spec and contract, false-credit adversarial probes. Generated by Claude Code |
|
Post-merge read of #9682 on main (correctness and false-credit angle; read-only, not executed). #9694 is also already merged, so I did not review it. Finding: The function removes string-literal contents and compares what is left, so any edit inside the format string counts as a literal-text change, including the placeholders. For
The doc comment's argument ("a literal fragment is written whatever the test passes in") holds for text outside Fix. Treat a changed string as literal-only only when the diff leaves every Not established: whether the corpus has a hostile row for this. Generated by Claude Code |
Summary
Fixes #9608.
idiom-display-string-pin(impl Display for Tempwithwrite!(f, "{}°C", self.0), pinned byassert_eq!(Temp(21).to_string(), "21°C")) readweakly_exposedalthough both runtime mutants fail the test. It now readsexposed/credited. Two links were missing, both closed conservatively:format_tail_witnessalso reads afmtwhose whole body is onewrite!into its own formatter parameter (string-literal format, plain arguments, noformat!/write!rebinding in the file), taggedfmt_write_owner_tail.assertion_pins_display_stringadmits an exact-valueassert_eq!with one string-literal side and onevalue.to_string()side, wherevalueis typed as the owner's self type, the owner isDisplay, no inherentto_stringcompetes, and the test reachesfmtby dispatch. The write-tail credit applies only when the probe changes string-literal text alone (changes_only_string_literals), so an argument change invisible at the test value stays weak.No actionability widening. The seam cache schema advances to 1.93 / 0.100 (fixture content hashes and receipts recommitted).
Swarm / Source Boundary
ripr-swarmSource-of-truth Links
Spec: RIPR-SPEC-0297 (new "Pinned Display output" section)
Governing issue or accepted claim: #9608
Acceptance delta (one sentence):
idiom-display-string-pinmoves from false actionable to credited, its known-false file is removed, and no other corpus row moves.Candidate Relationships
Candidate branch: claude/project-thread-9lsalp
Stack parent or prerequisite PR (if any): none (#9629 merged)
Scope Classification
Proof
Moved rows: only
idiom-display-string-pin. Negative controls cover another receiver type, unknown receiver, computed expected string, no literal side, non-assert_eq!,Debugowner,write!into a non-formatter, non-fmtmethod, statement before the tail, non-literal format,?in an argument, and an argument-only change.Claim Boundary
May claim: a write-only
Display::fmtis credited when an exactto_string()assertion pins its whole output. Must not claim:format!/{}pins, computed expectations, orDebugowners are read.Static Language Check
killed,survived,untested,proven, andadequate.🤖 Generated with Claude Code
https://claude.ai/code/session_01JfeyhVjKnck3hhzL3soJz1