pub fn session_id_from_capture(
project_root: &Path,
phase: PhaseId,
) -> Option<String>Expand description
Thin file-reading wrapper over the two session-id readers: reads the phase’s
captured stdout file (via stdout_path) and delegates. None for a
missing capture file, never an Err — mirrors evaluate_layer1’s
lossy-read convention (CR-01: one invalid UTF-8 byte from raw sh
redirection must not silently disable this reader).
claude_stream_session_id is tried FIRST, then claude_session_id.
Stream-first is safe and behavior-preserving: the stream gate
([is_claude_event_stream]) declines a single-document envelope, so every
capture shape that ships today still resolves through claude_session_id
bit-for-bit. Without this chain the Phase 28 checkpoint-resume path — whose
whole delivery is reconstructing a session via claude --resume — returns
None for every stream-json capture.