(dir: &Path, run_id: &str)
| 899 | } |
| 900 | |
| 901 | fn load_first_refusal(dir: &Path, run_id: &str) -> CliResult<Option<ManagedBoundaryRefusal>> { |
| 902 | validate_run_id(run_id)?; |
| 903 | let path = lifecycle_refusal_path(dir, run_id); |
| 904 | let data = match fs::read(&path) { |
| 905 | Ok(data) => data, |
| 906 | Err(error) if error.kind() == std::io::ErrorKind::NotFound => return Ok(None), |
| 907 | Err(error) => return Err(CliError::Io(error)), |
| 908 | }; |
| 909 | serde_json::from_slice(&data).map(Some).map_err(|error| { |
| 910 | CliError::Internal(anyhow!( |
| 911 | "failed to parse managed lifecycle refusal '{}': {}", |
| 912 | path.display(), |
| 913 | error, |
| 914 | )) |
| 915 | }) |
| 916 | } |
| 917 | |
| 918 | fn persist_first_refusal( |
| 919 | dir: &Path, |
no test coverage detected