diff --git a/hive-c0re/src/meta.rs b/hive-c0re/src/meta.rs index 30c29589..e75ee4fb 100644 --- a/hive-c0re/src/meta.rs +++ b/hive-c0re/src/meta.rs @@ -148,6 +148,13 @@ pub async fn sync_agents( if crate::tool_groups::tool_groups_path().exists() { git(&dir, &["add", "tool-groups.json"]).await?; } + // Stage roles.json when it exists. Written by topology::write_roles / + // reconcile_roles on first role assignment or manager default seeding. + // Without this, roles.json appears as untracked in the meta repo + // (visible in `git status`) which can confuse nix dirty-tree fetches. + if crate::topology::roles_path().exists() { + git(&dir, &["add", "roles.json"]).await?; + } nix(&dir, &["flake", "lock"]).await?; if std::path::Path::new(&dir).join("flake.lock").exists() { git(&dir, &["add", "flake.lock"]).await?;