mur_common/paths.rs
1//! Directory names under `<mur_home>` that a fleet / deep-research run writes.
2//!
3//! One list, two readers that must never disagree: `mur-core` creates and
4//! writes these while a run executes, and `mur-agent-runtime` carves exactly
5//! these into the kernel sandbox for an agent-triggered run (`fleet_run`).
6//! They lived as two separate literals and drifted — `runs/` was writable by
7//! the CLI and denied to the sandbox, so every agent-triggered run failed to
8//! register itself and `mur fleet status` reported nothing for a run that was
9//! live (fleet develop-rust, 2026-09-09). The list lives here because the
10//! runtime must not depend on `mur-core`.
11
12/// Run-status records: `<mur_home>/runs/<run_id>/run.json`.
13pub const RUNS: &str = "runs";
14
15/// Every directory an in-sandbox fleet run must be able to write.
16///
17/// Add here FIRST, then use it. A directory the runner writes but this list
18/// omits fails only in the sandboxed path — the one nobody runs by hand.
19pub const RUN_STATE_DIRS: [&str; 5] = ["fleets", "commander", "conversations", "artifacts", RUNS];
20
21#[cfg(test)]
22mod tests {
23 use super::*;
24
25 #[test]
26 fn runs_is_listed() {
27 // The drift that broke agent-triggered runs was exactly this: the
28 // writer knew about `runs`, the sandbox list did not.
29 assert!(RUN_STATE_DIRS.contains(&RUNS));
30 }
31}