Sleeper Architecture #

Sleepers are coord-registered agents that run autonomously between anchor pokes. The anchor dispatches work via coord send and pokes sleepers to wake them; sleepers heartbeat back to prove liveness.

Vocabulary #

Biology termCoord equivalentDescription
Sleep spindleHeartbeatPeriodic liveness signal
Poke--poke flagAnchor nudges a sleeper awake
Acklast_acked_atSleeper proves it is doing work

Heartbeat Split #

Prior to this change, a single last_heartbeat field served double duty as both “the anchor poked me” and “I am alive and working”. This made it impossible to distinguish a sleeper that was poked but never responded from one that is actively processing.

The split introduces two new fields alongside last_heartbeat:

last_heartbeat continues to be written on every heartbeat (poke or ack) for backward compatibility during the migration period. Readers (e.g. agent_watcher) prefer last_acked_at when present, falling back to last_heartbeat for old session records.

Invariants #