| Filename | Latest commit message | Latest commit date |
|---|---|---|
`MATRIX_HTTP` was `http://localhost:8008`, compiled in, used at 18 call sites. That address is right only while the homeserver happens to share this daemon's netns, and its doc comment asserted exactly that as a general fact. A hive whose homeserver lives anywhere else builds fine and then talks to the wrong machine. It now reads `HIVE_MATRIX_API_URL`, which `hive-c0re.nix` sets from `hyperhive.matrix.apiUrl`. The matrix module fills that in with its own loopback listener when it is the thing running tuwunel — there it is not a guess but a fact about what it just started — and the operator sets it by hand otherwise. There is no compiled-in fallback, for the same reason `forge_http_base()` has none. `is_present()` follows. It used to scan `nixos-container list` for `hive-matrix`, which answers "is the homeserver a container on this host" — a different question, and the reason a remote homeserver would silently no-op no matter how it was addressed. It now asks whether a URL is configured. A co-located hive is unaffected: the module supplies the loopback URL whenever it runs tuwunel itself. It also stops being `async`, since it no longer does IO, and `require_matrix_present`'s message names both ways to have a homeserver rather than only the local container. Absent a URL, every matrix path no-ops exactly as it did with no container, and the two accessors make that structural: `Option` for the callers that fall back to `None`, a `Result` flavour naming the skipped `is_present()` gate for the ones that propagate. |
||
| .. | ||
| src | ||
| Cargo.toml | ||
| README.md | ||
hive-c0re
The unprivileged host daemon (runs as hive-core). Owns the sqlite
broker, the approval/question/schedule queues, the generic job-DAG
queue, container lifecycle, gateway/forge/matrix provisioning,
per-container stats, and the axum operator dashboard. Largest crate in
the workspace — bin-only, no separate lib.
When to use it
Host-level, cross-container orchestration: spawning/rebuilding/
destroying agent containers, the approval flow, dashboard-visible
state, provisioning per-agent forge/matrix/gateway accounts. Agent-side
behavior (turn loop, MCP tools) lives in hive-agent/hive-agent-mcp
instead — this daemon only talks to agents over the socket wire types
in hive-sh4re.
Shape
Cohesive clusters live in directory submodules, each re-exported at
the crate root (crate::broker::… keeps resolving regardless of which
subdirectory a module actually lives in). One line each — read the
module's own //! doc-comment for real detail, don't expect this file
to track it:
dashboard/— the operator dashboard (containers, approvals, schedules, questions, logs, topology).job_queue/— the job-DAG queue + desired-state reconciliation (docs/coordinator.md).lifecycle/—nixos-containerlifecycle + per-agent config flake generation.stores/— sqlite-backed stores (broker, queues, audit, power).workers/— background sweeps (crash watch, scheduled prompts, auto-update, knowledge sync).agent_config/— per-agent registries (tool groups, capabilities, resource limits, topology).stats/— dashboard metrics aggregation + OTEL export.socket_server/— the unix-socket request server shared by per-agent + manager sockets.forge/— optional Forgejo wiring (docs/forge.md).coordinator.rs— top-level wiring forserve.meta.rs,migrate.rs— the meta flake + schema/state migrations.matrix.rs,gateway_nginx.rs,webhook_secret.rs,priv_client.rs— matrix provisioning, gateway vhosts, webhook secrets, and thehive-privclient respectively.
See the top-level CLAUDE.md/docs/ index for the full reading-path
map.