Repository navigation
fix(init): render follow-up command roots without a trailing /. - #8650
EffortlessSteven wants to merge 3 commits into
Conversation
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XPNmeJoSKoX2dJijL5sy3F
|
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 20 minutes. View limit details
Comment |
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XPNmeJoSKoX2dJijL5sy3F
Exact-Head Review (review-pr) |
|
The blocking finding (changelog entry without a PR reference) is already repaired in head 8f8a759: the fragment now ends with 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! |
There was a problem hiding this comment.
Decision
- Needs verification checks before upstream.
Verification questions
- Confirm assertion for Path::new("./sub") only checks format!("{expected}/sub"), which assumes the OS uses '/' separator; on Windows this can still pass because human_path normalizes to '/', but the test never exercises an absolute-root branch or a root that is itself "." after env::current_dir normalization.
- Confirm test suite asserts a single relative case (
.) and one sub-segment case (./sub). No coverage for deeper, parent, or trailing-separator inputs; created path uses env::current_dir() which could be non-deterministic in CI under cd. - Confirm single heading drop CurDir filter is locale- and OS-stable for Path joining, but the broader cli_smoke path test is the only end-to-end witness; reviewer should not overclaim multi-platform correctness without future Windows verification.
Refuted
- The new test could be green under the old (un-stripped) behavior if human_path silently swallows trailing /.; refuted because: human_path is a textual renderer that does not synthesize CurDir; an explicit trailing "/." in the joined path renders verbatim, so the equality check fails before and passes after.
- A new helper should be introduced to strip the trailing /. so the formatting logic stays reusable.; refuted because: The only public-facing render of the follow-up root already flows through absolute_command_root_display; introducing a new helper would widen the API surface without an existing second caller, violating smallest-complete-fix.
- Normalization in absolute_command_root_display drops only CurDir via filter, leaving Prefix/RootDir/ParentDir/Normal untouched. Tested by require_lossless_command_path round-trip.
- The
.components().filter()re-collection could fail on Windows because ofComponent::Prefix(verbatim ?\C:) or backslash-separated prefix components being mishandled by PathBuf::collect.; refuted because: Filter only matches CurDir; Prefix/RootDir components pass through unchanged; human_path & require_lossless_command_path normalize separators.
Parked follow-ups
- Changelog fragment claims the trailing
/.problem applies specifically to the default-root-with-.case; the diff's filter actually strips CurDir universally on the cwd branch. Doc-vs-code mismatch is submaterial but worth noting in a follow-up.
Evidence gaps
- No CLI smoke oracle was located in receipts; cli_smoke init test is mentioned in PR body but absence in available receipts leaves oracle coverage of the rendered
--root ...strings unverified at system level.
…ng /. Co-Authored-By: Claude Sonnet 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01XPNmeJoSKoX2dJijL5sy3F
There was a problem hiding this comment.
Decision
- Needs reviewer attention before upstream: findings remain.
Confirmed findings
- Test determinism depends on
env::current_dir(); under CIcd/sandbox it can be non-deterministic and mask the comparison. The unit test does not pin cwd. - Windows/multi-platform parity for the new trailing-
/.invariant relies onhuman_path's separator normalization; no Windows CI receipt in current evidence. Not a blocker; park as future matrix coverage.
Verification questions
- Confirm no oracle coverage for absolute-root branch, parent-component inputs (
..), trailing-separator inputs, or non-determinism ofenv::current_dir()under CIcd; unit test is the only end-to-end witness for the strip. - Confirm limited sibling scan: only checked callers of absolute_command_root_display inside the ripr crate; other crates or future helpers that join relative paths onto cwd were not enumerated, so a 'no other affected sites' claim would be overreach.
Refuted
- The new unit test could be green under the old (un-stripped) behavior if human_path silently swallows trailing
/..; refuted because: human_path is a textual renderer that does not synthesize or collapse CurDir components;cwd.join(".")rendered via human_path retains the trailing/.literal, so the equality check fails before the patch. - Multi-platform risk: Path::Component::CurDir filter may mis-handle Windows drive-relative paths like '.\foo'.; refuted because: Component::CurDir is the POSIX/Windows-agnostic 'current dir' segment produced by std::path::join on both platforms; filtering it after cwd.join(root) is OS-stable for the textual cases the unit test exercises.
- The fix should be hoisted into
human_path(shared renderer) so all display surfaces strip CurDir.; refuted because:human_pathis a stable renderer used by many call sites; introducing CurDir normalization there broadens behavior beyond the documented acceptance delta and risks normalizing paths users deliberately constructed. Local filter in the one helper that materializes cwd+relative is smallest correct surface.
Parked follow-ups
- Unit proof covers '.' and './sub' but no deeper case (parent dirs, multi-segment relative root with internal '.', or trailing separator). Existing cli_smoke guard catches trailing '/.' only; not multi-segment internal '.' regressions. Not blocking given narrow scope of init follow-up rendering.
|
Warning You have reached your daily quota limit. Please wait up to 24 hours and I will start processing your requests again! |
|
Generated by Claude Code |
|
Closing as superseded. On current main, Generated by Claude Code |
Requested by Steven Zimmerman · project thread
Governing issue or accepted claim: #2379 (0.11 release map; newcomer first-run polish, no dedicated issue)
Acceptance delta (one sentence):
ripr initfollow-up commands name the selected root without a trailing/..Before: after
ripr init, the "Next:" commands printed--root /abs/path/.for the default root.After: they print
--root /abs/path.How:
output/path.rsdrops.components when joining a relative root onto the cwd; unit test, a cli_smoke assertion and a changelog fragment added.cargo xtask precommitandcli_smoke inittests pass locally.🤖 Generated with Claude Code
https://claude.ai/code/session_01XPNmeJoSKoX2dJijL5sy3F