Watch
0
0
Fork
You've already forked hyperhive
0
hyperhive/hive-c0re/src
Repository files (latest commit first)
Filename Latest commit message Latest commit date
atlas 37f3c63eeb feat(#3124): converge the hive onto the agent set the swarm declares
The deploy event is a nudge with no second path: core NATS is
at-most-once, so a hive that was down when the controller published
simply never learns that an agent is meant to exist here. This adds the
repair path — one boot-time DAG node that reads this hive's own key in
the `hive-wanted` bucket and converges the agents it names.

Two semantics settled on the issue thread, and both are places where a
plausible implementation is the wrong one:

- **Absence is not a deletion order.** No bucket, no key, or an agent
  the value does not name all mean the controller has said nothing.
  Swarm-side lifecycle does not yet cover agents that predate it, so
  "converge to exactly this set" would tear down every agent the swarm
  has not adopted. `plan` only ever inspects the agents a declaration
  names.
- **An unrecognised state is inert.** `AgentState` is an open enum: a
  value this build cannot read deserialises into `Unrecognised` and is
  left alone. A closed enum would force "not `Up`" onto a state like
  `paused`, so a controller that learned a new value would take agents
  down on every hive not yet updated.

Divergence is measured against the hive's **stored power intent**, not
the container's observed running state — an agent that is down while its
intent says `Up` is already the boot reconcile's work, and a loop reading
`is_running` would insert a start DAG behind that reconcile's back on
every boot. A hive that already agrees with its declaration queues
nothing at all.

`queue_first_deploy` is extracted from the deploy-event path rather than
open-coded here, for the power-intent seed: without it `first_deploy`'s
tail `Reconcile` seeds `Wanted` from a container that exists but has not
started yet, which locks the agent to `Offline` on its first reconcile.

The read is authorised as-is: `store.get` takes async-nats' direct-get
arm (the KV bucket is created with `allow_direct`), which is exactly the
`$JS.API.DIRECT.GET.KV_hive-wanted.$KV.hive-wanted.<hive>` subject
`swarm-nats-auth` grants a hive. The fallback subject is not granted, and
a refused NATS request surfaces as a timeout rather than an error.

Nothing writes the bucket yet — the controller-side writer is the other
half of #3124, so this does not close it.
2026-09-01 13:07:54 +02:00
..
agent_config hive-c0re: drop stale 'question' example from check_size doc 2026-08-30 03:42:57 +02:00
dashboard remove the 1NFR4 dashboard panel and the now-writer-less audit log 2026-08-31 00:18:21 +02:00
forge hive-c0re: seed an agent's proposed config from the forge when it exists 2026-08-31 00:17:41 +02:00
job_queue feat(#3124): converge the hive onto the agent set the swarm declares 2026-09-01 13:07:54 +02:00
lifecycle remove the 1NFR4 dashboard panel and the now-writer-less audit log 2026-08-31 00:18:21 +02:00
socket_server remove hive-level infra-container restart from web ui and agents 2026-08-31 00:18:21 +02:00
stats Fix nix references in prose that no longer resolve 2026-08-30 14:30:27 +02:00
stores remove the 1NFR4 dashboard panel and the now-writer-less audit log 2026-08-31 00:18:21 +02:00
workers feat(#3124): converge the hive onto the agent set the swarm declares 2026-09-01 13:07:54 +02:00
actions.rs refactor(#2916): destroy submits a DAG instead of an imperative teardown 2026-08-14 00:24:45 +02:00
container_view.rs Fix nix references in prose that no longer resolve 2026-08-30 14:30:27 +02:00
coordinator.rs remove the 1NFR4 dashboard panel and the now-writer-less audit log 2026-08-31 00:18:21 +02:00
dashboard_events.rs remove the 1NFR4 dashboard panel and the now-writer-less audit log 2026-08-31 00:18:21 +02:00
gateway_nginx.rs Fix nix references in prose that no longer resolve 2026-08-30 14:30:27 +02:00
loose_ends.rs docs/hive-c0re: fix ask/answer removal doc gaps argus caught on #3741 2026-08-30 03:02:31 +02:00
main.rs remove the 1NFR4 dashboard panel and the now-writer-less audit log 2026-08-31 00:18:21 +02:00
matrix.rs deploy: move the matrix homeserver toggle out of swarm 2026-08-30 15:17:02 +02:00
meta.rs deploy: move the hive CA's knobs to deploy.hive-controller.tls 2026-08-30 20:52:00 +02:00
migrate.rs refactor(#2916): drop the two obsolete startup migrations 2026-08-02 01:41:37 +02:00
paths.rs Fix nix references in prose that no longer resolve 2026-08-30 14:30:27 +02:00
priv_client.rs remove hive-level infra-container restart from web ui and agents 2026-08-31 00:18:21 +02:00
server.rs deploy: move the matrix homeserver toggle out of swarm 2026-08-30 15:17:02 +02:00
snapshot_push.rs refactor(#2862): one snapshot store per swarm, not one per peer 2026-07-31 22:15:37 +02:00
swarm_notices.rs swarm-queue-based lifecycle notices, replacing push_todo(MANAGER_AGENT) 2026-08-24 14:34:37 +02:00
swarm_queue.rs swarm-queue-based lifecycle notices, replacing push_todo(MANAGER_AGENT) 2026-08-24 14:34:37 +02:00
swarm_status.rs feat(#3124): converge the hive onto the agent set the swarm declares 2026-09-01 13:07:54 +02:00
test_env.rs test(hive-c0re): one crate-wide lock for env-mutating tests 2026-08-19 01:38:54 +02:00
webhook_secret.rs chore(#2510): bump indicatif/tower-http/hmac/sha2 to latest majors 2026-07-16 10:42:30 +02:00