pub fn fail_unit(
mana_dir: &Path,
id: &str,
reason: Option<String>,
) -> Result<Unit, Error>Expand description
Mark a unit as explicitly failed without closing it.
Releases the claim, finalizes the current attempt as Failed, appends a
structured failure summary to notes, and returns the unit to Open status
for retry.
§Errors
anyhow::Error— unit not found or I/O failure
§Example
use mana_core::api::fail_unit;
use std::path::Path;
let unit = fail_unit(Path::new("/project/.mana"), "1",
Some("Blocked by missing auth token".to_string())).unwrap();
assert_eq!(unit.status, mana_core::api::Status::Open);