From dfd159d1de6c91b0c97907cdf0dcf89a3ec37724 Mon Sep 17 00:00:00 2001 From: atlas Date: Fri, 10 Jul 2026 01:12:04 +0200 Subject: [PATCH 1/2] refactor: drop Coordinator::ensure_runtime dead shim (no callers post #2290) --- hive-c0re/src/coordinator.rs | 22 ++-------------------- 1 file changed, 2 insertions(+), 20 deletions(-) diff --git a/hive-c0re/src/coordinator.rs b/hive-c0re/src/coordinator.rs index 16e7d241..6312c71e 100644 --- a/hive-c0re/src/coordinator.rs +++ b/hive-c0re/src/coordinator.rs @@ -548,8 +548,8 @@ impl Coordinator { /// Assemble the per-agent filesystem paths for `name`. `agent_dir` /// is the runtime directory (`/run/hyperhive/agents/`), obtained /// from `Coordinator::agent_dir(name)` (pure path) or from - /// `lifecycle::ensure_agent_runtime_dir` + `agent_dir` when the dir - /// must be created. All other paths are derived statically from `name`. + /// `lifecycle::ensure_agent_runtime_dir(name)` when the dir must be + /// created. All other paths are derived statically from `name`. #[must_use] pub fn agent_paths(name: &str, agent_dir: PathBuf) -> AgentPaths { AgentPaths { @@ -1452,24 +1452,6 @@ impl Coordinator { /// Ensure a runtime dir + (for sub-agents) per-agent socket exists. /// - /// **Prefer the split form (event-driven):** - /// - dir creation → `lifecycle::ensure_agent_runtime_dir(name)` - /// - listener registration → `register_agent(name)` at each explicit - /// lifecycle event (spawn, reconcile-start). `mcp_sockets::sync_on_start` - /// covers the daemon-restart case. - /// - /// This method is kept as a convenience shim for any remaining callers - /// that need the combined semantics in one call. - pub fn ensure_runtime(self: &Arc, name: &str) -> Result { - if name == crate::lifecycle::MANAGER_NAME { - let dir = Self::agent_dir(name); - std::fs::create_dir_all(&dir) - .with_context(|| format!("create manager dir {}", dir.display()))?; - return Ok(dir); - } - self.register_agent(name) - } - /// Per-agent state root (parent of `config/`, future `prompts/`, etc.). pub fn agent_state_root(name: &str) -> PathBuf { PathBuf::from(format!("{AGENT_STATE_ROOT}/{name}")) From 371f888640d00296f7f868aa6fa8e48e2d006796 Mon Sep 17 00:00:00 2001 From: atlas Date: Fri, 10 Jul 2026 01:15:48 +0200 Subject: [PATCH 2/2] fix: update stale ensure_runtime reference in hive-priv doc comment --- hive-priv/src/main.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/hive-priv/src/main.rs b/hive-priv/src/main.rs index 5a39d5ef..54e67c7f 100644 --- a/hive-priv/src/main.rs +++ b/hive-priv/src/main.rs @@ -1530,7 +1530,7 @@ fn write_bridge_dns_marker(container: &str, isolation: Option<&NetworkIsolation> /// then creates any missing dirs on the running host. The file survives reboots /// and is read by `systemd-tmpfiles-setup.service` (runs in `sysinit.target`, /// before any container units can start), so bind-mount source dirs are always -/// pre-created regardless of whether hive-c0re has reached `ensure_runtime`. +/// pre-created regardless of whether hive-c0re has reached `ensure_agent_runtime_dir`. /// /// Directories written per agent: /// - `/run/hyperhive/agents/` (MCP socket dir, bind-mounted into container