| 262 | } |
| 263 | |
| 264 | pub fn resolve_layout_for_current_profile(project_root: &Path) -> Result<StoreLayout> { |
| 265 | match read_enrollment_marker(project_root)? { |
| 266 | Some(marker) if marker.storage_mode == StorageMode::ProfileSharded => { |
| 267 | let profile_root = default_profile_root()?; |
| 268 | profile_sharded_layout(project_root, &profile_root, &marker) |
| 269 | } |
| 270 | Some(marker) => Err(TraceDecayError::Config { |
| 271 | message: format!( |
| 272 | "unsupported storage_mode={:?} in enrollment marker for '{}'; \ |
| 273 | run TraceDecay migration to move this project into the user profile store", |
| 274 | marker.storage_mode, |
| 275 | project_root.display() |
| 276 | ), |
| 277 | }), |
| 278 | None => { |
| 279 | let profile_root = default_profile_root()?; |
| 280 | default_profile_sharded_layout(project_root, &profile_root) |
| 281 | } |
| 282 | } |
| 283 | } |
| 284 | |
| 285 | pub fn resolve_project_session_db_path(project_root: &Path) -> Result<PathBuf> { |
| 286 | Ok(resolve_layout_for_current_profile(project_root)?.sessions_db_path) |