Watch
0
0
Fork
You've already forked hyperhive
0

pin state as the first data dir with a comment and a test

This commit is contained in:
atlas 2026-11-06 10:12:09 +01:00 • committed by mara
commit cd1b77b078

View file

@ -44,7 +44,8 @@ const MARKER_ROOT: &str = "/var/lib/hive-priv/userns";
const MIN_AGENT_UID: u32 = 1000;
/// The dirs under `<AGENT_STATE_ROOT>/<agent>` 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();