From 994f53d06f466bd7d05f32770bed7415055fb959 Mon Sep 17 00:00:00 2001 From: atlas Date: Mon, 1 Jun 2026 19:43:23 +0200 Subject: [PATCH] fix(#978): stage roles.json in sync_agents alongside topology.json topology::reconcile_roles writes roles.json to the meta dir, but sync_agents never staged it. After #978 merged, roles.json showed up as an untracked file in the meta repo (visible in `git status`) because it followed the same pattern as topology.json and tool-groups.json but was missed in the git add list. Add the same conditional stage for roles.json: git add is a no-op when the file is unchanged or absent, matching the existing pattern. --- hive-c0re/src/meta.rs | 7 +++++++ 1 file changed, 7 insertions(+) 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?;