refactor(#2464): rename hive-ag3nt crate to hive-agent, collapse lib into main

This commit is contained in:
damocles 2026-07-15 01:18:22 +02:00 committed by mara
commit 3f1643c594
57 changed files with 101 additions and 130 deletions

View file

@ -1,4 +1,4 @@
# The hive-ag3nt harness service itself, plus the per-agent knobs it
# The hive-agent harness service itself, plus the per-agent knobs it
# reads from its environment: model selection, effort level,
# compaction watermark, and the extra reverse-proxies of the per-agent
# web UI.
@ -176,7 +176,7 @@ in
# docs/agent-hierarchy.md::Harness systemd unit shape. PATH /bin
# auto-append behaviour: docs/gotchas.md::systemd.services.*.path
# appends /bin to every entry.
systemd.services.hive-ag3nt =
systemd.services.hive-agent =
let
binary = "hive-agent";
in

View file

@ -299,7 +299,7 @@ in
{
description = "Inject the OTEL auth header into the agent's claude user settings";
wantedBy = [ "multi-user.target" ];
before = [ "hive-ag3nt.service" ];
before = [ "hive-agent.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;
@ -341,7 +341,7 @@ in
systemd.services.hive-claude-onboarding = {
description = "Seed claude onboarding + project-trust so choom skips the walkthrough";
wantedBy = [ "multi-user.target" ];
before = [ "hive-ag3nt.service" ];
before = [ "hive-agent.service" ];
serviceConfig = {
Type = "oneshot";
RemainAfterExit = true;

View file

@ -14,7 +14,7 @@
via `claude --add-dir`, so the markdown is readable at
`$HIVE_DOCS_DIR/`, and appends a single pointer sentence to the agent's
system prompt so it knows the docs exist (see
`hive-ag3nt::prompt::render`). Default-on for the root/manager agent
`hive-agent::prompt::render`). Default-on for the root/manager agent
(see `../templates/ruth.nix`), off elsewhere; any agent can flip it from its
`agent.nix`.
'';
@ -40,10 +40,10 @@
# The harness reads HIVE_DOCS_DIR and passes it to claude as
# `--add-dir` so the docs are readable, and appends a single
# pointer sentence to the system prompt
# (hive-ag3nt::prompt::render) telling the agent the docs exist.
# (hive-agent::prompt::render) telling the agent the docs exist.
# Source is `hyperhive.docs.source` (the narrow `hyperhive-docs`
# meta-flake input, or `pkgs.hyperhive-docs` for standalone
# builds). See hive-ag3nt::turn.
# builds). See hive-agent::turn.
HIVE_DOCS_DIR = "${config.hyperhive.docs.source}";
};
};

View file

@ -212,14 +212,14 @@ in
# per-turn MCP registration race). It dials the control socket
# (`/run/hive/mcp.sock`, the harness binaries' default) fresh on every
# tool call, so a host-side hive-c0re restart is transparent.
# `before = hive-ag3nt` so the URL is already listening by the time
# `before = hive-agent` so the URL is already listening by the time
# the harness renders the first turn's config; the harness/claude also
# reconnect on their own, so ordering is a latency nicety not a hard
# correctness dep.
systemd.services.hive-mcp-http = {
description = "persistent streamable-http MCP daemon for the hyperhive surface";
wantedBy = [ "multi-user.target" ];
before = [ "hive-ag3nt.service" ];
before = [ "hive-agent.service" ];
environment.RUST_LOG = "info";
serviceConfig = {
ExecStart = "${config.hyperhive.packages.hive-agent-mcp}/bin/hive-agent-mcp --http 127.0.0.1:${toString config.hyperhive.mcp.httpPort}";

View file

@ -42,7 +42,7 @@
wantedBy = [ "multi-user.target" ];
after = [ "local-fs.target" ];
# Ordered before every network consumer that does DNS on first
# boot. `hive-ag3nt` (the harness) is the load-bearing one: its
# boot. `hive-agent` (the harness) is the load-bearing one: its
# first-turn api.anthropic.com lookup must not race the resolv.conf
# rewrite (it only declares `after network.target`, so without this
# edge the harness can start before we've fixed resolv.conf and the
@ -52,7 +52,7 @@
before = [
"network-online.target"
"tea-login.service"
"hive-ag3nt.service"
"hive-agent.service"
"hive-matrix-daemon.service"
];
unitConfig.ConditionPathExists = "/etc/hyperhive-bridge-dns";

View file

@ -6,7 +6,7 @@
}:
let
# GUI processes run as the agent's own non-root user — the same user
# hive-ag3nt runs as (declared + home-chowned by harness-base.nix) — so
# hive-agent runs as (declared + home-chowned by harness-base.nix) — so
# weston, the wayland client, and the agent share one user session.
# `hyperhive.user.name` is set per-agent by the meta-flake renderer.
userName = config.hyperhive.user.name;

View file

@ -39,11 +39,11 @@ in
};
# `cargo test --workspace` lifted out of the package builds so the
# `hyperhive-assets` dep (which `hive-ag3nt::prompt::tests`
# `hyperhive-assets` dep (which `hive-agent::prompt::tests`
# needs via `HIVE_ASSETS_DIR` to assert against the actual
# production prompt template) is scoped to this one check
# instead of bleeding into the binary derivations' input
# hash. Net: editing `hive-ag3nt/prompts/system.md` still
# hash. Net: editing `hive-agent/prompts/system.md` still
# rebuilds this test check (correct — the tests assert
# against its wording), but `packages.default` and the
# per-container toplevels stay fully cached.

View file

@ -142,7 +142,7 @@ in
}
// lib.optionalAttrs (config.services.hyperhive.swarm.peers != { }) {
# Peer hives serialised as a JSON array of {domain, cert_fingerprint,
# wireguard_address?} objects. Consumed by hive-ag3nt::identity::peers()
# wireguard_address?} objects. Consumed by hive-agent::identity::peers()
# + the dashboard's peer_hives StateSnapshot field (P33RS tab). Domain
# is the attrset key; cert_fingerprint is null for CA-trusted peers;
# wireguard_address is omitted when not part of the mesh.

View file

@ -34,7 +34,7 @@
first boot and drives the gateway/forge/agent URLs, with no safe
default; changing it later is destructive). Exposed to agents as
`HYPERHIVE_HIVE_DOMAIN`; consumed by
`hive-ag3nt::identity::hive_domain()` for `<name>@<domain>`
`hive-agent::identity::hive_domain()` for `<name>@<domain>`
qualified labels.
'';
};

