From 1caf978004b927a5b59f939d64177635246f1c0f Mon Sep 17 00:00:00 2001 From: damocles Date: Sun, 21 Jun 2026 23:34:34 +0200 Subject: [PATCH] hive-c0re: create the agent subvolume before seeding dirs in init_config --- hive-c0re/src/actions.rs | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/hive-c0re/src/actions.rs b/hive-c0re/src/actions.rs index 16ff465e..13d6f40d 100644 --- a/hive-c0re/src/actions.rs +++ b/hive-c0re/src/actions.rs @@ -324,8 +324,15 @@ async fn run_approval_init_config( crate::topology::add_child(&approval.agent, &approval.commit_ref) .map_err(|e| anyhow::anyhow!("topology add_child: {e}"))?; } - lifecycle::setup_proposed(&proposed_dir, &approval.agent).await?; + // Create the agent's state root as a btrfs subvolume FIRST, before + // any dir-seed touches it. `ensure_agent_state_subvolume` is + // progressive ("root exists → skip"), and `setup_proposed` does a + // `create_dir_all` on the proposed-config path which would + // materialise the state root as a plain directory — after which + // the subvolume create is silently skipped and the agent never + // lands on a subvolume (no quota, no snapshot). Order matters. lifecycle::ensure_agent_state_subvolume(&approval.agent).await?; + lifecycle::setup_proposed(&proposed_dir, &approval.agent).await?; lifecycle::ensure_claude_dir(&claude_dir)?; lifecycle::ensure_state_dir(¬es_dir)?; Ok(())