refactor(#2285): repoint all hive-c0re host-path consumers to paths.rs

This commit is contained in:
damocles 2026-07-10 19:52:38 +02:00 committed by mara
commit 187c364feb
16 changed files with 95 additions and 125 deletions

View file

@ -148,11 +148,15 @@ pub fn agent_sockets_file() -> PathBuf {
// ---------------------------------------------------------------------------
/// `agents/` — per-agent persistent state root (one subdir per agent,
/// bind-mounted into each container as `/agents/<name>`).
/// bind-mounted into each container as `/agents/<name>`). A `&str` (the
/// dashboard state-file allow-list uses it for `strip_prefix` /
/// `starts_with` checks), so it stays a const; [`agents_root`] wraps it.
// nix: agent container bind-mount source (harness-base.nix / agent-base.nix) — must match.
pub const AGENTS_ROOT: &str = "/var/lib/hyperhive/agents";
#[must_use]
pub fn agents_root() -> PathBuf {
state_root().join("agents")
PathBuf::from(AGENTS_ROOT)
}
/// `agents/<name>` — one agent's persistent state root.
@ -202,11 +206,15 @@ pub fn meta_git_index_lock() -> PathBuf {
meta_root().join(".git/index.lock")
}
/// `shared/` — the cross-agent `/shared` scratch space.
/// `shared/` — the cross-agent `/shared` scratch space. A `&str` (the
/// dashboard state-file allow-list uses it for prefix checks), so it
/// stays a const; [`shared_root`] wraps it.
// nix: bind-mounted into every agent container as `/shared` (harness-base.nix) — must match.
pub const SHARED_ROOT: &str = "/var/lib/hyperhive/shared";
#[must_use]
pub fn shared_root() -> PathBuf {
state_root().join("shared")
PathBuf::from(SHARED_ROOT)
}
/// `knowledge/` — local checkout of the `internal/knowledge` repo. A
@ -228,6 +236,12 @@ pub fn gateway_agents_conf() -> PathBuf {
gateway_dir().join("agents.conf")
}
/// `gateway/gateway.htpasswd` — nginx basic-auth credential store for the
/// operator dashboard vhost. A `&str` (used as a `hivectl` clap
/// `default_value`), so it stays a const rather than a `PathBuf` fn.
// nix: read by the gateway container's nginx (hive-gateway.nix) — must match.
pub const GATEWAY_HTPASSWD: &str = "/var/lib/hyperhive/gateway/gateway.htpasswd";
/// `forge-core-token` — the hive-c0re forge account API token. A `&str`
/// (used in `Path::new` + user-facing `format!` messages), so it stays a
/// const rather than a `PathBuf` fn.