diff --git a/docs/agent-hierarchy.md b/docs/agent-hierarchy.md index 714371ee..2f4e6d08 100644 --- a/docs/agent-hierarchy.md +++ b/docs/agent-hierarchy.md @@ -47,7 +47,7 @@ viewers see the tree repaint without polling (`ContainerView.parent` is sourced from `topology.json`). **Today's caveat:** the move is purely a JSON edit. Only the -top-level manager (`hm1nd`) gets `/var/lib/hyperhive/agents` +top-level manager (`root`) gets `/var/lib/hyperhive/agents` bind-mounted at `/agents` in its container, so sub-agents don't yet see their would-be children's state. Once sub-manager bind mounts land alongside cap enforcement, `set_parent` grows a companion @@ -105,12 +105,12 @@ which axis the post-milestone version reads each special-case along: ### A — naming + bootstrap - `MANAGER_AGENT = "manager"` (broker recipient name) and - `MANAGER_NAME = "hm1nd"` (container name). ~28 grep hits across - `hive-c0re/src/`. **Just a name** — the rename plan is `manager` → - `root`, executed via the one-shot migration script in - `migrate.rs` (idempotent, marker-guarded). + `MANAGER_NAME = "root"` (container name). ~28 grep hits across + `hive-c0re/src/`. **Just a name** — renamed from `hm1nd` to `root` + via the one-shot migration script in `migrate.rs` (idempotent, + marker-guarded). - `auto_update::ensure_manager` runs at hive-c0re boot and spawns - `hm1nd` if missing. Becomes "ensure the root agent exists" once any + `root` if missing. Becomes "ensure the root agent exists" once any agent can be at the root. **Topology**: root has no parent, so hive-c0re itself owns its lifecycle (no parent to delegate to). @@ -235,12 +235,9 @@ repos they're working on. `nixosConfigurations.manager` must build standalone (without the meta-flake's per-agent flake.nix wrapper). For the manager unit -that means hardcoded `HIVE_PORT` / `HIVE_LABEL` env values: +that means a hardcoded `HIVE_LABEL` env value: -- `HIVE_PORT = "8875"` — FNV-1a(`"hm1nd"`) % 900 + 8100, matching - `lifecycle::agent_web_port`. Sub-agents have the same shape via - the meta-flake-generated `applied//flake.nix`. -- `HIVE_LABEL = "hm1nd"` — container name; matches what `meta.rs` +- `HIVE_LABEL = "root"` — container name; matches what `meta.rs` injects at deploy time. Real deploys never read these — `meta::render_flake` overrides them diff --git a/docs/approvals.md b/docs/approvals.md index 44d8a122..27ea924b 100644 --- a/docs/approvals.md +++ b/docs/approvals.md @@ -2,7 +2,7 @@ The approval queue is hyperhive's pivot: nothing that changes the shape of an agent (its config, whether it exists) happens without an -operator click. The manager (`hm1nd`) is the policy gate in front of +operator click. The manager (`root`) is the policy gate in front of that queue; helper events are how it stays informed about what happens after a decision lands. @@ -114,7 +114,7 @@ kind-specific payload carrier. operator approval. Step 1 of the two-step spawn flow above. - `UpdateMetaInputs` — `commit_ref` stores the JSON-encoded inputs array (`"[]"` = all inputs, `"[\"nixpkgs\"]"` = just nixpkgs, - etc.). `agent` field is set to `hm1nd` (the requesting manager). + etc.). `agent` field is set to `root` (the requesting manager). On approve hive-c0re runs `nix flake update [inputs...]` on the meta flake and commits the resulting lock changes. - `SchedulePrompt` — `commit_ref` stores the JSON-encoded @@ -438,23 +438,23 @@ notes, the events DB, proposed history, and applied history all survive. The manager keeps its session; sub-agents stay logged in. -## Manager (`hm1nd`) is hive-c0re-managed +## Manager (`root`) is hive-c0re-managed The manager container runs through the **same lifecycle as -sub-agents**. On `hive-c0re serve` startup, if `hm1nd` is missing, +sub-agents**. On `hive-c0re serve` startup, if `root` is missing, hive-c0re creates it. The manager's flake lives at -`/var/lib/hyperhive/applied/hm1nd/`; its proposed config at -`/var/lib/hyperhive/agents/hm1nd/config/`. Manager can edit its own -`agent.nix` (visible inside the container at `/agents/hm1nd/config/`) -and submit `request_apply_commit("hm1nd", )` for operator +`/var/lib/hyperhive/applied/root/`; its proposed config at +`/var/lib/hyperhive/agents/root/config/`. Manager can edit its own +`agent.nix` (visible inside the container at `/agents/root/config/`) +and submit `request_apply_commit("root", )` for operator approval. Differences from sub-agents: - `flake.nix` extends `hyperhive.nixosConfigurations.manager` (vs `agent-base`). -- Container name is `hm1nd` (no `h-` prefix). -- Web UI port via `lifecycle::agent_web_port("hm1nd")` — same +- Container name is `root` (no `h-` prefix). +- Web UI port via `lifecycle::agent_web_port("root")` — same FNV-1a hash as every other agent (8100..8999 range). - `set_nspawn_flags` adds two extra binds: `/var/lib/hyperhive/agents` → `/agents` (RW) so the manager can edit per-agent proposed repos, @@ -466,7 +466,7 @@ Differences from sub-agents: - Per-agent socket lives at `/run/hyperhive/manager/`, owned by `manager_server::start`. -**Migration note** (for older hosts): drop any `containers.hm1nd = +**Migration note** (for older hosts): drop any `containers.root = { ... }` block from your host NixOS config. hyperhive creates and updates the manager itself. diff --git a/docs/conventions.md b/docs/conventions.md index 063f259d..7c6f465c 100644 --- a/docs/conventions.md +++ b/docs/conventions.md @@ -7,7 +7,7 @@ exist because something already went wrong without them. - Containers are length-bounded by `nixos-container` (≤ 11 chars). - Sub-agents are `h-` with `` ≤ 9 chars. -- The manager is `hm1nd` (no `h-` prefix, fixed name). +- The manager is `root` (no `h-` prefix, fixed name). - `MAX_AGENT_NAME` in `lifecycle.rs` enforces the cap. - Per-agent web UI port = `WEB_PORT_BASE + FNV1a(name) % WEB_PORT_RANGE` (8100..8999) for every agent including the manager; dashboard diff --git a/docs/damocles-migration.md b/docs/damocles-migration.md index 3dd649d7..7dfc71f9 100644 --- a/docs/damocles-migration.md +++ b/docs/damocles-migration.md @@ -38,7 +38,7 @@ other sub-agents but is not managed by hive-c0re. Pros: low blast radius. damocles keeps its bind-mounts + its own restart policy. Manager can route messages to it (it's just another inbox key on the broker). Cons: two lifecycle mechanisms coexist forever; "damocles" doesn't appear in the -dashboard's container list (it filters `hive-` and `hm1nd`). +dashboard's container list (it filters `hive-` and `root`). ### C. Don't migrate damocles stays out of hyperhive. The two systems coexist; the user's day-job @@ -52,7 +52,7 @@ Cons: no message routing between damocles and the swarm. **C for now, B once cross-pollination is wanted.** Hyperhive's invariants (11-char container names, manager-driven lifecycle, sealed `applied/` config) fit poorly with damocles's role as the user's working Claude. Wait until there's -a concrete reason to wire them together (e.g. "I want to ask hm1nd from inside +a concrete reason to wire them together (e.g. "I want to ask root from inside damocles") and then do B — extend the broker socket bind into damocles and install `hive-ag3nt` there. No need to subsume damocles under hive-c0re. diff --git a/docs/turn-loop.md b/docs/turn-loop.md index 696870c1..3f86a01b 100644 --- a/docs/turn-loop.md +++ b/docs/turn-loop.md @@ -474,7 +474,7 @@ meta's. + agent.nix, restarts). No approval, idempotent. Manager calls this on receipt of a `needs_update` system event. - `request_apply_commit(agent, commit_ref)` — submit a config - change for any agent (`hm1nd` for the manager's own config) for + change for any agent (`root` for the manager's own config) for operator approval. - `request_update_meta_inputs(inputs?, description?)` — queue an approval to run `nix flake update [inputs...]` on the meta flake. @@ -502,7 +502,7 @@ meta's. sub-agent container (diagnose MCP-registration failures, startup crashes, etc.). Pass the plain logical agent name; hive-c0re resolves the machine name (`h-`, manager - `hm1nd`). `lines` defaults to 50, host-capped at 500. + `root`). `lines` defaults to 50, host-capped at 500. - `request_schedule_prompt(targets, body, first_fire_at_unix, interval_seconds?, description?)` — queue an operator-approval for a scheduled prompt. On approve, `body` is fanned out to each `targets` agent at diff --git a/docs/web-ui/dashboard.md b/docs/web-ui/dashboard.md index 6847e769..b62ff06f 100644 --- a/docs/web-ui/dashboard.md +++ b/docs/web-ui/dashboard.md @@ -288,7 +288,7 @@ to confirm; `@*` broadcasts). `POST /op-send` drops `{from:"operator", to, body}` into the broker; the resulting SSE frame re-renders both the terminal row and the inbox section. Manager is addressed as `@manager` (the broker recipient string), -not `@hm1nd` (the container name). +not `@root` (the container name). ## Container row diff --git a/nix/templates/harness-base.nix b/nix/templates/harness-base.nix index 9deb2c3e..1112e767 100644 --- a/nix/templates/harness-base.nix +++ b/nix/templates/harness-base.nix @@ -1316,9 +1316,7 @@ in HIVE_WEB_SOCKET = "/run/hive-agent/${userName}/web.sock"; } // lib.optionalAttrs isManager { - # Standalone-eval fallbacks; meta.rs overrides at deploy time. - # HIVE_PORT = FNV-1a("root") % 900 + 8100. - HIVE_PORT = "8273"; + # Standalone-eval fallback; meta.rs overrides at deploy time. HIVE_LABEL = "root"; # Manager always uses a unix socket so the gateway can route # /agent// to it the same way it routes sub-agents.