Kevin

Daemon HA + Peer Federation

HA election + peer auth + cross-machine state.

Daemon HA + Peer Federation (v2026-08-02T101544Z-ab2bbdebf5) 2026-08-02 | HA election + peer auth + cross-machine state. 1 - Daemon HA Election DaemonHA.elect() daemon_ha.py:421 GET /api/health primary election daemon/primary/heartbeat daemon_ha.py MQTT topic heartbeat message DaemonHA._listen_for_primary() daemon_ha.py MQTT subscription detect primary StandbyMirror daemon_ha.py:203 in-memory mirror state sync election result 2 - Daemon Federation publish_holon_sync() daemon_federation.py:164 POST /api/daemon/federation/holon holon sync kv/net/services/{machine_id}/{svc} fabric_peer.py:123 MQTT topic service announcement announce_service() fabric_peer.py:87 MQTT publish register service holon state ch… 3 - Daemon Presence _build_payload() daemon_presence.py:102 UDP broadcast payload presence data UDP port 8765 daemon_presence.py:93 UDP broadcast machine discovery ops DB (machines table) daemon_presence.py:120 database table register machine presence annou… 1. DaemonHA starts election 2. Listen for primary heartbeat 3. If no heartbeat, promote to… 4. Publish primary heartbeat l… 5. Announce presence via UDP b… 6. Register services on MQTT Heartbeat Payload { "machine": "ORION-PC", "pid": 12345, "uptime_s": 60.0, "role": "primary", "api_url": "http://orion.local:8001" } Holon Sync Payload { "holon_id": "xxx-123-abc", "action": "claimed", "role": "flynn-claude", "timestamp": "2026-05-20T12:34:56Z" } DaemonHA election and state sync are handled by DaemonHA class. Daemon Federation uses MQTT for service announcements and HTTP for state replication. Legend actor = initiates work · process = code path · store = state on disk · bus = durable queue · dashed = separate process cyan = request flow · pink = state read/write · dashed green = pull / return path · red = refusal

Provenance

This drawing is generated, not drawn. It is rebuilt from the source files below, so when they change the picture changes — a diagram here cannot quietly describe a system that no longer works this way.

Owner
Kevin
Slug
daemon-ha-federation
Rendered
2026-08-02T101544Z
From commit
ab2bbdebf5
Watches
5 paths
  • daemon/src/daemon_ha.py
  • daemon/src/daemon_federation.py
  • daemon/src/fabric_peer.py
  • daemon/src/daemon_presence.py
  • daemon/src/daemon_registry.py