Repository navigation
test(owner_pin): pin raw-string inner-quote whitespace as operand content (#15021) - #15596
Conversation
…tent (#15021) Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzTog4paRbkjGfRRp4y
|
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 16 minutes. View limit details
|
…5021) The bug in #15021 does not reproduce on main, so this PR changes no user-visible behavior. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01YVdGzTog4paRbkjGfRRp4y
EffortlessSteven
left a comment
There was a problem hiding this comment.
SOURCE_REVIEW_READY for head 9fce1f4
This PR is a test-only regression pin. The #15021 premise does not hold on current main: compact_operand takes its literal ranges from rust_identity_spans, which tracks raw-string hash counts, so whitespace inside r#"a "b" c"# already stays operand content. The new unit test pins that, and pins the same behavior for a two-hash raw string containing "#. It also checks that whitespace outside the literal is still stripped, and that GuardOperandChange::read returns None for the whitespace-only edit. Because the bug was already fixed, the test is a guard against regression, not a fail-before proof. No production code changes. The changelog fragment was dropped because nothing user-visible changed.
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! |
🤖 Generated with Claude Code
https://claude.ai/code/session_01YVdGzTog4paRbkjGfRRp4y
Governing issue or accepted claim: #15021
Acceptance delta (one sentence): Whitespace inside a hashed raw string that contains an inner quote is now pinned by a regression test as operand content in
compact_operand, so a whitespace-only edit inside such a literal cannot read as a retained guard operand.Source review: REVIEW_READY 9fce1f4
Summary
Investigation on base 332729a:
compact_operandalready reads literal ranges from the sharedrust_identity_spansscanner, which tracks raw-string hash counts. The reported mangling does not reproduce on current main, so this PR changes no production code. It adds the regression pin the issue asks for, with literal expected values rather than values derived from the production gate.whitespace_inside_a_raw_string_with_an_inner_quote_is_contentinowner_pin/short_circuit.rs:check(n,r#"a "b" c"#)is kept verbatim bycompact_operand, and it differs from the one-space editcheck(n,r#"a "b" c"#);"#that does not close it is kept verbatim;GuardOperandChange::readon the whitespace-only edit returnsNone(not read as a retained operand)..ripr/traceability.dfragment register the test. No changelog fragment: the PR changes no user-visible behavior.Caveat: because production was already correct, the test passes on base too. It is a regression pin, not a fail-before/pass-after fix. I did not run a mutation experiment (replacing
compact_operandwith plain whitespace stripping); by construction the verbatim-kept assertions would fail under it.Proof (all run locally on the committed head)
Ran and passed:
cargo test -p ripr --lib owner_pin::short_circuit(15 passed; the earlier fullowner_pin::run failed once on a fixture-spacing mistake in the first draft of this test, which was corrected)cargo fmt --checkcargo clippy -p ripr --lib --tests -- -D warningscargo xtask check-traceabilitycargo xtask goldens checkcargo xtask verdict-corpus check-allDid not run:
cargo xtask precommit,cargo xtask check-pr, the full workspace test suite, the fullowner_pin::run after the fix (onlyowner_pin::short_circuit), the mutation experiment above, and any hosted CI. Nomerge-readylabel, not enqueued.Generated by Claude Code
Generated by Claude Code