Closed-sum domain types for swarm slave lifecycle.
Three ADTs:
SRP: Pure domain types, no I/O. Schema lives in hive-mcp.swarm.{datascript,datalevin}.schema; this ns provides typed construction + exhaustive dispatch.
Closed-sum domain types for swarm slave lifecycle.
Three ADTs:
- SlaveStatus — slave lifecycle states (mirrors datascript slave-statuses
enum but as a closed ADT, with :zombie added for
stale-sweep-marked rows).
- LivenessSignal — outcome of OS-level process liveness check.
- LifecycleEvent — transition events emitted by the registry on state
changes; ground truth for audit + the stale-sweep.
SRP: Pure domain types, no I/O. Schema lives in
hive-mcp.swarm.{datascript,datalevin}.schema; this ns provides typed
construction + exhaustive dispatch.(->lifecycle-event kw__1777__auto__)Coerce a keyword to a LifecycleEvent variant (no data fields). Returns nil if keyword is not a valid variant.
Coerce a keyword to a LifecycleEvent variant (no data fields). Returns nil if keyword is not a valid variant.
(->liveness-signal kw__1777__auto__)Coerce a keyword to a LivenessSignal variant (no data fields). Returns nil if keyword is not a valid variant.
Coerce a keyword to a LivenessSignal variant (no data fields). Returns nil if keyword is not a valid variant.
(->slave-status kw__1777__auto__)Coerce a keyword to a SlaveStatus variant (no data fields). Returns nil if keyword is not a valid variant.
Coerce a keyword to a SlaveStatus variant (no data fields). Returns nil if keyword is not a valid variant.
(lifecycle-event variant-kw__1774__auto__)(lifecycle-event variant-kw__1774__auto__ data__1775__auto__)Construct a LifecycleEvent variant. (lifecycle-event variant-keyword) for enum variants (lifecycle-event variant-keyword data-map) for data variants
Throws ex-info for unknown variants.
Construct a LifecycleEvent variant. (lifecycle-event variant-keyword) for enum variants (lifecycle-event variant-keyword data-map) for data variants Throws ex-info for unknown variants.
(lifecycle-event? x__1776__auto__)True if x is a LifecycleEvent ADT value.
True if x is a LifecycleEvent ADT value.
Slave lifecycle transition events. One emitted per state change to the :swarm/lifecycle channel; receivers persist them as audit log and bump the corresponding :slave/{spawned-at,last-active-at, status-changed-at,alive?} attrs.
:at is epoch milliseconds. Always set by the emitting site, never inferred — keeps audit lines reproducible across replays.
Slave lifecycle transition events. One emitted per state change to
the :swarm/lifecycle channel; receivers persist them as audit log
and bump the corresponding :slave/{spawned-at,last-active-at,
status-changed-at,alive?} attrs.
:at is epoch milliseconds. Always set by the emitting site, never
inferred — keeps audit lines reproducible across replays.(liveness-signal variant-kw__1774__auto__)(liveness-signal variant-kw__1774__auto__ data__1775__auto__)Construct a LivenessSignal variant. (liveness-signal variant-keyword) for enum variants (liveness-signal variant-keyword data-map) for data variants
Throws ex-info for unknown variants.
Construct a LivenessSignal variant. (liveness-signal variant-keyword) for enum variants (liveness-signal variant-keyword data-map) for data variants Throws ex-info for unknown variants.
(liveness-signal? x__1776__auto__)True if x is a LivenessSignal ADT value.
True if x is a LivenessSignal ADT value.
OS-level liveness check outcome.
:liveness/alive — process responsive (kill -0 <pid> ok) :liveness/dead — process gone (kill -0 returned ESRCH) :liveness/unknown — pid is nil (e.g. openrouter ling) or check failed transiently (do NOT mark :zombie on unknown).
OS-level liveness check outcome.
:liveness/alive — process responsive (kill -0 <pid> ok)
:liveness/dead — process gone (kill -0 returned ESRCH)
:liveness/unknown — pid is nil (e.g. openrouter ling) or check failed
transiently (do NOT mark :zombie on unknown).(slave-status variant-kw__1774__auto__)(slave-status variant-kw__1774__auto__ data__1775__auto__)Construct a SlaveStatus variant. (slave-status variant-keyword) for enum variants (slave-status variant-keyword data-map) for data variants
Throws ex-info for unknown variants.
Construct a SlaveStatus variant. (slave-status variant-keyword) for enum variants (slave-status variant-keyword data-map) for data variants Throws ex-info for unknown variants.
(slave-status? x__1776__auto__)True if x is a SlaveStatus ADT value.
True if x is a SlaveStatus ADT value.
All valid slave statuses. Closed sum.
:slave-status/zombie marks rows where the OS process is gone (kill -0 failed) AND last-active-at is older than the stale threshold. agent_status default-filters these out unless :include-stale? is set.
All valid slave statuses. Closed sum. :slave-status/zombie marks rows where the OS process is gone (kill -0 failed) AND last-active-at is older than the stale threshold. agent_status default-filters these out unless :include-stale? is set.
cljdoc builds & hosts documentation for Clojure/Script libraries
| Ctrl+k | Jump to recent docs |
| ← | Move to previous article |
| → | Move to next article |
| Ctrl+/ | Jump to the search field |