Liking cljdoc? Tell your friends :D

hive-datascript.swarm.coordination.cleanup

Stale-detection sweeps for coordinators and claims.

Pure side-effect cleanup ops. Owns the staleness policy via CoordinationConfig (env-overridable thresholds). Sibling to coordination.coordinator (which owns coordinator CRUD); kept separate per SRP: these have a different reason to change (threshold tuning, sweep cadence) than the CRUD ops.

Stale-detection sweeps for coordinators and claims.

Pure side-effect cleanup ops. Owns the staleness policy via CoordinationConfig
(env-overridable thresholds). Sibling to coordination.coordinator (which owns
coordinator CRUD); kept separate per SRP: these have a different reason to
change (threshold tuning, sweep cadence) than the CRUD ops.
raw docstring

hive-datascript.swarm.coordination.config

Typed config for hive-mcp.swarm.datascript.coordination.* via hive-di defconfig.

Replaces:

  • (def ^:private stale-threshold-ms (* 2 60 1000)) (private constant) in hive-mcp.swarm.datascript.coordination, with an env-overridable :coordinator-stale-ms field.
  • Inline (* 5 60 1000) default in cleanup-stale-claims!, with an env-overridable :claim-stale-ms field.

Resolution order (per field): default <- env <- caller overrides.

Tests can override the resolver via with-redefs:

(with-redefs [hive-mcp.swarm.datascript.coordination.config/coordination-config (fn [] {:coordinator-stale-ms 1000 :claim-stale-ms 5000})] ...)

Generated by defconfig: CoordinationConfig — ADT CoordinationConfig-fields — field registry CoordinationConfig-schema — Malli schema resolve-CoordinationConfig — resolver fn (returns Result)

Moved from hive-mcp.swarm.datascript.coordination.config (hive-mcp).

Typed config for hive-mcp.swarm.datascript.coordination.* via hive-di defconfig.

Replaces:
  - `(def ^:private stale-threshold-ms (* 2 60 1000))` (private constant)
    in hive-mcp.swarm.datascript.coordination, with an env-overridable
    :coordinator-stale-ms field.
  - Inline `(* 5 60 1000)` default in `cleanup-stale-claims!`, with an
    env-overridable :claim-stale-ms field.

Resolution order (per field): default <- env <- caller overrides.

Tests can override the resolver via with-redefs:

  (with-redefs [hive-mcp.swarm.datascript.coordination.config/coordination-config
                (fn [] {:coordinator-stale-ms 1000 :claim-stale-ms 5000})]
    ...)

Generated by defconfig:
  CoordinationConfig         — ADT
  CoordinationConfig-fields  — field registry
  CoordinationConfig-schema  — Malli schema
  resolve-CoordinationConfig — resolver fn (returns Result)

Moved from hive-mcp.swarm.datascript.coordination.config (hive-mcp).
raw docstring

hive-datascript.swarm.coordination.session-registry

Session-scoped registry of what a run produced, for wrap to harvest.

SCOPING: every row carries the session that wrote it. A reader passes a :session-ref (plus :parent-of) and gets back only the rows that session owns. Ownership is the host's rule, applied through the :scope-rows hook (hive-datascript.swarm.hooks). Reads WITHOUT a :session-ref keep the unscoped behaviour, but clearing is never unscoped by accident: clear-* takes the explicit ids the caller actually harvested.

Session-scoped registry of what a run produced, for wrap to harvest.

SCOPING: every row carries the session that wrote it. A reader passes a
`:session-ref` (plus `:parent-of`) and gets back only the rows that session
owns. Ownership is the host's rule, applied through the :scope-rows hook
(hive-datascript.swarm.hooks). Reads WITHOUT a :session-ref keep the
unscoped behaviour, but clearing is never unscoped by accident: clear-*
takes the explicit ids the caller actually harvested.
raw docstring

cljdoc builds & hosts documentation for Clojure/Script libraries

Keyboard shortcuts
Ctrl+kJump to recent docs
Move to previous article
Move to next article
Ctrl+/Jump to the search field
× close