Repository navigation
fix(cli): render cache Real dir through human_path - #7482
Conversation
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
left a comment
There was a problem hiding this comment.
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).
There was a problem hiding this comment.
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.
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info
Summary by CodeRabbit
WalkthroughThe human ChangesCache alias path rendering
Priority: ⬇️ Low Estimated code review effort: 2 (Simple) | ~10 minutes Change: Bug fix · Severity of issue fixed: Low Merge Risk: ⚪ Minimal · up to The change is ready to merge after normal checks. No actionable risk remains in the reviewed cache-status behavior. Architecture SummaryArchitecture risk: 🟡 Medium · up to The change affects 2 systems. Changed systems: Architecture concerns Review details
Pre-merge checks |
|
There was a problem hiding this comment.
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_prefixis a red-then-green oracle: PR body documents it failed on pre-repairreal.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 printsreal.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_rootstill usesPath::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.
|
Addressing the GitHub Actions review on
CodeRabbit's docstring-coverage warning is a bot threshold on untouched helpers, not a repository gate. Gemini's |
Summary
On Windows,
ripr cache statusstill printed the humanReal dir:alias line fromPath::display(), so a canonicalized drive-letter path leaked the verbatim prefix after #7326 / PR #7333 cleaned onlyCache dir:. This PR routes that alias line through the sharedoutput::path::human_pathrenderer.ripr-swarmSwarm / 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_textowner (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; JSONreal_cache_dirstaysPath::display.Candidate Relationships
Candidate branch (GitHub PR head is authoritative after publication):
cursor/cache-real-dir-human-path-be7cStack parent or prerequisite PR (if any): none (lands on current
mainafter #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 incache status.Scope Classification
This PR is scoped by:
Production delta:
render_status_for_hosthuman branch callsreal_dir_human_line_for_host, which usesoutput::path::human_path_text, matchingCache dir:/ doctor.Evidence/support delta:
real_dir: Some(windows=truestrips the prefix;windows=falsekeeps it; JSON keepsPath::display).real.display()helper.Real dir:suffix copy.changelog.d/7343-cache-real-dir-human-path.md.Single acceptance criterion:
Real dir:for a drive-letter verbatim path renders without the verbatim prefix;--jsonreal_cache_dirremains thePath::displayspelling.Non-goals:
real_cache_dir/cache_diridentitycanonicalizeripr doctor(doctor.rsuntouched)output/path.rs(existinghuman_path_textis sufficient)Path::display)Support-tier Impact
docs/status/SUPPORT_TIERS.mdClaim/proof notes:
Policy Impact
Ledger or exception notes:
changelog.d/**is already allowlisted.Proof
Result, failures, or skipped proof:
real.display()line, then passed after routing throughhuman_path_text.cache_commandunit module: 23 passed.cargo xtask precommitpassed on98cf104d588a25a576e6f379042c592790bdcd1a.render_status_for_host(..., windows=true).Claim Boundary
What may be claimed after this PR? What must not be claimed yet?
Real dir:incache statususes the shared human path renderer.Rollback
How can this PR be reverted safely?
Revert the squash commit. The previous human
Real dir:spelling returns toPath::display().Spec-Test-Code Traceability
output::path::human_path/human_path_text(ux(onboarding): mode-guidance pointer, help agent repair delegation, doctor Windows hints, separator consistency #4378)cli::commands::cache_command::tests::render_status_human_real_dir_strips_windows_verbatim_prefix; existingstatus_render_discloses_foreign_and_alias_fieldscrates/ripr/src/cli/commands/cache.rsreal_dir_human_line_for_host/render_status_for_hosthuman_pathcontract; no LEARNINGS.md deltaStatic Language Check
killed,survived,untested,proven, andadequate.CI Economics
Engineering Check
panic,unwrap,expect,todo, orunimplementedin production code.panic,unwrap,expect,todo, orunimplementedin tests.Gates
Local focused proof and
precommitas listed above. HostedRipr Rust Small Resultis expected on Draft → Ready. Full workspacecargo test/ Clippy / package dry-run are hosted merge-gate work, not duplicated locally before publication.Extension changes:
cd editors/vscode && npm cicd editors/vscode && npm run compilecd editors/vscode && npm run packageCloses #7343
Exact candidate SHA:
98cf104d588a25a576e6f379042c592790bdcd1a