From 77a9492a3fe3ea9863cef46d4bac68823c61041c Mon Sep 17 00:00:00 2001 From: damocles Date: Sat, 4 Jul 2026 12:05:14 +0200 Subject: [PATCH] refactor(#1825): drop manager_dir/manager_socket_path, use the per-agent fns --- hive-c0re/src/coordinator.rs | 11 ----------- hive-c0re/src/socket_server.rs | 8 ++++---- 2 files changed, 4 insertions(+), 15 deletions(-) diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index 03ee7676..c19d1629 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -1412,17 +1412,6 @@ impl Coordinator { Self::agent_dir(name).join("mcp.sock") } - /// Runtime dir for the manager. Uses the same per-agent subdir layout as - /// sub-agents — the manager is just another agent under - /// `AGENT_RUNTIME_ROOT` with its own subdirectory. - pub fn manager_dir() -> PathBuf { - Self::agent_dir(crate::lifecycle::MANAGER_NAME) - } - - pub fn manager_socket_path() -> PathBuf { - Self::socket_path(crate::lifecycle::MANAGER_NAME) - } - /// Ensure a runtime dir + (for sub-agents) per-agent socket exists. For /// the manager, `socket_server::start_manager` owns the socket — just return /// the dir. For sub-agents this is `register_agent` (creates a fresh diff --git a/hive-c0re/src/socket_server.rs b/hive-c0re/src/socket_server.rs index b4e4e14e..d44b69d5 100644 --- a/hive-c0re/src/socket_server.rs +++ b/hive-c0re/src/socket_server.rs @@ -75,14 +75,14 @@ pub fn start(agent: &str, socket_path: &Path, coord: Arc) -> Result /// no authority of its own — it just serves requests as `agent = MANAGER_AGENT` /// ("ruth"), and ruth's reach comes entirely from being the topology root /// (`is_descendant_of` covers every agent) plus the capabilities / tool-groups -/// it holds, identical to connecting on a per-agent socket. (The redundant -/// path — ruth using the standard per-agent socket — is collapsed in a follow-up.) +/// it holds, identical to connecting on a per-agent socket — ruth uses the +/// standard per-agent runtime dir + socket, with no dedicated helpers. pub fn start_manager(coord: Arc) -> Result<()> { use std::os::unix::fs::PermissionsExt as _; - let dir = Coordinator::manager_dir(); + let dir = Coordinator::agent_dir(crate::lifecycle::MANAGER_NAME); std::fs::create_dir_all(&dir) .with_context(|| format!("create manager dir {}", dir.display()))?; - let socket = Coordinator::manager_socket_path(); + let socket = Coordinator::socket_path(crate::lifecycle::MANAGER_NAME); if socket.exists() { std::fs::remove_file(&socket).context("remove stale manager socket")?; }