Liking cljdoc? Tell your friends :D

hive-datascript.swarm.connection

DataScript connection management for swarm state.

Provides:

  • Global connection atom (thread-safe via DataScript internals)
  • Connection lifecycle (create, get, reset)
  • Shared helper functions (now, gen-id)
DataScript connection management for swarm state.

Provides:
- Global connection atom (thread-safe via DataScript internals)
- Connection lifecycle (create, get, reset)
- Shared helper functions (now, gen-id)
raw docstring

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

hive-datascript.swarm.hooks

Host-installed hooks the swarm store calls on write paths.

The store never names the orchestration layer. The host installs:

  • :ledger-append (fn [event]) durable write-through for terminal events
  • :claim-released (fn [file-path]) mirror a released claim elsewhere (e.g. the core.logic claim db)
  • :stale-threshold-ms activity window for hiding stale ling rows Absent hooks are no-ops; an absent threshold falls back to 30 minutes.
Host-installed hooks the swarm store calls on write paths.

The store never names the orchestration layer. The host installs:
- :ledger-append   (fn [event]) durable write-through for terminal events
- :claim-released  (fn [file-path]) mirror a released claim elsewhere
  (e.g. the core.logic claim db)
- :stale-threshold-ms  activity window for hiding stale ling rows
Absent hooks are no-ops; an absent threshold falls back to 30 minutes.
raw docstring

hive-datascript.swarm.lings

Entity lifecycle operations for lings (slaves, tasks, claims).

CRUD operations for:

  • Slave entities (add, update, remove)
  • Task entities (add, complete, fail)
  • Claim entities (claim, release, batch release)
  • Critical operations guard (kill protection)
  • Claim TTL (stale detection, auto-expiration)

DDD: Repository pattern for swarm entities.

Entity lifecycle operations for lings (slaves, tasks, claims).

CRUD operations for:
- Slave entities (add, update, remove)
- Task entities (add, complete, fail)
- Claim entities (claim, release, batch release)
- Critical operations guard (kill protection)
- Claim TTL (stale detection, auto-expiration)

DDD: Repository pattern for swarm entities.
raw docstring

hive-datascript.swarm.queries

Read-only query operations for swarm state.

Query functions for:

  • Slave queries (get, list, filter by status)
  • Task queries (get, list for slave, completed tasks)
  • Claim queries (get, list, conflict detection)
  • Statistics and debugging
Read-only query operations for swarm state.

Query functions for:
- Slave queries (get, list, filter by status)
- Task queries (get, list for slave, completed tasks)
- Claim queries (get, list, conflict detection)
- Statistics and debugging
raw docstring

hive-datascript.swarm.registry

DataScript implementation of all ISP-segregated swarm protocols (hive-spi.swarm.protocol), plus the default instances a host installs.

DataScript implementation of all ISP-segregated swarm protocols
(hive-spi.swarm.protocol), plus the default instances a host installs.
raw docstring

hive-datascript.swarm.schema

DataScript schema definitions for swarm hivemind coordination.

Contains:

  • Entity schemas (slave, task, claim, wrap-queue, etc.)
  • Status enumerations for validation
  • Schema documentation

DDD: Value Objects for status enums, schema as domain model.

DataScript schema definitions for swarm hivemind coordination.

Contains:
- Entity schemas (slave, task, claim, wrap-queue, etc.)
- Status enumerations for validation
- Schema documentation

DDD: Value Objects for status enums, schema as domain model.
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