Repository navigation
feat(daemon): self-update mechanism (the trigger; wire-in coordinated) - #1268
Merged
Merged
Conversation
…ally "No one remembers to run airc update" — we lived it (stale binaries, a lockfile drift, a gate break). So automate it. The dangerous part already exists: `airc update --auto` rebuilds, smoke-tests, and ROLLS BACK a bad build (can't brick the node) + no-ops when current. This adds the TRIGGER. `daemon::auto_update`: a periodic loop that, when enabled + idle, spawns a DETACHED `airc update --auto` (own process group, so it survives the daemon stopping itself mid-update). Default-ON (the point), opt-out via AIRC_NO_AUTOUPDATE; long interval (AIRC_AUTOUPDATE_INTERVAL_SECS, 1h default, 300s floor). Pure policy (enabled/interval/should_fire) unit-tested; gate-clean (no expect/unwrap, verified against -D clippy::expect_used). ADDITIVE + NOT YET WIRED into server.rs: the loop takes an `is_idle` predicate, and the right signal is ACTIVE MESH STREAMS (not IPC-client idle) — wiring that + spawning the task belongs on top of reliable restart/reconnect (BigMama's transport-reliability lane). So the mechanism lands now; activation is the coordinated one-liner once restart is reliable. Zero effect until then. Co-Authored-By: Claude Opus 4.8 <[email protected]>
This was referenced Jun 20, 2026
joelteply
added a commit
that referenced
this pull request
Jun 20, 2026
…1268) (#1269) #1268 landed the self-update MECHANISM (rollback-safe detached `airc update --auto` on a long interval) but deliberately left it unspawned, pending the mesh-idle predicate + the startup wire-in — the reliability lane. This wires it: spawn `auto_update::run` alongside the route-refresh + registry loops, exiting on the shared shutdown notifier. The idle predicate is MESH-state, not IPC-idle (per the #1268 handoff): idle = zero live LAN peer connections (`connected_lan_peers == 0`). With no live connection there is definitionally no in-flight mesh work an update could drop, and control-plane reconnect after a restart is cheap + self-healing. The updater only restarts when canary actually moved (no-op otherwise), so steady state is a cheap periodic fetch, never connection churn. Opt out with AIRC_NO_AUTOUPDATE=1. Refinement TODO (documented at the call site): once stream-plane sessions are tracked in daemon connection-state, gate on "no active TRANSFER" so a connected-but-quiet node can still self-update. Net: nodes self-heal their VERSION with no human in the loop — closes the version-drift class (stale binaries / protocol skew) we just lived through proving cross-machine LAN. Co-authored-by: Claude Opus 4.8 <[email protected]>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why
"No one remembers to run
airc update" — and falling behind silently breaks coordination (we lived it this session: stale binaries + a lockfile drift + a gate break). Automate it.What
The safe updater already exists (
airc update --auto: rebuild → smoke-test → roll back a bad build, no-op when current). This addsdaemon::auto_update— the trigger: a periodic loop that, when enabled + idle, spawns a detachedairc update --auto(own process group, survives the daemon stopping itself mid-update).AIRC_NO_AUTOUPDATE.AIRC_AUTOUPDATE_INTERVAL_SECS, 1h default, 300s floor).enabled/interval/should_fire) unit-tested; gate-clean (verified against-D clippy::expect_used -D clippy::unwrap_used).Additive — NOT yet wired into
server.rsThe loop takes an
is_idlepredicate, and the correct signal is active mesh streams (not IPC-client idle). Wiring that + spawning the task sits on top of reliable restart/reconnect (@bigmama's transport-reliability lane) — auto-restart on a flaky restart = churn, the opposite of the goal. So the mechanism lands now; activation is a coordinated one-liner once restart is reliable. Zero effect until wired.🤖 Generated with Claude Code