diff --git a/hive-priv/src/userns.rs b/hive-priv/src/userns.rs index c812db28..42be68b8 100644 --- a/hive-priv/src/userns.rs +++ b/hive-priv/src/userns.rs @@ -44,7 +44,8 @@ const MARKER_ROOT: &str = "/var/lib/hive-priv/userns"; const MIN_AGENT_UID: u32 = 1000; /// The dirs under `/` the agent writes into. `config` -/// is not one of them: hive-core writes it and the agent only reads it. +/// is not one of them: hive-core writes it and the agent only reads it. `state` +/// stays first: [`move_data`] opens it by name and opens the rest from `[1..]`. const DATA_DIRS: [&str; 4] = ["state", "harness", "work", "claude"]; /// Where one call looks and writes, and what it was told. @@ -729,6 +730,12 @@ mod tests { } } + /// `move_data` opens `state` by name and takes the other dirs from `DATA_DIRS[1..]`. + #[test] + fn state_is_the_first_data_dir() { + assert_eq!(super::DATA_DIRS[0], "state"); + } + #[test] fn a_path_is_not_an_agent_name() { let root = tree();