fix: reject empty, whitespace, and control-character session names - #1041
Conversation
Session rename and activate --name accepted empty, whitespace-only, and control-character names. A tab or newline in a name then corrupted two downstream surfaces: complete-session-str's "one value<TAB>description per line" contract (a tab splits the value, a newline forges a phantom completion candidate) and the min ls table's column alignment. Validate names in the sessions store, beside the existing name-collision check, at the two real writers of a name: create (the activate --name path) and save (the production rename path — the daemon's rename flows through save, not the store's rename helper). Names must be non-empty, free of leading/trailing whitespace, and free of control characters. Fixes #1037
|
Warning Review limit reachedYou’ve reached a temporary PR review limit under our Fair Usage Limits Policy. Next review available in: 12 minutes Enable usage-based reviews in Billing to review now. Otherwise, wait until the next included review is available. How can I continue?After more reviews become available, a review can be triggered using the To avoid repeated limits, reduce automatic review volume by pausing incremental auto-reviews earlier, using label-based review opt-in, excluding WIP or generated PR titles, or requesting reviews manually when the PR is ready. If your team needs uninterrupted high-volume reviews, an organization admin can enable usage-based reviews. How do review limits work?CodeRabbit enforces per-developer PR review limits for each organization. Most developers receive the normal plan review availability. For paid Pro and Pro+ PR reviews, CodeRabbit uses adaptive limits for sustained high-volume activity. When a developer's recent PR review activity reaches the 95th percentile or higher among CodeRabbit users, additional reviews become available more gradually as earlier reviews age out of the rolling window. Please refer docs for additional details. Review details⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
Comment |
Fixes #1037
Routing-Key: inbox-route/I_kwDOSUhdos8AAAABKmgj5w
Session
renameandactivate --nameaccepted empty, whitespace-only, and control-character names. A tab or newline then corruptedcomplete-session-str's one-value<TAB>description-per-line contract (a tab splits the value; a newline forges a phantom completion candidate) and themin lstable's column alignment. The fix validates names in the sessions store, beside the existing name-collision check, at the two real writers of a name:create(the activate --name path) andsave. The daemon's rename flows throughsave, not the store'srenamehelper, so gatingsaveis what actually covers rename. Names must be non-empty, free of leading/trailing whitespace, and free of control characters. No load-bearing Distillery precedent found (scoped to projectminimal).Verification
cargo fmt --all --check --manifest-path target/Cargo.toml — clean
cargo clippy --workspace --locked -- -D warnings — Finished, 0 warnings
cargo build --workspace --locked — Finished
devin 4m 34scargo test --workspace --locked — all pass, incl. 4 new store::tests (create/rename reject control chars; validator unit tests)
Note
Reject empty, whitespace, and control-character session names in
DiskLoaderAdds a
validate_session_namehelper in store.rs that rejects names that are empty, all-whitespace, have leading/trailing whitespace, or contain control characters.DiskLoader::createcallsvalidate_session_namebefore the existing collision check, returningInvalidInputfor invalid names.DiskLoader::savevalidates the new name before the uniqueness check when a rename is attempted, leaving the original name intact on failure.InvalidInput.Macroscope summarized 67512ab.