Watch
0
0
Fork
You've already forked hyperhive
0
Commit graph

5,887 commits

Author SHA1 Message Date
atlas
ec562ca503 drop port-collision checks against swarm.otel.telemetryPort
nothing at runtime: eval no longer asserts against a port the swarm
collector no longer binds in the host netns.
2026-10-24 23:02:37 +02:00
atlas
6b1fc4b040 module-eval: four containers left on the host netns 2026-10-24 23:02:37 +02:00
atlas
e226e65954 swarm-otel: run in its own network namespace, receivers on unix sockets
Refs #4815
2026-10-24 23:02:37 +02:00
atlas
ed1fd053e7 notify router: deliveries log, dry-run hit counts, api and page 2026-10-24 22:13:07 +02:00
atlas
6dd9d0086e refuse an agentNatsUrl that hive-priv would reject at container start
on deploy, deploy.hive-controller.queue.agentNatsUrl must be one
scheme://host:port; an IPv6 literal or a comma list now fails at evaluation
instead of failing every container start.
2026-10-24 21:13:25 +02:00
atlas
bbc6174361 leave an agent with no config commit out of internal/meta; read config heads from main
on deploy, one agent whose agent-configs repo has no commit on main is
skipped and logged instead of failing the whole internal/meta render, so the
other agents' pin moves go through. the controller reads each config head
from main, the branch hive-c0re compares against, not the repo's default
branch.
2026-10-24 21:13:25 +02:00
atlas
4697740a7e build an archetype agent from internal/meta only at the archetype it has now
on deploy, hive-c0re takes the internal/meta head for an archetype agent only
when the head lists that same archetype, and for a custom agent only when the
head lists it as custom, so a switch between the two, or to another archetype,
builds from the hive's own flake until the swarm commits the new flake.
the record location is described in the same docs paragraph.
2026-10-24 21:13:25 +02:00
atlas
4323097964 keep the meta-rev record in hive-c0re's state, written by rename
on deploy, the commit a rebuild builds an agent from is recorded under
/var/lib/hyperhive/meta-rev/<agent> instead of the agent's runtime dir, which
is mounted read-write into its container. an agent can no longer pick or
redirect the record. the file is written to a temp name and renamed over.
2026-10-24 21:13:25 +02:00
atlas
51866929d5 split render_flake into per-section helpers; no runtime change
Pure refactor of hive-meta-flake: render_flake now calls one helper per section of the flake, so the too_many_lines allow is gone. The rendered text is unchanged.
2026-10-24 21:13:25 +02:00
atlas
7c0a622d41 build agents from internal/meta when it pins their config
A rebuild's MetaSync resolves the head of the swarm's internal/meta once and
records it; the prebuild and the swap build that flake instead of the hive's
own, and a first deploy does the same in Create. hive-priv takes the commit as
a validated meta_rev on UpdateContainer and CreateContainer and builds from its
own forge URL (HIVE_PRIV_FORGE_URL).

The head is used only when its flake lists the agent at the config commit the
forge's main is at; otherwise, and when the repo has no commit or this hive has
no core token file for nix's git, the hive renders locally as before.

hive-c0re's and hive-priv's gitconfig now share the forge credential helper and
rewrite the forge's https URLs to http, which hive-priv lacked.
2026-10-24 21:13:24 +02:00
atlas
22e2d30581 pin internal/meta's hyperhive on the controller's rev and rebuild agents when it moves
The swarm controller offers its own running rev (services.hyperhive.c0re.
hyperhiveRev) as the hyperhive pin of internal/meta and takes it only when
the forge compare API shows it descends from the committed pin; merges to
hyperhive main no longer move the pin, and the first commit pins main's head.
When a commit moves the pin, every placed agent gets a TriggerDeploy.

