From 2cd089b65f579a9c62f50ddff6e3fc21badf050b Mon Sep 17 00:00:00 2001 From: damocles Date: Fri, 26 Jun 2026 17:17:09 +0200 Subject: [PATCH 1/4] fix(#2003): start root container if present-but-stopped on hive-c0re boot --- hive-c0re/src/auto_update.rs | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/hive-c0re/src/auto_update.rs b/hive-c0re/src/auto_update.rs index 9e13990a..43c0f247 100644 --- a/hive-c0re/src/auto_update.rs +++ b/hive-c0re/src/auto_update.rs @@ -195,6 +195,20 @@ pub async fn ensure_root_agent(coord: &Arc) -> Result<()> { } else { tracing::debug!("manager container already present"); } + // The root/manager is required infrastructure — it must be running + // after every hive-c0re (re)start. A previous bring-up can leave it + // *created but stopped* (e.g. a first-start failure on a fresh + // install, #2003): the startup sweep's rebuild only restarts a + // container that was already running, so without this it stays down + // until a manual `nixos-container start`. Unlike sub-agents there is + // no "deliberately stopped root" intent to honour, so start it + // unconditionally when it isn't running. + if !lifecycle::is_running(MANAGER_NAME).await { + tracing::info!("manager container present but not running — starting"); + if let Err(e) = lifecycle::start(MANAGER_NAME).await { + tracing::warn!(error = ?e, "manager start failed"); + } + } return Ok(()); } tracing::info!("manager container missing — spawning"); From 916c0b11c5b32069bb2b9ffe697b3955bb4f75ec Mon Sep 17 00:00:00 2001 From: damocles Date: Fri, 26 Jun 2026 17:21:30 +0200 Subject: [PATCH 2/4] fix(#2003): drop issue tag from inline comment (tracker-tag lint) --- hive-c0re/src/auto_update.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/hive-c0re/src/auto_update.rs b/hive-c0re/src/auto_update.rs index 43c0f247..0388cfe8 100644 --- a/hive-c0re/src/auto_update.rs +++ b/hive-c0re/src/auto_update.rs @@ -198,10 +198,10 @@ pub async fn ensure_root_agent(coord: &Arc) -> Result<()> { // The root/manager is required infrastructure — it must be running // after every hive-c0re (re)start. A previous bring-up can leave it // *created but stopped* (e.g. a first-start failure on a fresh - // install, #2003): the startup sweep's rebuild only restarts a - // container that was already running, so without this it stays down - // until a manual `nixos-container start`. Unlike sub-agents there is - // no "deliberately stopped root" intent to honour, so start it + // install): the startup sweep's rebuild only restarts a container + // that was already running, so without this it stays down until a + // manual `nixos-container start`. Unlike sub-agents there is no + // "deliberately stopped root" intent to honour, so start it // unconditionally when it isn't running. if !lifecycle::is_running(MANAGER_NAME).await { tracing::info!("manager container present but not running — starting"); From c16eff0d5cc1b86d90567b6ac0a7b3f791b8ba7d Mon Sep 17 00:00:00 2001 From: damocles Date: Fri, 26 Jun 2026 17:23:17 +0200 Subject: [PATCH 3/4] fix(#2003): reword root auto-start comment (not 'required infra'; opt-out is a separate host setting) --- hive-c0re/src/auto_update.rs | 16 ++++++++-------- 1 file changed, 8 insertions(+), 8 deletions(-) diff --git a/hive-c0re/src/auto_update.rs b/hive-c0re/src/auto_update.rs index 0388cfe8..875f3f24 100644 --- a/hive-c0re/src/auto_update.rs +++ b/hive-c0re/src/auto_update.rs @@ -195,14 +195,14 @@ pub async fn ensure_root_agent(coord: &Arc) -> Result<()> { } else { tracing::debug!("manager container already present"); } - // The root/manager is required infrastructure — it must be running - // after every hive-c0re (re)start. A previous bring-up can leave it - // *created but stopped* (e.g. a first-start failure on a fresh - // install): the startup sweep's rebuild only restarts a container - // that was already running, so without this it stays down until a - // manual `nixos-container start`. Unlike sub-agents there is no - // "deliberately stopped root" intent to honour, so start it - // unconditionally when it isn't running. + // hive-c0re auto-manages the root/manager by default, so a + // present-but-stopped root (e.g. a first-start failure on a fresh + // install) is brought back up here: the startup sweep's rebuild only + // restarts a container that was already running, so without this it + // stays down until a manual `nixos-container start`. The sub-agent + // `was_running` guard is intentionally left untouched. (An operator + // opt-out of this whole auto-management is tracked as a separate + // host setting.) if !lifecycle::is_running(MANAGER_NAME).await { tracing::info!("manager container present but not running — starting"); if let Err(e) = lifecycle::start(MANAGER_NAME).await { From 0d17ae69f47bf5fef334d189bebe3ad49d09832f Mon Sep 17 00:00:00 2001 From: damocles Date: Fri, 26 Jun 2026 17:23:51 +0200 Subject: [PATCH 4/4] docs: drop stale 'required infrastructure' framing from ensure_root_agent --- hive-c0re/src/auto_update.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/hive-c0re/src/auto_update.rs b/hive-c0re/src/auto_update.rs index 875f3f24..99f8cbff 100644 --- a/hive-c0re/src/auto_update.rs +++ b/hive-c0re/src/auto_update.rs @@ -167,7 +167,8 @@ pub async fn rebuild_agent( /// Auto-create the manager container on startup if it isn't already there. /// hive-c0re manages the manager end-to-end: operators no longer declare /// `containers.h-ruth` in their host NixOS config. Bypasses the approval -/// queue — manager is required infrastructure. Idempotent. +/// queue — the root/manager is auto-managed by default (an operator opt-out +/// is a separate host setting). Idempotent. pub async fn ensure_root_agent(coord: &Arc) -> Result<()> { let existing = lifecycle::list().await.unwrap_or_default(); let current_rev = current_flake_rev(&coord.hyperhive_flake);