fix(#2399): agent containers get daemonBins, not the full hivectl/hive-forge bundle

Agent containers pulled in `pkgs.hyperhive` (packages.default: daemonBins +
hivectlPkg + hiveForgePkg) via environment.systemPackages and every
harness ExecStart. That shipped hivectl (a host-admin CLI dialing the
host admin socket, unreachable from inside a container, wrapped with
wireguard-tools for `hivectl wg`) plus a redundant second hive-forge
copy (already provided separately via hive-forge-tools.nix) into every
single agent's closure.

Expose the existing daemonBins split as packages.<system>.daemonBins
(mara: 'there should be split nix outputs already, use those' — no new
grouping derivation) + a hyperhive-daemon overlay entry, and repoint
harness-base.nix's systemPackages entry and all agent-run ExecStarts
(hive-agent, hive-agent-mcp, hive-bash-daemon, hive-matrix-daemon) plus
the bash/matrix MCP bridge commands at it instead of the full bundle.

nix flake check: daemonBins + agent-base-toplevel + ruth-toplevel all
evaluate cleanly (docs derivation failure is a preexisting dirty-tree
issue, unrelated).
This commit is contained in:
atlas 2026-07-13 17:32:29 +02:00 committed by mara
commit 5c08abc1b2
2 changed files with 32 additions and 7 deletions

View file

@ -257,6 +257,17 @@
# only want the CLI(s) without the daemon binaries.
hivectl = hivectlPkg;
hive-forge = hiveForgePkg;
# The daemon/harness/MCP bins alone, no `hivectl` and no second
# `hive-forge` copy. Agent containers use this (via the
# `hyperhive-daemon` overlay output below) instead of `default` —
# they need `hive-agent{,-mcp,-wake}` /
# `hive-bash-{daemon,mcp}` / `hive-matrix-{daemon,mcp}`, never
# the operator-only `hivectl` (dials the *host* admin socket,
# unreachable from inside a container, and drags in
# `wireguard-tools` as a wrapper dep) or a redundant `hive-forge`
# (already on agent PATH via `hive-forge-tools.nix`) — this is
# the fix for the agent-derivation-bloat report.
daemonBins = daemonBins;
# Bundled browser assets — see ./nix/frontend.nix. Output is
# $out/{dashboard,agent}/ which the Rust binaries serve via
# tower_http::ServeDir.
@ -316,6 +327,10 @@
overlays = {
default = final: prev: {
hyperhive = self.packages.${prev.stdenv.hostPlatform.system}.default;
# Agent-scoped subset of `hyperhive` — daemon/harness/MCP bins
# only, no `hivectl` / no redundant `hive-forge` copy. See
# `packages.<system>.daemonBins` above.
hyperhive-daemon = self.packages.${prev.stdenv.hostPlatform.system}.daemonBins;
# Bundled frontend dist (see ./nix/frontend.nix). Output is
# $out/{dashboard,agent}/; consumers pick the surface they
# need. Exposed via the overlay so containers' nix evaluations