A deploy after a meta update no longer waits on it succeeding (after_any), so
a down builder does not hold back hives that render locally.
2026-10-24 21:13:24 +02:00
atlas
5950363a10 swarm-controller: render, lock and commit internal/meta
A new update_meta node renders internal/meta's flake.nix with
hive-meta-flake, the renderer hive-c0re uses: hyperhive pinned to its
forge main, each custom agent a hive places pinned to its agent-configs
main, all over https, and the swarm-wide values from
SWARM_CONTROLLER_META_FLAKE (set by swarm-controller.nix from
services.hyperhive.swarm.*). The swarm builder locks it, and the
controller commits flake.nix and flake.lock in one commit and gives
every hive's forge account read on the repo. A render equal to the
committed flake.nix sends no lock and commits nothing.

It runs at start, when hyperhive's main moves, before the deploy of a
merged config PR and before the first deploy of a new agent; those
deploys now wait for it. agent_web_port moves into hive-meta-flake so
both callers compute the same port; hive-c0re re-exports it.

On deploy: internal/meta appears on the forge and follows every merge.
No hive builds from it yet.

Refs #4857
2026-10-24 21:13:24 +02:00
atlas
f3c0a87c0f hand agents the queue address at container start
HIVE_AGENT_NATS_URL now reaches each container in its hive facts, from
the host's deploy.hive-controller.queue.agentNatsUrl, instead of being
rendered into the meta flake. The agent option
services.hyperhive.agent.queue.natsUrl is removed; the harness unit
imports the queue credential whenever the token endpoint is set.

On deploy every agent rebuilds once (the rendered flake loses the
address), and the harness reads the address from the facts file
hive-priv writes before each start.

Refs #4857
2026-10-24 21:13:24 +02:00
atlas
ba97c64dda move the meta flake render into the hive-meta-flake crate
hive-c0re's render_flake and the pieces it needs (AgentSpec, AgentPin,
pinned_git_url, the forwarded-var tables, canonical_inputs_in_lock) move
into a new crate with no IO. The forwarded values and the GitHub switch
are now arguments; hive-c0re passes what it read from its own unit env,
as before. Nothing changes on deploy: the rendered flake is byte-for-byte
the same, and hive-c0re's render tests pass unchanged.

Refs #4857
2026-10-24 21:13:24 +02:00
atlas
de323a72dd swarm-builder: lock the swarm meta flake on request
A request on $SWARM.builder.lock-meta carries a rendered flake.nix. The
builder writes it into a scratch directory, runs `nix flake lock` there
with the same forge credential helper its builds use, answers with the
flake.lock nix wrote, and removes the directory. It commits nothing; the
controller commits the lock beside the flake.

Locks are answered in their own loop, like archetype evaluations, so one
does not wait behind an hour-long build. The auth callout grants the
subject to the builder (subscribe) and the controller (publish) only.

Ported from c574a1694 onto the swarm-wire crate.

Refs #4857
2026-10-24 21:13:24 +02:00
atlas
d331eb394b ci: take jq from flake.lock too, so no CI job resolves tools from the moving registry 2026-10-24 20:53:58 +02:00
atlas
d1d874770b ci: run vale from flake.lock instead of the moving nixpkgs registry 2026-10-24 20:31:22 +02:00
atlas
26c4ff89d5 approve a requested review when the repo has no review rules
On deploy: a review requested of the review classifier on a PR whose repo
holds neither .hyperhive/review-classifier.yml nor .json on its default
branch now posts an APPROVED review at once, saying no review rules are
configured for the repo and it was approved without checks. No model call
is made. Before, that case posted a "No verdict" comment. A rules file that
exists but fails to load or parse still posts no verdict. The rule model is
unchanged and instance-wide: every repo without a rules file is approved.
2026-10-24 17:28:40 +02:00
atlas
0b1669a364 request the review classifier's review when a PR's head moves
The router gets a request_reviewer node and a pull_request_sync source;
the built-in head-classifier flow asks swarm-controller, over
$SWARM.router.sink.request-reviewer, to request review-classifier on
every push, unless its review of the head already stands. The controller
subscribes to pull_request_sync on its pull-request hook and answers
the router; nats-auth grants the router the publish and the controller
the subscribe.
2026-10-24 17:23:36 +02:00
atlas
463c5cbfcc share the standing-review rule between hive-forge and the controller
pr assign-reviewer behaves as before; the latest-review fold and the
superseded check move to hive-types::review.
2026-10-24 17:23:28 +02:00
atlas
65329fb506 Revert "swarm-otel: run in its own network namespace, receivers on unix sockets"
This reverts commit 8aad8db30d.
2026-10-24 15:09:11 +02:00
atlas
04214a6afa Revert "module-eval: four containers left on the host netns"
This reverts commit 03fc548b0a.
2026-10-24 15:09:11 +02:00
atlas
196161654a Revert "drop port-collision checks against swarm.otel.telemetryPort"
This reverts commit 627964f72d.
2026-10-24 15:09:11 +02:00
iris
68e289fff5 swarm-ui: rewire a notification flow by drag or keyboard
The flow editor can now change a flow's shape on the canvas, not only
through the inspector's fields:

