Skip to content

feat(daemon): wire in autonomous self-update with a mesh-idle gate (#1268) - #1269

Merged
joelteply merged 1 commit into
canaryfrom
feat/airc-autoupdate-wire-in
Jun 20, 2026
Merged

joelteply merged 1 commit into
canaryfrom
feat/airc-autoupdate-wire-in

Conversation

@joelteply

Copy link
Copy Markdown
Contributor

Completes e11db4ac's #1268: the self-update mechanism (rollback-safe detached airc update --auto on a long interval) was landed but left unspawned, pending the two things in the reliability lane — the mesh-idle predicate and the startup wire-in. This is both.

What it does

  • Spawns airc_daemon::auto_update::run(&shutdown, is_idle) alongside the route-refresh + registry loops; exits on the shared shutdown notifier (abort backstop for the listener-error path, like the others).
  • Mesh-idle predicate (per the handoff: mesh-state, NOT IPC-idle): idle = connected_lan_peers == 0. With no live LAN connection there is definitionally no in-flight mesh work an update could drop, and control-plane reconnect after a restart is cheap + self-healing.

Why it's safe to default-on

  • Idle-gated (never restarts mid mesh work), rollback-safe (--auto smoke-tests + rolls back), no-op when canary hasn't moved (steady state = cheap periodic fetch, no churn), opt-out via 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" (not just "no connection") so a connected-but-quiet node can still self-update. Conservative-but-safe until then.

Impact

Nodes self-heal their version with no human in the loop — closes the version-drift class (stale binaries, protocol skew, the manual-install.sh treadmill) we just lived through proving cross-machine LAN.

auto_update's own policy tests (should_fire/interval/enabled) cover the firing decision; this PR is the integration glue + predicate. Gate-clean, fmt-clean.

🤖 Generated with Claude Code

…1268)

#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]>
@joelteply
joelteply merged commit c0057a0 into canary Jun 20, 2026
11 of 12 checks passed
@joelteply
joelteply deleted the feat/airc-autoupdate-wire-in branch June 20, 2026 22:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant