auto-update agents on startup when hyperhive rev changes

This commit is contained in:
müde 2026-05-15 13:25:27 +02:00
parent 1cbfacda20
commit a4e1556f90
3 changed files with 141 additions and 0 deletions

View file

@ -156,6 +156,19 @@ docs/damocles-migration.md options for moving damocles onto hyperhive
marks them `failed` with note `"agent state dir missing"` so they fall out
of `pending`. They stay in sqlite for audit.
## Auto-update on startup
`hive-c0re serve` runs `auto_update::run` in a background task right after
opening the coordinator. It enumerates sub-agent containers (manager
excluded — its config comes from the host's NixOS module) and rebuilds any
whose recorded hyperhive rev differs from the current one. Rev = canonical
filesystem path of `cfg.hyperhiveFlake` (so `/etc/hyperhive` resolving to a
new `/nix/store/...-source` triggers a rebuild). Marker file:
`/var/lib/hyperhive/applied/.<name>.hyperhive-rev`. If the flake input has
no canonical path (e.g. a `github:` URL), auto-update is a no-op — rebuild
manually. The task is async and never blocks the admin socket; failures are
logged and don't take the daemon down.
## Build / deploy / test
```sh