Skip to content

fix(cli): render cache Real dir through human_path - #7482

Merged
EffortlessSteven merged 1 commit into
mainfrom
cursor/cache-real-dir-human-path-be7c
Oct 12, 2026
Merged

EffortlessSteven merged 1 commit into
mainfrom
cursor/cache-real-dir-human-path-be7c

Conversation

@EffortlessSteven

Copy link
Copy Markdown
Member

Summary

On Windows, ripr cache status still printed the human Real dir: alias line from Path::display(), so a canonicalized drive-letter path leaked the verbatim prefix after #7326 / PR #7333 cleaned only Cache dir:. This PR routes that alias line through the shared output::path::human_path renderer.

  • 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 / Source Boundary

Ordinary CLI human-output repair on ripr-swarm. No crates.io, marketplace, or release-secret surface.

Source-of-truth Links

Proposal: n/a (verified current UX defect; follow-up of #7326)
Spec: existing human_path / human_path_text owner (crates/ripr/src/output/path.rs, #4378)
ADR: n/a
Plan item: n/a
Governing issue or accepted claim: Closes #7343
Acceptance delta (one sentence): human Real dir: for a drive-letter verbatim path renders without the verbatim prefix; JSON real_cache_dir stays Path::display.

Candidate Relationships

Candidate branch (GitHub PR head is authoritative after publication): cursor/cache-real-dir-human-path-be7c
Stack parent or prerequisite PR (if any): none (lands on current main after #7333)
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

No equivalent open or recently merged PR implements this claim (searched current source, all-state PRs, and #7343). #7333 owns Cache dir: only. #7349 / #7360 and #7328 remain separate.

Scope

Human Real dir: rendering in cache status.

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:

  • render_status_for_host human branch calls real_dir_human_line_for_host, which uses output::path::human_path_text, matching Cache dir: / doctor.

Evidence/support delta:

  • Host-parameterised renderer test with a synthetic verbatim path and real_dir: Some (windows=true strips the prefix; windows=false keeps it; JSON keeps Path::display).
  • Removal experiment: the same test failed on the pre-repair real.display() helper.
  • Existing alias-disclosure test still requires the Real dir: suffix copy.
  • Changelog fragment changelog.d/7343-cache-real-dir-human-path.md.

Single acceptance criterion:

  • Human Real dir: for a drive-letter verbatim path renders without the verbatim prefix; --json real_cache_dir remains the Path::display spelling.

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:

  • Human CLI spelling 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

git diff --name-only origin/main...HEAD
# changelog.d/7343-cache-real-dir-human-path.md
# crates/ripr/src/cli/commands/cache.rs

cargo xtask worktree doctor
cargo xtask check-fast   # exact origin/main base, 0 files; then candidate, 2 files
cargo check -p ripr --all-targets   # exact base
cargo test -p ripr --lib -- cli::commands::cache_command::tests::render_status_human_real_dir_strips_windows_verbatim_prefix
# red before human_path_text: Path::display() leaked \\?\
cargo test -p ripr --lib -- cli::commands::cache_command::tests
cargo xtask precommit

Result, failures, or skipped proof:

  • Discriminator failed on the pre-repair real.display() line, then passed after routing through human_path_text.
  • Full cache_command unit module: 23 passed.
  • cargo xtask precommit passed on 98cf104d588a25a576e6f379042c592790bdcd1a.
  • Native Windows CLI not run here; Windows rendering is proved through render_status_for_host(..., windows=true).
  • Hosted required checks are not claimed here.

Claim Boundary

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

  • May claim: human Real dir: in cache status uses the shared human path renderer.
  • Must not claim: JSON identity change; cache resolution change; doctor change; native Windows CI as already observed; runtime mutation adequacy; that clear-refusal copy is cleaned.

Rollback

How can this PR be reverted safely?

Revert the squash commit. The previous human Real dir: spelling returns to Path::display().

Spec-Test-Code Traceability

Static Language Check

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

CI Economics

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

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 and precommit 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 #7343

Exact candidate SHA: 98cf104d588a25a576e6f379042c592790bdcd1a

Open in Web Open in Cursor 

Route the human cache-status alias line through the shared host-parameterised
human_path renderer so a Windows drive-letter verbatim prefix is stripped the
same way Cache dir already is. JSON real_cache_dir stays Path::display.

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

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

review-pr (author self-review, COMMENT)

GitHub cannot request changes from the author; this COMMENT is the review record, not approval.

reviewed_head_sha: 98cf104d588a25a576e6f379042c592790bdcd1a
integration_basis: origin/main at branch time e75f17b15a9ce011baf467603114928081eb2f8c (PR base may have moved; behind-only, no restack)
claim_boundary: human cache-status Real dir line uses human_path_text; JSON real_cache_dir stays Path::display; no resolution/canonicalize/doctor/path.rs/#7349/#7328 work
changed_surfaces_and_semantic_owners_inspected:
- crates/ripr/src/cli/commands/cache.rs render_status_for_host / real_dir_human_line_for_host (CLI owner)
- output::path::human_path_text reused, not forked (path.rs untouched)
- JSON real_cache_dir still Path::display; via_symlink still real_dir.is_some()
- classify_cache_root clear-refusal still real.display() (out of claim)
- changelog.d/7343-cache-real-dir-human-path.md Fixed fragment
blocking_findings: none on source/oracle for this claim
non_blocking_suggestions:
- clear-refusal copy still prints Path::display of the canonical path; same class of Windows leak as #7343 but out of this claim. Do not fold it in; file a follow-up if wanted.
affected_currentness_dimensions: production implementation, test stimulus, test oracle, public claim (changelog)
residual_assumptions_and_non_claims:
- Native Windows CLI of an aliased cache is not observed; Windows spelling is proved through render_status_for_host(..., windows=true) with a synthetic \\?\\ path and real_dir: Some.
- JSON identity, cache resolution, doctor, and clear-refusal copy are unchanged by design.
proof_and_ci_observed:
- Discriminator failed on pre-repair real.display() (verbatim Real dir line), then passed after human_path_text.
- cargo test -p ripr --lib -- cli::commands::cache_command::tests: 23 passed
- cargo xtask check-fast: 10 gates, 2 files, base=origin/main
- cargo xtask precommit: pass on this SHA
proof_or_review_missing: hosted required checks, artifacts, and external review (PR is newly published)
disposition: REVIEW_INCOMPLETE until the exact published head has current hosted required-check evidence; source/oracle for the claim are otherwise ready.

Inspected the complete 2-file diff. Production change is one helper plus one call site. The host-parameterised test independently computes the stripped drive-letter path, keeps the Unix verbatim spelling, pins JSON real_cache_dir to Path::display, and requires real_dir: Some to emit the line. Restoring Path::display() is a failing control (observed before the repair).

@EffortlessSteven
EffortlessSteven marked this pull request as ready for review October 12, 2026 07:25

@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 updates the ripr cache status command to format the human-readable Real dir: output using the shared human_path renderer, ensuring Windows drive-letter verbatim prefixes are stripped consistently with the Cache dir: output. It also adds a comprehensive test to verify this behavior on Windows and Unix paths, while keeping the raw path in the JSON output. Feedback on the test code suggests simplifying the JSON field lookups by using direct immutable indexing (e.g., value["key"]) instead of .get().and_then(...), which is safe and more concise.

Comment thread crates/ripr/src/cli/commands/cache.rs Resolved
@coderabbitai

coderabbitai Bot commented Oct 12, 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: a7603962-9f33-4264-b039-ba16da2cded1


📥 Commits

Reviewing files that changed from the base of the PR and between b54f0ae and 98cf104.



📒 Files selected for processing (2)
  • changelog.d/7343-cache-real-dir-human-path.md
  • crates/ripr/src/cli/commands/cache.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; 0 remain after this review.




Summary by CodeRabbit

  • Bug Fixes
    • The human-readable ripr cache status output now displays the real cache directory without a Windows verbatim-path prefix, matching the formatting used for the cache directory.
    • JSON output continues to preserve the real cache directory’s original path spelling and alias information.

Walkthrough

The human Real dir: line in ripr cache status now uses host-aware path rendering. JSON output continues to preserve the raw real_cache_dir path and alias fields.

Changes

Cache alias path rendering

Layer / File(s) Summary
Render and verify the real directory path
crates/ripr/src/cli/commands/cache.rs, changelog.d/7343-cache-real-dir-human-path.md
A helper renders the human Real dir: line with the host-aware path renderer. Tests check Windows prefix stripping, Unix spelling preservation, omission when no resolved directory is supplied, and unchanged JSON path and alias values. The changelog records the change.

Priority: ⬇️ Low

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

Change: Bug fix · Severity of issue fixed: Low

Merge Risk: ⚪ Minimal · up to 98cf1

The change is ready to merge after normal checks. No actionable risk remains in the reviewed cache-status behavior.

Architecture Summary

Architecture risk: 🟡 Medium · up to 98cf1

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/7343-cache-real-dir-human-path.md: Added a fixed-change changelog entry documenting the Real dir: human-path rendering and the unchanged JSON real_cache_dir identity.
  • observed — Modified behavior in crates/ripr/src/cli/commands/cache.rs: Added a helper that formats the human Real dir: alias disclosure using the host-aware path renderer and retains the existing alias explanation.
  • observed — Modified behavior in crates/ripr/src/cli/commands/cache.rs: Updated the JSON-rendering comment to distinguish raw Path::display() machine paths from both human Cache dir: and Real dir: paths rendered with human_path.
  • observed — Modified behavior in crates/ripr/src/cli/commands/cache.rs: Replaced inline Real dir: formatting with the shared helper, so the human alias path uses host-aware rendering instead of Path::display().

Reliability and maintainability

  • inferred — Risk-relevant change factors for crates: blast_radius_2; blast_radius_3; direct_dependents_2


Pre-merge checks | Passed 4 | Failed 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage Warning Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 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
Linked Issues check Passed The PR meets the coding requirements in #7343. In crates/ripr/src/cli/commands/cache.rs, real_dir_human_line_for_host formats the human Real dir: value with output::path::human_path_text, and …
Out of Scope Changes check Passed The changes stay within #7343. The production change is limited to human Real dir: rendering in cache status. The added tests verify the requested behavior, and the changelog entry documents the s…
Title check Passed The title clearly and concisely identifies the main change: routing the cache status Real dir: output through human_path.
Description check Passed The description is complete and relevant. It documents the scope, source links, acceptance criterion, tests, proof results, limitations, rollback, traceability, policy impact, and CI impact.

Full details: Docstring Coverage

Explanation

Docstring coverage is 57.14% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 7 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 checked the cache one day
The Real dir: path now trims away
A Windows prefix from the view
While JSON keeps its spelling true
The rabbit hops along its way

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

@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 reviewer attention before upstream: findings remain.

Confirmed findings

  • Only one new test case covers three sub-behaviors (none_human absence, Windows stripping, Unix passthrough, JSON identity, helper drift). These are related but distinct invariants; if a reviewer wants tighter coverage per behavior, splitting them would help. Not a blocker since the test is correctly named and the assertions are explicit.

Verification questions

  • Confirm render_status_human_real_dir_strips_windows_verbatim_prefix is a red-then-green oracle: PR body documents it failed on pre-repair real.display() and now exercises Windows strip, Unix preserve, JSON identity, and helper drift check, all without a native Windows host.

Refuted

  • Audit by gemini-code-assist suggesting value["key"] immutable indexing over .get().and_then(...).; refuted because: Author replied in the thread that this is a style nit, not a defect, and chose consistency with the sibling oracle (render_status_human_cache_dir_strips_windows_verbatim_prefix) and fail-closed semantics. Both forms are equivalent for immutable access, and the existing module convention is the higher-order principle.
  • real_dir_human_line_for_host should be promoted to output/path.rs to avoid future duplication; refuted because: Helper carries cache-specific copy ('ripr cache clear requires the real path') that couples it to the CLI command; renderer primitive human_path_text is already shared. Moving the copy to output would create cross-surface coupling and a name collision with cache_dir_human_line_for_host.

Parked follow-ups

  • Clear-refusal copy (classify_cache_root) still prints real.display() of a canonical Windows path — same class of leak as #7343 but explicitly out of this claim; parked as non-blocking follow-up matching author self-review note.
  • clear-refusal copy in classify_cache_root still prints real.display() and could leak the same verbatim prefix. Author flags it as a parked follow-up; not in this PR's claim boundary.
  • Clear-refusal copy in classify_cache_root still uses Path::display() of a canonical Windows path, which can leak a \\?\ verbatim prefix on Windows. Same class of defect as #7343 but explicitly out of scope per the PR body and author self-review; park as a follow-up issue rather than fold into this PR.
  • clear-refusal copy in classify_cache_root still uses real.display(); same Windows ?\ leak class as #7343 and out of this claim; author explicitly scoped do-not-flip-in, file as follow-up.

@EffortlessSteven

EffortlessSteven commented Oct 12, 2026 •

Copy link
Copy Markdown
Member Author

Addressing the GitHub Actions review on 98cf104d588a25a576e6f379042c592790bdcd1a:

  • Test packing (confirmed, not a blocker). Keeping one render_status_for_host test is intentional: it is the host-parameterised seam the claim asked for, matching render_status_human_cache_dir_strips_windows_verbatim_prefix. The assertions are independent (absence when real_dir is None, Windows strip, Unix preserve, JSON Path::display, helper drift). Splitting would not change discrimination. No head churn.
  • Red-then-green oracle. Confirmed by local execution: the new test failed on pre-repair real.display() with Real dir: \\?\F:\code\myrepo\target\ripr\cache …, then passed after human_path_text. Windows spelling is proved through windows=true without a native Windows host.
  • Parked clear-refusal leak. Out of this claim. Follow-up: ux(cli): cache clear refusal still prints Path::display of a canonical Windows path #7487.

CodeRabbit's docstring-coverage warning is a bot threshold on untouched helpers, not a repository gate. Gemini's .get() nit remains resolved as a style nit. Head stays on 98cf104d588a25a576e6f379042c592790bdcd1a.

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): ripr cache status prints the raw \\?\ verbatim path on the human Real dir line

2 participants