[control] Store and recovery fixes: cross-process token lock, revert keeps its journal until done, epoch and deny list never roll back, journal errors propagate, lost confirm reloads edge, trial hash checked

This commit is contained in:
2026-11-07 18:51:58 +01:00
parent b9e14c6aee
commit 4448527b16
10 changed files with 305 additions and 66 deletions
+1
View File
@@ -114,6 +114,7 @@ pub fn read_json<T: DeserializeOwned>(path: &Path) -> Result<Option<T>, String>
/// Write a JSON state file atomically, readable by its owner only.
pub fn write_json<T: Serialize>(path: &Path, value: &T) -> Result<(), String> {
crate::crash::fail_write(path)?;
let mut text = serde_json::to_vec_pretty(value).map_err(|e| e.to_string())?;
text.push(b'\n');
write_atomic(path, &text, 0o600).map_err(|e| format!("cannot write {}: {e}", path.display()))