- drag a box onto another to move it and its branch there; a drop the
  save would refuse shows the target dashed red and gives the reason;
- a palette of node kinds adds a node below the picked box on click, or
  below any box it is dragged onto; it offers what the controller lists;
- arrow keys walk the tree, M picks a box up and Enter drops it under
  the focused one, Alt+Up/Down reorder a node among its siblings, Delete
  removes a branch; focus follows the edit;
- each box with siblings says when it runs, and the inspector can move
  it earlier or later, since the router runs children in edge order;
- request_reviewer is a second leaf kind beside todo, with a reviewer
  field;
- leaving with unsaved edits asks first, also for in-app links and the
  back button (a router hook runs navigation past a page's guard).
2026-10-24 15:08:48 +02:00
atlas
e01770c056 swarm: drop the -agent client suffix refusal from authelia and the queue responder
authelia.agentClientSuffix is removed (tombstoned) and the responder
takes no --agent-client-suffix: hive-<name>-agent is parsed as hive
<name>-agent like any other id. The reserved word agent still keeps a
hive from being named *-agent.
2026-10-24 15:02:32 +02:00
damocles
6bcffb0ebb todo socket: pause after a failed accept instead of spinning 2026-10-24 14:47:56 +02:00
atlas
0a1e4db0f4 closed flow also queues a closed todo on each agent that held one, after the clear 2026-10-24 14:41:13 +02:00
iris
fb8aa23e66 swarm-ui: a todo switched from clear to upsert drops its prefix flag 2026-10-24 14:40:39 +02:00
iris
06f3e76329 docs: edit-flow section reads clean under the prose lint 2026-10-24 14:40:39 +02:00
iris
f28e1e9063 swarm-ui: edit a notification flow on a canvas
A custom flow opens at /notifications/<id>: its nodes drawn left to right
(source, then matches, then todos), and a panel to edit the picked node: the
source's events, a match's conditions, a todo's recipients, op, key and text.
Add a match or todo below a node, move a branch under another match, or remove
it; an edit the controller would refuse (a todo with children, a second
parent, a cycle, over the node or depth cap) is turned away with the reason.

Edits stay in a draft until save, which sends the whole document at the
revision read. A stale revision is told apart from a refused document: the
editor offers to reload or to keep the draft on top of the latest. The form
choices come from the controller's schema when it sends one.

The list page gains edit and duplicate on custom flows, duplicate on the
built-ins, and a new-flow box; a new flow's id avoids the built-ins' too.
2026-10-24 14:40:39 +02:00
atlas
c00fd99112 swarm: no doc says the agent client is minted any more 2026-10-24 14:00:26 +02:00
atlas
495c45c2c2 swarm: drop the stale claim that authelia mints hive-<name>-agent 2026-10-24 14:00:26 +02:00
atlas
868c6cf96c drop the shared hive agent login
Every agent now connects to the queue and reads logs with its own secret
from the store (#5181), so the per-hive `hive-<h>-agent` OIDC client has
no reader left. Remove it end to end:

- hive-c0re no longer forwards `hive-queue-agent-{secret,client-id}` into
  containers, and no longer forwards HIVE_AGENT_OIDC_TOKEN_ENDPOINT; the
  agent module that loaded them (nix/agent-modules/queue.nix) is gone, its
  options refused with a removal message.
- The host reader (glue-queue-agent-credential.nix, swarm-bao-queue-agent),
  its store role and policy unit (swarm-bao-queue-agent-policy), its PKI
  leaf and the deploy.bao.queueAgent* / queue.agentCredentialDir options
  are gone; the options are refused with a removal message.
- authelia mints no `hive-<h>-agent` client, and swarm-secret-publish no
  longer writes swarm/hives/<h>/queue/agent.
- swarm-secret-client drops queue::agent_client_path / queue::Credential.
- HIVE_AGENT_NATS_URL is now gated on the agents' queue address alone.

The log store's authelia check stays for operators. swarm-nats-auth still
refuses a `-agent` client id; that refusal and `agentClientSuffix` are left
for a follow-up.

Refs #4459
Refs #4765
2026-10-24 14:00:26 +02:00
iris
d19bd83aa5 swarm-ui: draft edits for the notification flow editor
Pure edits on a flow (add a child, remove a branch, move a branch, replace a
node, new and duplicate flow) that refuse what the controller's tree rules
would, plus the save request and what its status means. Nothing uses them
yet: the editor page that does comes next.
2026-10-24 13:46:03 +02:00
atlas
d5802d16a0 notify flows: GET returns a schema of the events, fields, node kinds and limits 2026-10-24 13:35:39 +02:00
atlas
627964f72d drop port-collision checks against swarm.otel.telemetryPort
nothing at runtime: eval no longer asserts against a port the swarm
collector no longer binds in the host netns.
2026-10-24 13:35:17 +02:00
damocles
a684ef1e34 meta test: retry the fake nix exec when it hits ETXTBSY 2026-10-24 12:12:38 +02:00
atlas
fe578c57fd ui docs: restore how custom flows are added 2026-10-24 12:12:27 +02:00
atlas
ada364a482 notify flows: refuse unknown placeholders and require the revision read on every save 2026-10-24 12:12:27 +02:00
atlas
7795da44f8 docs: notification flows, their API and the notifications page 2026-10-24 12:12:27 +02:00
atlas
0512862b3d swarm-ui: show the notification router's flows and switch built-ins off 2026-10-24 12:12:27 +02:00
atlas
e2e124755d swarm-controller: serve the notification router's flows at /api/notify/flows 2026-10-24 12:12:27 +02:00
atlas
bb08fac33c notify router: read custom flows and disabled built-ins from a stored document 2026-10-24 12:12:27 +02:00
atlas
03fc548b0a module-eval: four containers left on the host netns 2026-10-24 12:11:24 +02:00
atlas
8aad8db30d swarm-otel: run in its own network namespace, receivers on unix sockets
Refs #4815
2026-10-24 12:11:24 +02:00
atlas
bc4e0c23a0 treefmt 2026-10-24 03:23:17 +02:00
atlas
5ebec6d09b review classifier: a request for a moved head reviews the PR's current head
A request whose head the PR has moved on from was dropped without a word. It now runs on the current head, as before the queue. The re-post shortcut, keyed on the request's head, applies only while the PR is still at that head, so a moved PR never re-posts an old head's verdict.
2026-10-24 03:22:44 +02:00
atlas
efbcc3dce6 review classifier: group the queue consumer's handles into one struct
take and consume carried the forge, the classifier queue, the review poster and the run store as four separate parameters, which took take to eight and needed a too_many_arguments expectation. They travel together everywhere they are used, so they are now one Handles value, cloned per taken request. take has five parameters and no lint attribute. No behaviour change.
2026-10-24 03:22:44 +02:00
atlas
d6aa83146a review classifier: queued review requests survive a restart and are never refused 2026-10-24 03:22:44 +02:00
flake-bot
22256893fc nix flake update 2026-10-23 10:55:11 +02:00