View file

@ -19,16 +19,16 @@
stdenv.mkDerivation {
pname = "hyperhive-assets";
version = "0.1.0";
# Narrow `srcs` (branding/ + hive-ag3nt/prompts/) is what decouples
# Narrow `srcs` (branding/ + hive-agent/prompts/) is what decouples
# this derivation's input hash from the rest of the tree.
srcs = [
../../branding
../../hive-ag3nt/prompts
../../hive-agent/prompts
];
unpackPhase = ''
runHook preUnpack
cp -r ${../../branding} branding
cp -r ${../../hive-ag3nt/prompts} prompts
cp -r ${../../hive-agent/prompts} prompts
chmod -R u+w branding prompts
runHook postUnpack
'';

View file

@ -43,7 +43,7 @@ let
#
# Tests are kept in the separate `checks.cargo-test` derivation
# (carries the hyperhive-assets build input for the prompt-template
# assertions in hive-ag3nt::prompt::tests). Keeping them out of this
# assertions in hive-agent::prompt::tests). Keeping them out of this
# derivation means a prompt edit doesn't bust the cargo cache.
workspaceBuild = craneLib.buildPackage {
src = cleanSrc;
@ -160,7 +160,7 @@ in
# `preBuildAgentTemplates` option on the hive-c0re module —
# see nix/host-modules/hive-c0re.nix). Speeds up the first agent
# spawn dramatically because the heavy lifting (nixpkgs +
# claude-code + hive-ag3nt binary) is already in the store
# claude-code + hive-agent binary) is already in the store
# when the meta evaluator goes to build the container.
#
# nixosConfigurations are pinned to x86_64-linux (nixos-

View file

@ -14,7 +14,7 @@
# $out/share/icons/hicolor/<N>x<N>/apps/hyperhive.png (N = 16,32,48,64,128,256)
# $out/share/pixmaps/hyperhive.png (48px fallback)
# $out/share/applications/hive-c0re.desktop
# $out/share/applications/hive-ag3nt.desktop
# $out/share/applications/hive-agent.desktop
stdenv.mkDerivation {
pname = "hive-xdg-icons";
version = "0.1.0";
@ -62,11 +62,11 @@ stdenv.mkDerivation {
NoDisplay=true
StartupNotify=false
EOF
cat > "$out/share/applications/hive-ag3nt.desktop" <<EOF
cat > "$out/share/applications/hive-agent.desktop" <<EOF
[Desktop Entry]
Type=Application
Name=hyperhive agent
GenericName=hive-ag3nt
GenericName=hive-agent
Comment=hyperhive per-agent harness (claude turn loop + MCP server)
Exec=hive serve
Icon=hyperhive