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

5,909 commits

Author SHA1 Message Date
iris
c9649b258f swarm-wire: say the repos list holds only repositories with an open issue 2026-10-25 12:14:46 +01:00
iris
b6da2bc9d0 swarm-wire, swarm-ui: the flow schema lists the values a field takes, and the editor picks them instead of asking for typed names
The schema's event fields gain values, a values_from marker (agents, repos)
and a closed flag; a node field gains the marker and the flag. kind is now
listed as issue and PR, what the router sends. The flow editor shows a
dropdown where the list is complete, suggestions where it is only examples,
and a plain box where there is none.
2026-10-25 12:14:46 +01:00
atlas
3d142feb6a log refused agent-permission changes on the controller api 2026-10-25 11:33:12 +01:00
atlas
96405621d7 keep each hive's otel oidc secret on /run, not /var/lib 2026-10-25 11:16:24 +01:00
atlas
8b255b43a0 docs: describe the recorded meta fan-out pin 2026-10-25 11:06:53 +01:00
atlas
2b9927fda2 fan out the meta pin by a recorded pin, not by the move 2026-10-25 11:06:53 +01:00
iris
81fd4466a5 swarm-ui: say 1 hit, not 1 hits, in a box's screen-reader label 2026-10-25 11:00:38 +01:00
iris
404d8334aa swarm-ui: preview a draft flow's hit counts in the editor with the dry-run route
The editor's preview button posts the draft to POST /api/notify/dry-run and
puts each box's hit count on the canvas; any edit hides the numbers. Boxes of
kind request_reviewer label themselves "reviewer", so the long kind name no
longer runs into the hit count shown beside it.
2026-10-25 11:00:38 +01:00
atlas
e8538d8690 swarm-controller: POST /api/notify/dry-run runs a draft flows document 2026-10-25 11:00:38 +01:00
atlas
19680a8b78 service urls carry no gateway port, httpsPort is listen-only 2026-10-25 10:45:54 +01:00
atlas
4d9b7e0ca9 agent store leaf: 7 days instead of 90 2026-10-25 10:23:35 +01:00
atlas
2f00f9041f agent permissions: drop hive-c0re's swarm-agent-permissions.json fallback, fail closed before the first read
Removes the HiveCopy hand-off: hive-c0re no longer writes each agent's
entry from swarm-agent-permissions.json into its runtime dir as
swarm-permissions.json, and the harness and subagent daemon no longer
read it. hive-c0re keeps the file as its own last read of the swarm for
the manage_root_agent mounts. Also removes permissions_import::pending(),
its only caller being the hand-off. No nix provisioned the copy, so no
nix option is removed and no tombstone is needed.

Rule after this change: until an agent's first successful read of its
key it holds no permissions (no execution, so no bash), and a subagent it
starts holds the same. After a read a set key wins, [] holds none and an
unset key is the default. A failed read keeps the last value, so an
unreachable queue at start keeps the agent closed until a read succeeds.
The harness logs once at warn that it starts closed.

Fixes #5315
2026-10-25 02:17:32 +02:00
iris
6e7b5f84e9 swarm-ui: give the new-flow draft a route no flow id can take, and drop the dead hit-count rule
/notifications/new could be a saved flow's own page, so the draft now opens at
/notifications/draft/new, which has a segment more than any flow's route. The
placeholder id no longer needs reserving. The .notify-node-hits rule styled the
removed tree rows; nothing renders it.
2026-10-25 02:05:54 +02:00
iris
d0a55502a8 swarm-ui: draw notification flows as graphs in the list and make a new or copied flow a draft until saved
The flows list draws each flow as the editor's graph, read-only and with the
dry run's hit counts in the boxes, in place of the indented tree. A box's line
of text is cut by the browser at the box's edge, so it no longer runs out of it.

create flow (a primary button beside the refresh interval) and duplicate open
the editor on an unsaved draft at /notifications/new, with ?from= naming the
flow to copy; the flow is made by save, under an id taken from its name. Edit
and duplicate are buttons in the flow's header row. The editor's head and
inspector are laid out as sections.
2026-10-25 02:05:54 +02:00
iris
b93eaaff51 swarm-ui: fix the stale refusal comment, guard the create dialog's submit, say what create another keeps
The refusal comment still described collapsed sections the dialog no longer
has. The form's submit now returns while a create is in flight. The docs say
create another keeps only the hive.
2026-10-25 01:44:24 +02:00
iris
339da0aebe swarm-ui: make agent creation a five-step dialog with a fixed header and footer
The create dialog was one tall form that scrolled as a whole, so its header
and button moved out of view. It is now steps you go through in order:
identity, instructions (AGENTS.md in a box of its own), permissions,
resources and inference, then a summary of what will be sent and what the
agent creation queues, where create is. The header, step tabs and footer stay
put and only the step's own fields scroll. A refused AGENTS.md text sends the
dialog back to its step. The request is unchanged.
2026-10-25 01:40:20 +02:00
atlas
f0a80c9812 notify router: bound the deliveries log append, note doubled retry rows 2026-10-25 01:26:25 +02:00
iris
78c48272ee swarm-ui: edit an agent's permissions on its detail panel
The detail panel had editors for inference, instructions, resource caps and
accounts, but nothing for the permissions the swarm grants, which could only
be set at create time or with swarmctl. A permissions row shows the grant
(the default set, none, or the list) and an edit dialog ticks the catalogue
from GET /api/permissions and saves with PUT /api/agents/{agent}/permissions.
Ticking exactly the default set sends the DELETE, as the create form sends no
list for it.
2026-10-25 01:18:26 +02:00
atlas
eaf26aaadd review classifier: export request, verdict, check and run metrics, with a dashboard
The controller counts review requests, verdicts and per-check results and times each run; the classifier service counts retried asks. A provisioned Grafana dashboard charts them.
2026-10-24 23:24:31 +02:00
atlas
7680b07fcb swarm-otel: routes carry a route header and the readiness probe requires it 2026-10-24 23:02:37 +02:00
atlas
41bea3c6d9 swarm-otel: let the collector write its socket dir, and probe every route through nginx 2026-10-24 23:02:37 +02:00
atlas
1325f44707 swarm-otel: route the gateway from the receiver list and check the sockets accept
Refs #4815
2026-10-24 23:02:37 +02:00
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