move hive-sh4re's harness_dir() into hive-agent-sock, drop the dev-fallback derivation
This commit is contained in:
parent
038d085001
commit
7ba492b965
6 changed files with 49 additions and 42 deletions
|
|
@ -18,6 +18,8 @@ use serde::{Deserialize, Serialize};
|
|||
|
||||
use hive_sh4re::LooseEnd;
|
||||
|
||||
pub mod paths;
|
||||
|
||||
/// In-container path of the harness-served in-agent socket. The harness
|
||||
/// binds it on boot; the in-container producers dial it for todo ops.
|
||||
/// (Placeholder default — the harness + producers resolve the real path
|
||||
|
|
|
|||
30
hive-agent-sock/src/paths.rs
Normal file
30
hive-agent-sock/src/paths.rs
Normal file
|
|
@ -0,0 +1,30 @@
|
|||
//! In-container harness-directory resolution, shared by the harness
|
||||
//! itself and every producer daemon that dials the in-agent socket
|
||||
//! (`hive-bash-mcp`, and any future producer that writes artifacts
|
||||
//! alongside the harness's own state).
|
||||
|
||||
use std::path::PathBuf;
|
||||
|
||||
/// Base harness directory for the current agent. Reads
|
||||
/// `HYPERHIVE_HARNESS_DIR`, always injected by the meta flake's
|
||||
/// `systemd.globalEnvironment` for every in-container service
|
||||
/// (`nix/host-modules` — see `hive-c0re/src/meta.rs`'s per-agent
|
||||
/// environment block). Every process this crate's wire types serve
|
||||
/// (the harness, `hive-bash-daemon`, ...) runs under that same
|
||||
/// environment, so there is no legitimate runtime path where it's
|
||||
/// unset — a missing var means the container is misconfigured, not
|
||||
/// that a fallback derivation should paper over it.
|
||||
///
|
||||
/// # Panics
|
||||
///
|
||||
/// Panics if `HYPERHIVE_HARNESS_DIR` is not set. Deliberate: a wrong
|
||||
/// silently-derived path here means task files, sqlite stores, and the
|
||||
/// in-agent socket itself could resolve to the wrong directory — a
|
||||
/// loud crash at startup beats a quiet cross-agent path collision.
|
||||
#[must_use]
|
||||
pub fn harness_dir() -> PathBuf {
|
||||
PathBuf::from(
|
||||
std::env::var_os("HYPERHIVE_HARNESS_DIR")
|
||||
.expect("HYPERHIVE_HARNESS_DIR must be set — the meta flake injects it for every in-container service; a missing value means the container's environment is misconfigured"),
|
||||
)
|
||||
}
|
||||
Loading…
Reference in a new issue