hyperhive/swarm-controller/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 76d5871d20 feat(#3124): publish the agent set the swarm declares for each hive
The hive-side loop landed without anything to converge to: nothing wrote
`$KV.hive-wanted.<hive>`, so in production only the "no key" branch ran.
This is the writer.

`WantedWriter` mirrors `StatusReader` — that module reads what hives report,
this one writes what they are told, so it holds a client rather than a bucket
handle and resolves the store on first use. It shares the status reader's
connection: the controller has exactly one by design, and a second connect
would double the auth-callout traffic and give the two paths independent
reconnect state.

The value under a hive's key is the map of every agent on that hive, so a
plain `put` of a single-agent change would drop a concurrent change to a
different agent, with only one revision of history to not recover from.
Writes are read-modify-write against the entry revision, and only
`WrongLastRevision` / `AlreadyExists` count as a lost race — every other
error returns immediately rather than spinning the retry loop and then
blaming a concurrent writer that never existed.

`apply` is split out and tested because it holds the invariant: declaring
one agent preserves the rest, and a current value that will not decode is an
error rather than a fresh start. Overwriting a document nobody can read
discards every other agent's declaration.

Two routes, no swarmctl verb and no jobq node: `create_agent` needs a graph
because it is multi-step, and one CAS'd write is not.

`build_app` is extracted from `main` in the same change because `main` sat at
exactly the `too_many_lines` limit, so adding an endpoint tripped a lint
about the startup sequence. The route list is the part that grows.
2026-09-02 02:32:36 +02:00
..
auth.rs swarm-queue-client: audience-scoped tokens + a blocking mint for a non-reactor caller 2026-08-29 11:17:24 +02:00
config_pr.rs swarm-controller: fix stale route reference in snapshot's doc comment 2026-08-19 22:27:12 +02:00
forge.rs issue-report: add transitively-blocks count alongside direct depended-on-by count 2026-08-31 21:51:42 +02:00
issue_report.rs swarm-controller: fix broken intra-doc link in issue_report.rs 2026-08-31 18:50:38 +02:00
main.rs feat(#3124): publish the agent set the swarm declares for each hive 2026-09-02 02:32:36 +02:00
otel_http_client.rs move otel_http_client from swarm-queue-client into swarm-controller 2026-08-29 11:17:24 +02:00
status.rs feat(#3255): announce a knowledge change to every hive on the queue 2026-08-19 21:05:52 +02:00
vcs_metrics.rs docs: restructure into topic subdirectories, collapse duplicated index 2026-09-02 01:55:37 +02:00
wanted.rs feat(#3124): publish the agent set the swarm declares for each hive 2026-09-02 02:32:36 +02:00
webhook.rs swarm-controller: emit vcs commit/push otel counters from an instance-wide forge webhook 2026-08-24 20:54:49 +02:00