refactor(sessions::paths): move paths to own crate - #276
Conversation
📝 WalkthroughWalkthroughAdds a new top-level ChangesSessionId and paths crate refactoring
🎯 4 (Complex) | ⏱️ ~60 minutes Possibly related PRs
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 5✅ Passed checks (5 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches📝 Generate docstrings
Comment |
960aad3 to
dfb4a3c
Compare
There was a problem hiding this comment.
Caution
Some comments are outside the diff and can’t be posted inline due to platform limitations.
⚠️ Outside diff range comments (1)
crates/sessions/src/lib.rs (1)
23-37:⚠️ Potential issue | 🟠 Major | ⚡ Quick winMissing constructor from
Uuid.
SessionIdonly providesnil()andparse_str(), but there's no way to create one from an existingUuid. Callers that generate fresh IDs (e.g.,Uuid::new_v4()) would have to do an inefficient string round-trip.Consider adding a constructor and/or
From<Uuid>impl:Suggested additions
impl SessionId { + /// Creates a new session ID from an existing UUID. + #[must_use] + pub fn new(id: Uuid) -> Self { + Self(id) + } + #[must_use] pub fn nil() -> Self { Self(Uuid::nil()) }And optionally:
impl From<Uuid> for SessionId { fn from(id: Uuid) -> Self { Self(id) } }🤖 Prompt for AI Agents
Verify each finding against current code. Fix only still-valid issues, skip the rest with a brief reason, keep changes minimal, and validate. In `@crates/sessions/src/lib.rs` around lines 23 - 37, SessionId lacks a constructor from an existing Uuid which forces callers to stringify/parse; add a simple constructor (e.g., pub fn from_uuid(id: Uuid) -> Self or pub fn new(id: Uuid) -> Self) to SessionId and implement impl From<Uuid> for SessionId { fn from(id: Uuid) -> Self { Self(id) } } so callers can directly wrap Uuid::new_v4() without a string round-trip; update references to use the new constructor instead of parse_str where appropriate (symbols: SessionId, parse_str, nil, From<Uuid>).
🤖 Prompt for all review comments with AI agents
Verify each finding against current code. Fix only still-valid issues, skip the
rest with a brief reason, keep changes minimal, and validate.
Outside diff comments:
In `@crates/sessions/src/lib.rs`:
- Around line 23-37: SessionId lacks a constructor from an existing Uuid which
forces callers to stringify/parse; add a simple constructor (e.g., pub fn
from_uuid(id: Uuid) -> Self or pub fn new(id: Uuid) -> Self) to SessionId and
implement impl From<Uuid> for SessionId { fn from(id: Uuid) -> Self { Self(id) }
} so callers can directly wrap Uuid::new_v4() without a string round-trip;
update references to use the new constructor instead of parse_str where
appropriate (symbols: SessionId, parse_str, nil, From<Uuid>).
ℹ️ Review info
⚙️ Run configuration
Configuration used: Organization UI
Review profile: CHILL
Plan: Pro
Run ID: cde5a729-1da7-42c0-b71c-5921fb4cde16
⛔ Files ignored due to path filters (1)
Cargo.lockis excluded by!**/*.lock
📒 Files selected for processing (16)
Cargo.tomlcrates/minimald/Cargo.tomlcrates/minimald/src/main.rscrates/minimald/src/rpc.rscrates/minimald/src/server.rscrates/minimald/src/session.rscrates/minimald/src/sessions.rscrates/minimald/src/sftp.rscrates/minimald/src/test_harness.rscrates/paths/Cargo.tomlcrates/paths/src/lib.rscrates/sessions/Cargo.tomlcrates/sessions/src/lib.rscrates/sessions/src/lifecyclehook.rscrates/sessions/src/patches.rscrates/sessions/src/store.rs
✅ Files skipped from review due to trivial changes (4)
- crates/paths/Cargo.toml
- crates/minimald/src/session.rs
- crates/minimald/src/main.rs
- crates/sessions/src/lifecyclehook.rs
🚧 Files skipped from review as they are similar to previous changes (11)
- crates/minimald/src/server.rs
- Cargo.toml
- crates/minimald/Cargo.toml
- crates/sessions/src/patches.rs
- crates/paths/src/lib.rs
- crates/sessions/Cargo.toml
- crates/minimald/src/test_harness.rs
- crates/minimald/src/rpc.rs
- crates/minimald/src/sftp.rs
- crates/minimald/src/sessions.rs
- crates/sessions/src/store.rs
dfb4a3c to
483e958
Compare
The diffbase includes #275 which hasnt merged yet cuz slow, but otherwise this is a mechanical change to movesessions::paths(which is bigggg and we want to use it everywhere) to its own crate.Summary by CodeRabbit
Refactor
Documentation