Skip to content

fix(cli): quote outcome/calibrate NotFound capture redirect paths - #7360

Merged
EffortlessSteven merged 1 commit into
mainfrom
cursor/quote-snapshot-capture-paths-843a
Oct 12, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
cursor/quote-snapshot-capture-paths-843a

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

Quote the ripr outcome / ripr calibrate cargo-mutants NotFound capture-command redirect path with the existing loop_commands::shell_arg quoter so a snapshot path that contains spaces pastes as one token.

Swarm / Source Boundary

This PR targets EffortlessMetrics/ripr-swarm, the normal development trunk for
trusted same-repo ripr work. Confirm the change belongs here:

  • ordinary feature, analyzer, editor, docs, spec, fixture, badge,
    dependency, or repo-ops development for ripr-swarm
  • repair or follow-up for a same-repo swarm PR
  • swarm-only CI, runner, routing, source-of-truth, or agent-operating
    surface
  • other swarm-scoped work:

If this PR moves crates.io publishing, VS Marketplace publishing, Open VSX
publishing, GitHub Release assets, signing, release environments, or release
secrets, close or retarget it. Those surfaces belong in EffortlessMetrics/ripr
unless a dedicated release-boundary change has already been approved.

Source-of-truth Links

Proposal: n/a (paste-safety follow-up of #7327 / PR #7345)
Spec: n/a (CLI recovery-hint wording; RIPR-SPEC-0009 is the outcome command, unchanged)
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: #7349
Acceptance delta (one sentence): a missing snapshot path that contains a space is quoted in the printed > path redirect, while the read {path} failed: not found. prefix stays unquoted and an unambiguous path stays a bare token.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): cursor/quote-snapshot-capture-paths-843a
Stack parent or prerequisite PR (if any): none (lands on current main after #7345)
Proposed replacement of PR (if any; not yet accepted): none
Acceptance retained from a replaced candidate (if any): n/a
Accepted winner and losing candidate disposition (when decided): n/a

Name a stack or proposed replacement explicitly. A proposed replacement
does not make its predecessor superseded. Shared files or a shared parent issue
alone do not establish duplication. If the relationship is unknown, record it
as needing reconciliation before disposing of either PR.

Scope

Quote only the capture-command redirect path inside snapshot_capture_hint after display_path, reusing crate::agent::loop_commands::shell_arg. Do not invent a second quoter, edit loop_commands.rs, change which capture command each caller names, or change non-NotFound wording.

Scope Classification

This PR is scoped by:

  • One production behavior
  • One public contract
  • One architectural seam
  • Docs/spec/test-only evidence package
  • Other:

Production delta:

  • crates/ripr/src/cli/commands.rs snapshot_capture_hint now interpolates shell_arg(displayed_path) into > {path} for Outcome and RepoExposure. CargoMutants still names cargo mutants with no path.

Evidence/support delta:

  • Unit proof through read_calibration_text for a space-containing path plus an unchanged unambiguous-path control.
  • CLI proof through outcome() with a filename that contains a space.
  • Existing per-kind / non-NotFound tests remain the capture-name and I/O-wording controls.
  • Changelog fragment changelog.d/7349-quote-snapshot-capture-redirect.md.

Single acceptance criterion:

  • For a missing snapshot whose displayed path contains a space, the recovery hint contains > {shell_arg(displayed_path)} and still starts with unquoted read {displayed_path} failed: not found.

Non-goals:

Support-tier Impact

  • none
  • updates docs/status/SUPPORT_TIERS.md
  • changes a README, release, docs, CLI, JSON, editor, CI, or package claim

Claim/proof notes:

  • Recovery-hint paste safety only. No schema, gate, or support-tier change.

Policy Impact

  • none
  • doc artifacts
  • CI lane
  • package boundary
  • lint / Clippy
  • no-panic
  • file policy
  • generated artifact
  • dependency
  • process/network

Ledger or exception notes:

  • changelog.d/** is already allowlisted.

Proof

cargo xtask worktree doctor
cargo xtask check-fast   # exact origin/main base, 0 files
cargo check -p ripr --all-targets   # exact base
cargo test -p ripr --lib -- quotes_spaced   # red before quoting
# then production quoting via shell_arg
cargo test -p ripr --lib -- quotes_spaced names_capture_command reports_read_failures non_not_found
cargo fmt
# cargo xtask precommit (after publication of this committed head)

Result, failures, or skipped proof:

  • Discriminator failed on unquoted > missing snapshot.json before the production change, then passed.
  • Existing capture-name and non-NotFound controls still pass.
  • Hosted required checks and precommit are not claimed here.

Claim Boundary

What may be claimed after this PR? What must not be claimed yet?

Rollback

How can this PR be reverted safely?

Revert the squash commit. The previous unquoted redirect returns; NotFound prefix and capture-command names are otherwise unchanged.

Spec-Test-Code Traceability

Static Language Check

  • Static output avoids killed, survived, untested, proven, and adequate.
  • Unknowns include stop reasons where applicable.

CI Economics

Complete this section when the PR changes workflows, policy gates, branch
protection expectations, CI artifacts, report uploads, release checks, or the
cost/posture of existing lanes. Use n/a for ordinary PRs that do not affect
CI behavior.

  • LEM impact: n/a
  • Workflows touched: n/a
  • Branch protection impact: n/a
  • Failure mode caught: n/a
  • Cheaper signal considered: n/a
  • Required lanes affected: n/a
  • Advisory lanes affected: n/a
  • On-demand/release lanes affected: n/a
  • Labels that alter behavior: n/a
  • Artifact families affected: n/a
  • Rollback path: n/a

Engineering Check

  • No new panic, unwrap, expect, todo, or unimplemented in production code.
  • No new panic, unwrap, expect, todo, or unimplemented in tests.
  • New non-Rust programming files are allowlisted with owner, surface, and reason.
  • New generated, dependency, process-spawn, or network surfaces are allowlisted with owner and reason.
  • Errors are reported with actionable context.
  • Public JSON/schema changes are documented.

Gates

Local focused proof as listed above. Hosted Ripr Rust Small Result is expected on Draft → Ready. Full workspace cargo test / Clippy / package dry-run are hosted merge-gate work, not duplicated locally before publication.

Extension changes:

  • cd editors/vscode && npm ci
  • cd editors/vscode && npm run compile
  • cd editors/vscode && npm run package

Closes #7349

Exact candidate SHA: 2f28d35ef9571bbf1743d5e4fc2ad4dcc69d5bb2

Open in Web Open in Cursor 

)

Reuse loop_commands::shell_arg on the already-displayed snapshot path so a
space in the pasted `> path` redirect stays one token. The `read {path}
failed: not found.` prefix stays unquoted; capture-command names and
non-NotFound wording are unchanged.

Closes #7349

Co-authored-by: Steven Zimmerman, CPA <EffortlessSteven@users.noreply.github.com>
@coderabbitai

coderabbitai Bot commented Oct 11, 2026 •

Copy link
Copy Markdown

Review in Change Stack →

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration
  • Configuration used: Organization UI
  • Review profile: ASSERTIVE
  • Plan: Advanced
  • Run ID: db908bfa-2c52-4818-a6d9-8bc1e305d622

📥 Commits

Reviewing files that changed from the base of the PR and between 779b72b and 2f28d35.


📒 Files selected for processing (2)
  • changelog.d/7349-quote-snapshot-capture-redirect.md
  • crates/ripr/src/cli/commands.rs

🔗 Linked repositories identified

CodeRabbit considers these linked repositories for cross-repo context during reviews:


Included review availability: This review used your included allowance. Your plan provides up to 10 included reviews per hour; 2 remain after this review.



Summary by CodeRabbit

  • Bug Fixes
    • Missing-snapshot messages from ripr outcome and ripr calibrate cargo-mutants now quote redirect paths that contain spaces, so the suggested commands handle those paths correctly.
    • Paths that do not require shell quoting remain unquoted. The read {path} failed: not found. message prefix continues to display the path without quotes.

Walkthrough

Missing-snapshot capture hints now shell-quote redirect paths when required. The displayed path in the NotFound error prefix remains unquoted. Tests cover calibration and outcome hints, including paths with and without spaces.

Changes

Snapshot redirect quoting

Layer / File(s) Summary
Quote capture hints and verify output
crates/ripr/src/cli/commands.rs, changelog.d/7349-quote-snapshot-capture-redirect.md
The redirect path in capture hints now passes through shell_arg. Tests cover calibration and outcome hints for paths with and without spaces. The NotFound prefix remains unquoted. The changelog records this change.

Priority: ➖ Normal

Estimated code review effort: 2 (Simple) | ~10 minutes

Change: Bug fix · Severity of issue fixed: Medium

Merge Risk: ⚪ Minimal · up to 2f28d

The change is limited to missing-snapshot redirect guidance. The supplied context indicates paths needing quotes are quoted, plain paths stay bare, and the error prefix remains unchanged; no actionable merge-blocking risk is established.

Architecture Summary

Architecture risk: 🔵 Low · up to 2f28d

The change affects 2 systems.

Changed systems: crates, changelog.d

Architecture concerns
No architecture-level concerns identified.

Review details

Systems and components

  • observed — crates (service) was modified; 1 changed file maps to changed impact.
  • observed — changelog.d (service) was modified; 1 changed file maps to changed impact.

Before / after behavior

  • observed — Modified behavior in changelog.d/7349-quote-snapshot-capture-redirect.md: Adds a changelog entry documenting the redirect-path quoting change for missing snapshot paths containing spaces and noting that the error prefix remains unquoted.
  • observed — Modified behavior in crates/ripr/src/cli/commands.rs: snapshot_capture_hint now passes the displayed path through shell_arg before embedding it in the repo-exposure redirect suggestions; the surrounding NotFound path remains unchanged, and other capture hints are unaffected.
  • observed — Modified behavior in crates/ripr/src/cli/commands.rs: Added tests confirming that calibration NotFound hints leave plain redirect paths unquoted and shell-quote paths containing spaces, while keeping the error prefix unquoted and preserving capture-hint distinctions by snapshot kind.
  • observed — Modified behavior in crates/ripr/src/cli/commands.rs: Added an outcome regression test verifying that a missing snapshot path containing spaces is shell-quoted in the suggested redirect, while the NotFound prefix retains the displayed path.

Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. (1 skipped: 1… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description check Passed The description is complete and follows the repository template. It documents scope, acceptance criteria, tests, proof status, non-goals, rollback, and claim boundaries.
Title check Passed The title clearly and concisely describes the main change: quoting redirect paths for outcome and calibrate NotFound messages.
Linked Issues check Passed Issue #7349 is active and directly linked. The PR summary reports that snapshot_capture_hint applies the existing crate::agent::loop_commands::shell_arg only to the capture-command redirect path. …
Out of Scope Changes check Passed The reported changes are limited to crates/ripr/src/cli/commands.rs and a changelog fragment. The production change supports issue #7349. The tests support the same behavior. The PR does not report …

Full details: Docstring Coverage

Explanation

Docstring coverage is 60.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 5 functions across 1 files. (1 skipped: 1 unsupported.)


  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR


🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

A rabbit sees a path with space,
And wraps it neatly in its place.
The error path stays bare and clear,
The capture command now works here.
Hop, hop, the snapshot’s near!

Comment @coderabbitai help to get the list of available commands.

@gemini-code-assist gemini-code-assist Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Code Review

This pull request ensures that the snapshot capture redirect path is properly quoted when it contains spaces, preventing issues when pasting the printed command. This is achieved by using shell_arg on the displayed path in snapshot_capture_hint. Additionally, comprehensive unit tests have been added to verify this behavior for both spaced and plain paths. There are no review comments, and I have no feedback to provide.

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 11, 2026 09:26

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

Author self-review on exact published head 2f28d35ef9571bbf1743d5e4fc2ad4dcc69d5bb2 (GitHub cannot REQUEST_CHANGES from the author; COMMENT is not approval).

reviewed_head_sha: 2f28d35ef9571bbf1743d5e4fc2ad4dcc69d5bb2
integration_basis: origin/main 779b72ba178d22b94f7973255fe277e91a500c95 (#7345 landed)
claim_boundary: Quote the NotFound capture-command `> {path}` redirect in snapshot_capture_hint after display_path by reusing loop_commands::shell_arg. Keep the `read {path} failed: not found.` prefix unquoted. Do not change capture-command names, non-NotFound wording, PowerShell quoting, loop_commands.rs, or #7343.
changed_surfaces_and_semantic_owners_inspected:
- production: crates/ripr/src/cli/commands.rs snapshot_capture_hint; consumers outcome() and calibrate cargo-mutants via read_calibration_text / read_calibration_mutants_json
- quoter: crate::agent::loop_commands::shell_arg (existing POSIX owner; not a new quoter; loop_commands.rs untouched)
- tests in the same module: spaced path + unambiguous control + existing per-kind and non-NotFound controls
- changelog.d/7349-quote-snapshot-capture-redirect.md
blocking_findings: none on source/oracle for this claim
non_blocking_suggestions:
- Apostrophe/metacharacter redirect coverage is out of claim; file a follow-up rather than expanding this head.
- calibrate CLI space-path is the same helper as the unit RepoExposure case; not a second owner.
refuted_or_stale_findings:
- CodeRabbit comment is quota/rate-limit (missing provider review), not a finding.
proof_and_ci_observed:
- Discriminator red on unquoted `> missing snapshot.json` before the production change; green after.
- cargo xtask precommit pass on this SHA (clippy -p ripr --all-targets -D warnings; policy gates).
- cargo xtask check-fast pass: 2 files (commands.rs + changelog fragment), clippy included.
- Hosted: Draft→Ready fired; Route Ripr Rust Small succeeded; Ripr Rust Small Result / required aggregator not yet terminal on this head.
proof_or_review_missing:
- Hosted required exact-head jobs and artifacts (Ripr Rust Small Result).
- External CodeRabbit review (quota).
- External droid-review still queued/in progress.
ffected_currentness_dimensions: production implementation, test stimulus, test oracle, public claim (changelog). conflict/integration unchanged (behind-only not applicable; branch is current with origin/main at publication).
residual_assumptions_and_non_claims:
- POSIX shell_arg only; no PowerShell apostrophe quoting.
- Prefix path remains display_path (human), not shell-quoted.
- CargoMutants hint still has no redirect path.
- Does not claim runtime mutation results or that all CLI printed commands are paste-safe.
disposition: REVIEW_INCOMPLETE

Source/oracle on this head are acceptable for the claim. Merge convergence waits on terminal required hosted checks for 2f28d35ef, then a published-head REVIEW_READY pass. Do not treat this COMMENT as approval.

@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

@github-actions github-actions 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.

Decision

  • Needs one verification check before upstream.

Verification questions

  • Confirm existing controls (capture-command name per kind, non-NotFound wording, I/O pass-through) remain guards because no hunk modifies their call paths.

Refuted

  • Quoting only the redirect while leaving the read {path} prefix raw creates a misleading hint when display_path contains shell metacharacters.; refuted because: Prefix is presented as human-readable error text (read ... failed: not found.), not as shell input; tests assert it stays unquoted by design. Redirect is the only paste-into-shell token and is now wrapped via shell_arg for both Outcome and RepoExposure. Limited blast radius keeps this minimal.
  • Snapshot path with spaces would still print unquoted because display_path normalises the path and snapshot_capture_hint would be skipped on Windows.; refuted because: Both Outcome/RepoExposure branches in the production hunk now interpolate shell_arg(displayed_path) into the > {path} token; new tests assert spaced redirect is quoted while a plain path stays bare and assert the read {path} failed: not found. prefix stays unquoted. CargoMutants branch has no path and is intentionally unchanged.

Parked follow-ups

  • No new test exercises SnapshotCaptureKind::CargoMutants with a spaced path even though the production change still routes CargoMutants through snapshot_capture_hint. CargoMutants text has no {path} so this is structurally inert, but it is an asymmetry worth noting for the proof ledger.

Evidence gaps

  • Model proof intent was rejected by deterministic validation.

@EffortlessSteven

Copy link
Copy Markdown
Member Author

ub-review on 2f28d35ef (Needs one verification check before upstream) is comment-only; it did not open a thread.

Verification: the existing controls remain guards. This head only interpolates shell_arg(displayed_path) inside snapshot_capture_hint (Outcome / RepoExposure redirect tokens). It does not change read_calibration_text's NotFound vs other-I/O branch, which capture command each kind names, or the CargoMutants hint text (no path).

Confirmed by the unchanged tests still in this tree:

  • read_calibration_text_names_capture_command_per_kind — per-kind capture names, including Outcome mentioning ripr check --json and CargoMutants naming cargo mutants without a repo-exposure redirect
  • outcome_command_reports_read_failures / calibrate_missing_inputs_name_the_caller_capture_command — same call paths, still asserting those capture names
  • outcome_non_not_found_read_error_keeps_raw_io_and_omits_capture_hint — non-NotFound still keeps the raw I/O reason and omits the capture hint

The parked CargoMutants spaced-path note is structurally inert (that arm has no {path}) and out of claim; not expanding this head. CodeRabbit's docstring-coverage warning is not a repository gate.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

ux(cli): quote outcome/calibrate NotFound capture-command redirect paths that contain spaces

2 participants