feat: phase 2 — automatisation: doctor --watch, schedule, service, orchestration, conteneurs (closes #55 #56 #57 #58 #59)

This commit is contained in:
2026-08-18 10:57:00 -04:00
parent 6a6676fc5d
commit 63dc36660b
27 changed files with 1408 additions and 35 deletions
+26
View File
@@ -27,6 +27,31 @@ pub struct StateFile {
/// Config file checksums used by 'am audit' (axe 8, issue #63).
#[serde(default)]
pub config_checksums: BTreeMap<String, ConfigChecksum>,
/// Scheduled commands (axe 6, issue #56).
#[serde(default)]
pub schedules: Vec<ScheduleEntry>,
}
/// One scheduled command (issue #56). Stored in state.json; the OS-level
/// task (crontab / Task Scheduler) points back at 'am schedule-run <id>'.
#[derive(Debug, Clone, Default, Serialize, Deserialize)]
pub struct ScheduleEntry {
pub id: String,
/// "daily" (the only cadence supported today).
pub cadence: String,
/// Command arguments to run, e.g. ["update", "--all"].
pub command: Vec<String>,
/// HH:MM local time (default "08:00").
#[serde(default)]
pub at: String,
/// RFC 3339 creation timestamp.
pub created_at: String,
/// RFC 3339 of the last run (None = never).
#[serde(default)]
pub last_run: Option<String>,
/// Exit code of the last run (None = never ran / running).
#[serde(default)]
pub last_exit: Option<i32>,
}
/// One recorded config checksum: the baseline 'am audit' compares against
@@ -64,6 +89,7 @@ impl Default for StateFile {
last_used: None,
annotations: BTreeMap::new(),
config_checksums: BTreeMap::new(),
schedules: Vec::new(),
}
}
}