Skip to content

test(owner_pin): pin raw-string inner-quote whitespace as operand content (#15021) - #15596

Merged
EffortlessSteven merged 2 commits into
mainfrom
claude/compact-operand-raw-quote-15021
Nov 21, 2026
Merged

EffortlessSteven merged 2 commits into
mainfrom
claude/compact-operand-raw-quote-15021

Conversation

@EffortlessSteven

@EffortlessSteven EffortlessSteven commented Nov 20, 2026 •

Copy link
Copy Markdown
Member

🤖 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_operand already reads literal ranges from the shared rust_identity_spans scanner, 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.

  • New test whitespace_inside_a_raw_string_with_an_inner_quote_is_content in owner_pin/short_circuit.rs:
    • positive: check(n,r#"a "b" c"#) is kept verbatim by compact_operand, and it differs from the one-space edit check(n,r#"a "b" c"#);
    • positive: a two-hash raw string containing "# that does not close it is kept verbatim;
    • alternate: layout whitespace outside the literal is still removed, and the retained operand then reads as one differing operand;
    • GuardOperandChange::read on the whitespace-only edit returns None (not read as a retained operand).
  • Spec RIPR-SPEC-0197 test list and a .ripr/traceability.d fragment 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_operand with 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 full owner_pin:: run failed once on a fixture-spacing mistake in the first draft of this test, which was corrected)
  • cargo fmt --check
  • cargo clippy -p ripr --lib --tests -- -D warnings
  • cargo xtask check-traceability
  • cargo xtask goldens check
  • cargo xtask verdict-corpus check-all

Did not run: cargo xtask precommit, cargo xtask check-pr, the full workspace test suite, the full owner_pin:: run after the fix (only owner_pin::short_circuit), the mutation experiment above, and any hosted CI. No merge-ready label, not enqueued.

Generated by Claude Code


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 Nov 20, 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 16 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used the included review currently available. Your 147 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: 315a752a-59bd-4129-8fdf-03ccc65cb3ed
Commits

Reviewing files that changed from the base of the PR and between f9145ef and 9fce1f4.

Files selected for processing: 3

  • .ripr/traceability.d/15021-raw-string-inner-quote-operand.toml
  • crates/ripr/src/analysis/classify/owner_pin/short_circuit.rs
  • docs/specs/RIPR-SPEC-0197-owner-return-pins.md
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

…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
EffortlessSteven marked this pull request as ready for review November 20, 2026 07:44

@EffortlessSteven EffortlessSteven left a comment

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

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

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

@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!

@devin-ai-integration devin-ai-integration 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.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no bugs or issues to report.

Devin Review

@EffortlessSteven
EffortlessSteven added this pull request to the merge queue Nov 20, 2026
Merged via the queue into main with commit 5a9ec94 Nov 21, 2026
20 checks passed
@EffortlessSteven
EffortlessSteven deleted the claude/compact-operand-raw-quote-15021 branch November 21, 2026 08:01
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