Repository navigation
Conversation
`rtk discover` scans zero sessions on Windows and reports "No missed savings found. RTK usage looks good!" Claude Code's history folder for `C:\DEV\proj` is `c--DEV-proj`, with a lowercased drive letter. `encode_project_path` gets `C:\DEV\proj` from `current_dir()` and produces `C--DEV-proj`, and the filter match is case-sensitive, so no project directory is ever selected. Same silent zero as the drive-letter colon in rtk-ai#2919, one character along. MEASURED, Windows 11, two machines: bare 0 sessions, 0 commands "looks good!" --project <folder name> 3 sessions, 3,872 commands second machine, bare 0 sessions second machine, filtered 325 sessions, 69,910 commands Both callers (discover and learn) build the filter the same way, so the comparison is fixed where they share it. Off Windows paths are case-sensitive and the match stays exact. Also: zero sessions scanned no longer prints the clean-bill line. The report already guards one false "looks good" (the RTK_DISABLED bypass); this is the same defect reached through an empty scan, and the absence of evidence was reading as evidence of absence. Co-Authored-By: Claude Opus 5 <[email protected]>
There was a problem hiding this comment.
Copilot review overview
🟢 Approval recommended
The changes are focused, tested, and no unresolved correctness issues were identified.
Review effort: Lite
Findings: None
What changed in this PR
Fixes Windows project discovery by matching encoded project directories case-insensitively and prevents zero-session scans from reporting a clean bill of health.
Changes:
- Added Windows-specific case-insensitive project matching.
- Added a clear zero-session report message.
- Added platform-specific and regression tests.
| File | Description |
|---|---|
src/discover/provider.rs |
Updates project matching and adds discovery tests. |
src/discover/report.rs |
Handles empty scans without claiming RTK usage is healthy. |
💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
📊 Automated PR Analysis
SummaryFixes rtk discover/learn silently scanning zero sessions on Windows because the project-folder filter compared drive-letter case exactly (e.g. 'c--DEV-proj' vs 'C--DEV-proj'), causing a false 'RTK usage looks good!' message. Also changes the report formatter so that zero scanned sessions no longer renders as a clean-bill-of-health message, instead prompting the user to check the filter or use --all. Review Checklist
Analyzed automatically by wshm · This is an automated analysis, not a human review. |
|
Closing this as a duplicate of two older PRs that together carry both of its changes. #2931 has matched the project folder case-insensitively on Windows since July, with the same helper shape and a before/after measured on a Windows machine, and its tests run on every platform. #3374 handles the zero-sessions report line, and also tells a current-project scan from an all-projects one so it only suggests |
Summary
rtk discover(andrtk learn, same filter) scans zero sessions and printsNo missed savings found. RTK usage looks good!C:\DEV\projisc--DEV-proj— lowercased drive letter.encode_project_pathreceivesC:\DEV\projfromcurrent_dir()and producesC--DEV-proj, and the filter match is case-sensitive, so no project directory is ever selected.Measured, Windows 11, two machines
rtk discover(bare)rtk discover --project <folder name>--projectWith this patch, bare
rtk discoveron the first machine: 3 sessions, 3,887 commands.The failure direction is what makes it worth fixing rather than documenting: a user who has never routed a single command through rtk is told their usage looks good. Both people who hit it here assumed the tool had measured something.
The second change
format_textalready guards one false "looks good" — theRTK_DISABLEDbypass, with a comment saying exactly why. An empty scan reaches the same line by a different road, so zero sessions now says nothing was analysed and points at--project/--all.Test plan
cargo fmt --checkclean,cargo clippy --all-targetscleancargo test --bin rtk discover::— 634 passed, 0 failedc--DEV-…is found through the directory walk when the filter saysC--DEV-…; and zero sessions never renders the clean-bill line.assertion failed: project_dir_matches(...)). The report test fails against the old formatter for the same reason.rtk discoverin a project that previously reported 0.cargo test --bin rtk: the only failures are 17 pre-existingcore::streamcases ("program not found") that reproduce identically on a stockdevelopcheckout on this machine.I kept this separate from #4141, which touches
hooks::init— different area, different defect, though both are "reported success over nothing done".