(repo: &Repository, session_id: &str, json: bool)
| 230 | } |
| 231 | |
| 232 | fn show_session_detail(repo: &Repository, session_id: &str, json: bool) -> CliResult<()> { |
| 233 | let (record, turns) = repo |
| 234 | .get_session_ledger(session_id) |
| 235 | .map_err(CliError::Repository)? |
| 236 | .ok_or_else(|| CliError::VaultEntityNotFound { |
| 237 | kind: "session", |
| 238 | id: session_id.to_string(), |
| 239 | // No hint: there is no session-listing command to point at, and the |
| 240 | // id comes from the caller's own ledger rather than something a |
| 241 | // user would create on demand. |
| 242 | hint: None, |
| 243 | })?; |
| 244 | |
| 245 | // The routed pieces the render needs: turn→intent resolution and the |
| 246 | // session manifest data. |
| 247 | let turn_intents = build_turn_intent_map(repo, session_id); |
| 248 | let head = repo.get_session_head(session_id).ok().flatten(); |
| 249 | let (parent_manifest, fork_turn) = head |
| 250 | .as_ref() |
| 251 | .and_then(|h| repo.get_session_manifest(h).ok().flatten()) |
| 252 | .map(|manifest| (manifest.parent_session, manifest.fork_turn)) |
| 253 | .unwrap_or((None, None)); |
| 254 | render_session_detail( |
| 255 | record, |
| 256 | turns, |
| 257 | turn_intents, |
| 258 | head, |
| 259 | parent_manifest, |
| 260 | fork_turn, |
| 261 | json, |
| 262 | ) |
| 263 | } |
| 264 | |
| 265 | /// The detail render, over the gathered data — the repository path and the |
| 266 | /// routed path (GetSession's ledger bundle + turn intents + manifest data) |
no test coverage detected