The Connection State Tracker keeps a fast, ephemeral view of which devices are currently connected. It reacts to MQTT session open/close events and to a liveness timeout, and exposes presence to the rest of the registry.
Why it is separate from the repository
Presence changes thousands of times per second across the fleet. Keeping it in a fast in-memory store (Redis) instead of the relational Device Repository protects the durable store from write amplification.
Stale before it is declared Offline.last_seen_at is flushed back to the Device Repository on transition,
not on every heartbeat.