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

5,917 commits

Author SHA1 Message Date
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
atlas
08f010b742 swarm-grafana: run in its own network namespace 2026-10-22 09:55:54 +02:00
atlas
5fe71fd056 credentials docs: trim the page to what an operator running a swarm needs
- table cells: cut to what the credential is, where it comes from and what the operator does
- prose sections: cut the matrix-prefix, appservice-token and leaf-delivery sections; trimmed revocation and retry notes to their operator-visible effect
- progressive enhancement section: removed (contributor rules)
- intro: cut to the store, the on-disk certificate and the column meanings
- docs index: drop the "progressive-enhancement rule" clause from the credentials.md entry in docs/README.md
- matrix rows: one sentence saying the name `main` is reserved
2026-10-22 07:55:42 +02:00
iris
fd7af4858d frontend: regenerate npm-deps-hash after dropping dompurify and marked from the dashboard workspace 2026-10-22 07:36:47 +02:00
iris
6d080ea28b dashboard: remove the state-file endpoint, the file_refs path scan and the unused marked and dompurify deps 2026-10-22 07:36:47 +02:00
atlas
0f7b403803 agents get a todo when assigned to an issue or PR, rewritten when unassigned and cleared on close
A new swarm service, swarm-notify-router, in its own container on the host
that sets deploy.notify-router.enable (defaulted on by allSwarmServices where
the host has the router's store leaf, like the claude login minter).

- swarm-controller registers instance-wide hooks for `issues` +
  `issue_assign` and `pull_request` + `pull_request_assign`, updates the
  event list of a hook already registered with fewer (leaving its active flag as it is), and keeps each
  verified body unchanged in the SWARM_EVENTS stream on
  $SWARM.events.forge.<X-Forgejo-Event-Type>, deduped by X-Forgejo-Delivery.
  A delivery the stream did not keep answers 503.
- swarm-notify-router drains its durable consumer on that stream, runs its
  flows (source -> match -> todo sink, stored as nodes plus edges and checked
  to be a tree) and queues each op on $SWARM.router.todo.<agent> in the
  work-queue stream ROUTER_TODOS. Built-in flows: assigned, unassigned (same
  key, rewritten) and closed (prefix-clears every holder's router todos). A
  per-issue snapshot in its notify-router-state bucket holds the last
  assignees and the todo holders; only agents in the agent-status bucket get
  ops, and an assignee that was not one is left out of the snapshot so the
  next assign event retries it. After the first event that must be retried,
  the rest of the batch is nakked so redelivery keeps stream order.
- hive-agent creates its own durable consumer todo-<agent> and applies each
  op to its todo store as subsystem `router`, then acks; a refused op stops
  the rest of its batch the same way. The store's (subsystem, key) dedup
  makes a redelivery harmless. New Todos::clear_prefix.
- swarm-nats-auth: a --notify-router-client arm; the controller may publish
  $SWARM.events.forge.*; each agent gets three {agent} templates (extended
  consumer create whose filter the server checks, MSG.NEXT, ACK).
- Credentials: a notify-router store leaf minted by glue-bao-tls, a
  swarm-notify-router bao policy (read on its own queue client secret), an
  authelia machine client, the secret publisher entry, a journal forwarder
  route. No manual step.

hive-forge-notify is unchanged, so agents also still get forge's own
notifications.

Refs #5571
2026-10-22 07:28:53 +02:00
atlas
156dd541e6 hive-priv: count a process being reaped as dead in the build-timeout test
The timeout kill was sound; the test's liveness probe was not. is_dead
read /proc/<pid>/stat and counted only state Z as dead. While init reaps
a zombie, the task shows state X (EXIT_DEAD) for a few microseconds
before its /proc entry goes away. When the poll loop's first probe saw Z
and the final assert's re-probe landed in that window and saw X, the
test failed at once with "grandchild <pid> outlived the timeout". CI run
#6059 shows this: the hive-priv binary finished in 2.00s, so the 5s poll
never ran.

is_dead now counts X as well, so it is monotone (running, Z, X, gone)
and the re-probe can no longer flip it back to alive. A unit test pins
the Z/X/S/R parsing.

Stress loop: the test binary filtered to this test, 2000 runs, 32 in
parallel, with 8 busy-loop CPU hogs. Before: 4/2000 failed, all with the
CI signature (finished in ~2.01s). After: 0/2000.
2026-10-22 07:14:08 +02:00
iris
31b7452e56 swarm-ui: let a closed stream reconnect and a failed caps read retry
When the server answers an event stream with an error status the browser
gives up and the badge stayed on disconnected with nothing to press. The
terminal, its state header and the messages page now offer a reconnect,
and the one rule for the state after an error moved into a tested helper.
The resource caps panel gets a retry beside its error, and its loading
state announces itself.
2026-10-22 07:13:32 +02:00
atlas
9b1fe85706 claude: say on stderr when the hive's pinned claude-code is missing
A set HYPERHIVE_CLAUDE_CODE_PATH whose build is gone (collected after a
bump while the container still holds the old facts) made the wrapper
run the container's own claude-code silently, which can be a different
version. It now prints one line naming the missing path.

Refs #4857
2026-10-22 07:11:46 +02:00
atlas
9113651c10 hand agents the dashboard port, pinned claude and otel labels at container start
The three values that differ per host (deploy.hive-controller.dashboardPort,
claudeCodePackage and otel.extraResourceAttributes) no longer go into the
meta flake. hive-priv writes them into the container's
/etc/hyperhive-hive-facts with the hive name and domain, and the agent
reads them at boot:

- HIVE_DASHBOARD_PORT reaches every unit through the hive-facts generator;
  the web UI still defaults to 7000 without it.
- `claude` on PATH is a wrapper that runs HYPERHIVE_CLAUDE_CODE_PATH's
  claude when it is there, and the container's own claude-code otherwise.
  The host's serve.json keeps gc-rooting the pinned build.
- OTEL_RESOURCE_ATTRIBUTES moves out of the units' Environment= into a
  boot-time generator, which appends HYPERHIVE_OTEL_EXTRA_RESOURCE_ATTRIBUTES.

The agent options services.hyperhive.agent.claudeCodePath (now a removed
option) and otel.extraResourceAttributes go; only the meta render set them.
render_flake takes no HiveEnv any more, so the memory-cap render test and
render_hive_flake_at, which only existed to vary HiveEnv into the render,
go with it.

Refs #4857
2026-10-22 07:11:46 +02:00
damocles
a32c144b80 turn test: build the bus inside with_harness_dir so it passes without HYPERHIVE_HARNESS_DIR 2026-10-22 00:08:14 +02:00
iris
9ae56e0fec dashboard: inline the frost background fallback and fix a stale flow-page reference
The frost variable was defined only in the removed flow stylesheet, so its
fallback always applied. The messages page header no longer points at the
flow page.
2026-10-21 23:57:37 +02:00
iris
e7f977b99e dashboard: drop the path-link and side-panel code the flow page was the only user of
appendLinkified had one caller, the flow page, and it pulled in the
path-link and file-preview chain, the side-panel singleton, the marked
and DOMPurify wiring and the css only they used. The docs stop
describing the dashboard side panel and the client reading file_refs.
2026-10-21 23:57:37 +02:00
iris
8b415f91e3 docs: use active voice in the web UI shape page 2026-10-21 23:57:37 +02:00
iris
fa131b46a6 dashboard: remove the flow page and the endpoints only it used
The flow page showed the raw broker message stream and had a compose box.
This removes the page and its bundle, its link in the pages menu, and the
styles only it used.

The history endpoint that backfilled it and the operator-send endpoint
behind the compose box had no other caller, so they go too, along with
the broker query behind the history endpoint. The stream endpoint stays:
the dashboard tabs still subscribe to it.

The docs lose the FL0W section and the references to the two endpoints.
2026-10-21 23:57:37 +02:00
iris
acf82beba3 swarm-ui: add CheckboxField and use it for the issue report toggle and the account delete option 2026-10-21 23:56:30 +02:00
damocles
a1a70e257c agent prompt: point the forge condition at HIVE_FORGE_TOKEN_FILE instead of a state-dir file 2026-10-21 23:55:44 +02:00
damocles
9d1a8c0d9a screen relay: close the websocket when the vnc side hangs up and stop the surviving task 2026-10-21 23:55:24 +02:00
iris
515d974f11 docs: separate the load-failure reason from the field text in the create-agent dialog 2026-10-21 23:33:54 +02:00
iris
803ba01372 docs: describe the create-agent dialog's hive and permission load failures 2026-10-21 23:33:54 +02:00
iris
46a6fc36d8 swarm-ui: say when the hive or permission list failed to load, and name the permissions group 2026-10-21 23:33:54 +02:00