Normalize a string to a Phase, defaulting to `Idle` for unknown values. This provides backward compatibility with session state files that may have empty or unrecognized phase values. # Example ```rust use atomic_agent::turn::phase::Phase; assert_eq!(Phase::from_str_normalized("active"), Phase::Active); assert_eq!(Phase::from_str_normalized(""), Phase::Idle); assert_eq!(Phase::from_str_normali
(s: &str)
| 142 | /// assert_eq!(Phase::from_str_normalized("garbage"), Phase::Idle); |
| 143 | /// ``` |
| 144 | pub fn from_str_normalized(s: &str) -> Self { |
| 145 | match s { |
| 146 | "idle" => Phase::Idle, |
| 147 | "active" => Phase::Active, |
| 148 | "active_recorded" => Phase::ActiveRecorded, |
| 149 | "ended" => Phase::Ended, |
| 150 | _ => Phase::Idle, |
| 151 | } |
| 152 | } |
| 153 | |
| 154 | /// Returns the canonical string representation. |
| 155 | pub fn as_str(&self) -> &'static str { |
nothing calls this directly
no outgoing calls
no test coverage detected