feat(#2628): migrate bash producer to the in-agent todo socket (keyed active + keyless done, not wakes)

This commit is contained in:
damocles 2026-07-21 23:51:35 +02:00
commit 17a9a156c2
6 changed files with 167 additions and 123 deletions

View file

@ -43,21 +43,17 @@ pub fn turn_stats_db() -> PathBuf {
harness_dir().join("hyperhive-turn-stats.sqlite")
}
/// Hyperhive control socket — the daemon writes wake signals here so
/// the harness drives a new claude turn on bash task completion.
/// Mirrors the path used by `forge_notify` and `hive-matrix-mcp`.
/// The harness-served in-agent todo socket (loose-ends v2). The runner
/// pushes bash-task todos here — `upsert_todo` while a task is active,
/// a keyless `done` todo on completion — instead of firing a direct
/// c0re wake. Override via `HIVE_AGENT_SOCKET`; mirrors the path the
/// harness binds (`agent-service.nix`) and the matrix producer dials.
#[must_use]
pub fn hyperhive_socket() -> PathBuf {
std::env::var_os("HIVE_CONTROL_SOCKET")
.map_or_else(|| PathBuf::from("/run/hive/mcp.sock"), PathBuf::from)
}
/// Directory where MCP daemons write loose-end summary files for the harness.
/// Each daemon writes `<name>.json` here; the harness scans the dir in
/// `get_loose_ends` to surface active work from all MCPs generically.
#[must_use]
pub fn mcp_loose_ends_dir() -> PathBuf {
hive_sh4re::paths::mcp_loose_ends_dir()
pub fn agent_socket() -> PathBuf {
std::env::var_os("HIVE_AGENT_SOCKET").map_or_else(
|| PathBuf::from(hive_agent_sock::DEFAULT_AGENT_SOCKET),
PathBuf::from,
)
}
/// Full path for a task's JSON metadata file.