hive-sh4re: make harness_dir the single resolver; hive-ag3nt delegates (#1450)
This commit is contained in:
parent
a69844d463
commit
e8d39ecb8b
2 changed files with 20 additions and 14 deletions
|
|
@ -30,15 +30,14 @@ pub fn state_dir() -> PathBuf {
|
|||
/// Harness-internal state directory. Holds files the harness owns
|
||||
/// (`hyperhive-events.sqlite`, `hyperhive-turn-stats.sqlite`,
|
||||
/// `hyperhive-model`) so they do not appear inside the agent-visible
|
||||
/// `/agents/{label}/state` tree. Reads `HYPERHIVE_HARNESS_DIR` first;
|
||||
/// falls back to `/agents/{label}/harness` derived from `HIVE_LABEL`.
|
||||
/// `/agents/{label}/state` tree. Delegates to the shared canonical
|
||||
/// resolver in `hive_sh4re::paths` so the harness + every out-of-process
|
||||
/// MCP daemon resolve this identically (reads `HYPERHIVE_HARNESS_DIR`,
|
||||
/// then a `harness/` sibling of `HYPERHIVE_STATE_DIR`, then
|
||||
/// `/agents/{HIVE_LABEL}/harness`).
|
||||
#[must_use]
|
||||
pub fn harness_dir() -> PathBuf {
|
||||
if let Some(p) = std::env::var_os("HYPERHIVE_HARNESS_DIR") {
|
||||
return PathBuf::from(p);
|
||||
}
|
||||
let label = std::env::var("HIVE_LABEL").unwrap_or_default();
|
||||
PathBuf::from(format!("/agents/{label}/harness"))
|
||||
hive_sh4re::paths::harness_dir()
|
||||
}
|
||||
|
||||
/// Per-turn config dir for the regenerated claude-{mcp-config,settings,
|
||||
|
|
|
|||
Loading…
Reference in a new issue