Liking cljdoc? Tell your friends :D

hive-system.protocols

Core protocols for hive-system.

Layer 1: IJournal — temporal execution fabric (Datahike/Proximum) Layer 2: System operation protocols (IProcess, INetwork, IFilesystem, etc.)

Every system operation returns Result (ok/err) from hive-dsl. Every Result is journaled with bitemporal semantics.

SOLID-D: All consumers depend on these protocols, never concrete implementations. SOLID-O: New operation types = new protocol implementations, zero changes to journal.

Core protocols for hive-system.

Layer 1: IJournal — temporal execution fabric (Datahike/Proximum)
Layer 2: System operation protocols (IProcess, INetwork, IFilesystem, etc.)

Every system operation returns Result (ok/err) from hive-dsl.
Every Result is journaled with bitemporal semantics.

SOLID-D: All consumers depend on these protocols, never concrete implementations.
SOLID-O: New operation types = new protocol implementations, zero changes to journal.
raw docstring

ICryptoclj/sprotocol

Cryptographic operations.

Each method takes a single map (Parameter Object pattern) keyed under the :crypto/* namespace. Returns hive-dsl Result.

Common keys: :crypto/algorithm keyword — :xchacha20-poly1305, :hpke-x25519, :sha256, :hkdf-sha256, :argon2id, ... :crypto/key ^bytes — symmetric key (32B AEAD) or signing key :crypto/pubkey ^bytes — recipient public key (HPKE seal) :crypto/keypair {:public :private} — HPKE open :crypto/plaintext ^bytes :crypto/ciphertext ^bytes :crypto/iv ^bytes — nonce / IV (24B XChaCha20) :crypto/aad ^bytes — additional authenticated data / contextInfo :crypto/data ^bytes — hash / sign / verify input :crypto/signature ^bytes — verify input :crypto/ikm ^bytes — input keying material (KDF) :crypto/salt ^bytes-or-nil — KDF salt / pwhash salt (16B for Argon2id) :crypto/info ^bytes-or-nil — HKDF context/info string (RFC 5869) :crypto/length pos-int — desired output bytes (KDF / pwhash) :crypto/password ^bytes — password to hash (pwhash) :crypto/ops-limit pos-int — pwhash CPU cost (libsodium t_cost) :crypto/mem-limit pos-int — pwhash memory cost in bytes (libsodium memlimit)

Result shapes (also :crypto/* namespaced): encrypt → {:ok {:crypto/ciphertext ... :crypto/iv ...}} decrypt → {:ok {:crypto/plaintext ...}} hash → {:ok {:crypto/hash ... :crypto/algorithm ...}} sign → {:ok {:crypto/signature ...}} verify → {:ok {:crypto/valid? boolean}} derive-key → {:ok {:crypto/key ^bytes :crypto/algorithm ...}} password-hash → {:ok {:crypto/hash ^bytes :crypto/algorithm ...}}

Cryptographic operations.

Each method takes a single map (Parameter Object pattern) keyed under
the `:crypto/*` namespace. Returns hive-dsl Result.

Common keys:
  :crypto/algorithm   keyword       — :xchacha20-poly1305, :hpke-x25519, :sha256,
                                      :hkdf-sha256, :argon2id, ...
  :crypto/key         ^bytes        — symmetric key (32B AEAD) or signing key
  :crypto/pubkey      ^bytes        — recipient public key (HPKE seal)
  :crypto/keypair     {:public :private} — HPKE open
  :crypto/plaintext   ^bytes
  :crypto/ciphertext  ^bytes
  :crypto/iv          ^bytes        — nonce / IV (24B XChaCha20)
  :crypto/aad         ^bytes        — additional authenticated data / contextInfo
  :crypto/data        ^bytes        — hash / sign / verify input
  :crypto/signature   ^bytes        — verify input
  :crypto/ikm         ^bytes        — input keying material (KDF)
  :crypto/salt        ^bytes-or-nil — KDF salt / pwhash salt (16B for Argon2id)
  :crypto/info        ^bytes-or-nil — HKDF context/info string (RFC 5869)
  :crypto/length      pos-int       — desired output bytes (KDF / pwhash)
  :crypto/password    ^bytes        — password to hash (pwhash)
  :crypto/ops-limit   pos-int       — pwhash CPU cost (libsodium t_cost)
  :crypto/mem-limit   pos-int       — pwhash memory cost in bytes (libsodium memlimit)

Result shapes (also `:crypto/*` namespaced):
  encrypt      → {:ok {:crypto/ciphertext ... :crypto/iv ...}}
  decrypt      → {:ok {:crypto/plaintext ...}}
  hash         → {:ok {:crypto/hash ... :crypto/algorithm ...}}
  sign         → {:ok {:crypto/signature ...}}
  verify       → {:ok {:crypto/valid? boolean}}
  derive-key   → {:ok {:crypto/key ^bytes :crypto/algorithm ...}}
  password-hash → {:ok {:crypto/hash ^bytes :crypto/algorithm ...}}

crypto-decrypt!clj/s

(crypto-decrypt! this op-map)

Decrypt :crypto/ciphertext under :crypto/key (or :crypto/keypair for HPKE).

Decrypt :crypto/ciphertext under :crypto/key (or :crypto/keypair for HPKE).

crypto-derive-keyclj/s

(crypto-derive-key this op-map)

Derive a key from :crypto/ikm with :crypto/algorithm (e.g. :hkdf-sha256). Inputs: :crypto/ikm :crypto/salt :crypto/info :crypto/length. Returns Result<{:crypto/key ^bytes :crypto/algorithm ...}>.

Derive a key from :crypto/ikm with :crypto/algorithm (e.g. :hkdf-sha256).
Inputs: :crypto/ikm :crypto/salt :crypto/info :crypto/length.
Returns Result<{:crypto/key ^bytes :crypto/algorithm ...}>.

crypto-encrypt!clj/s

(crypto-encrypt! this op-map)

Encrypt :crypto/plaintext under :crypto/key (or :crypto/pubkey for HPKE).

Encrypt :crypto/plaintext under :crypto/key (or :crypto/pubkey for HPKE).

crypto-hashclj/s

(crypto-hash this op-map)

Hash :crypto/data with :crypto/algorithm.

Hash :crypto/data with :crypto/algorithm.

crypto-password-hashclj/s

(crypto-password-hash this op-map)

Password-hash :crypto/password with :crypto/algorithm (e.g. :argon2id). Inputs: :crypto/password :crypto/salt :crypto/ops-limit :crypto/mem-limit :crypto/length. Returns Result<{:crypto/hash ^bytes :crypto/algorithm ...}>.

Password-hash :crypto/password with :crypto/algorithm (e.g. :argon2id).
Inputs: :crypto/password :crypto/salt :crypto/ops-limit :crypto/mem-limit
:crypto/length. Returns Result<{:crypto/hash ^bytes :crypto/algorithm ...}>.

crypto-sign!clj/s

(crypto-sign! this op-map)

Sign :crypto/data with :crypto/key.

Sign :crypto/data with :crypto/key.

crypto-verifyclj/s

(crypto-verify this op-map)

Verify :crypto/signature against :crypto/data with :crypto/key.

Verify :crypto/signature against :crypto/data with :crypto/key.
sourceraw docstring

IFilesystemclj/sprotocol

Advanced filesystem operations beyond basic read/write.

Advanced filesystem operations beyond basic read/write.

fs-atomic-write!clj/s

(fs-atomic-write! this path content opts)

Atomic write (write-to-tmp + rename). Returns Result.

Atomic write (write-to-tmp + rename). Returns Result.

fs-lock!clj/s

(fs-lock! this path timeout-ms)

Advisory file lock. Returns Result with {:lock}.

Advisory file lock. Returns Result with {:lock}.

fs-tmpdir!clj/s

(fs-tmpdir! this prefix)

Create temporary directory. Returns Result with {:path}.

Create temporary directory. Returns Result with {:path}.

fs-watch!clj/s

(fs-watch! this path patterns handler)

Watch path for changes. Returns Result with {:watcher}.

Watch path for changes. Returns Result with {:watcher}.
sourceraw docstring

IHostExecutableLookupclj/sprotocol

Resolve executable availability on a host.

Primitive host capability contract. Batch discovery and package-manager interpretation compose above this protocol.

Resolve executable availability on a host.

Primitive host capability contract. Batch discovery and package-manager
interpretation compose above this protocol.

host-executableclj/s

(host-executable this program opts)

Return Result<{:program :present? :path?}> for one executable.

Return Result<{:program :present? :path?}> for one executable.
sourceraw docstring

IHostOSReleaseclj/sprotocol

Read host operating-system release identity.

Primitive host capability contract. Endpoint-specific execution and policy live in higher-level general projects that implement this protocol.

Read host operating-system release identity.

Primitive host capability contract. Endpoint-specific execution and policy
live in higher-level general projects that implement this protocol.

host-os-releaseclj/s

(host-os-release this opts)

Return Result<{:id :version-id :pretty-name :raw}> from /etc/os-release or equivalent.

Return Result<{:id :version-id :pretty-name :raw}> from /etc/os-release or equivalent.
sourceraw docstring

IJournalclj/sprotocol

Bitemporal execution journal backed by Datahike/Proximum. All system operations are journaled here for time-travel queries.

Bitemporal execution journal backed by Datahike/Proximum.
All system operations are journaled here for time-travel queries.

journal-idclj/s

(journal-id this)

Return keyword identifying this journal backend.

Return keyword identifying this journal backend.

query-atclj/s

(query-at this datalog-query as-of-tx)

Query journal state as of a specific transaction time.

Query journal state as of a specific transaction time.

query-betweenclj/s

(query-between this datalog-query from-tx to-tx)

Query journal entries between two transaction times.

Query journal entries between two transaction times.

record!clj/s

(record! this op-type input output duration-ms ctx)

Record an operation execution. Returns entry-id.

Record an operation execution. Returns entry-id.

time-travelclj/s

(time-travel this entity-id as-of-tx)

Get entity state at a specific point in time.

Get entity state at a specific point in time.
sourceraw docstring

INetworkclj/sprotocol

Network operations. All operations return Result.

Network operations. All operations return Result.

net-connect!clj/s

(net-connect! this host port opts)

Open a connection. Returns Result with {:socket :channel}.

Open a connection. Returns Result with {:socket :channel}.

net-listen!clj/s

(net-listen! this port opts)

Listen on port. Returns Result with {:server-socket}.

Listen on port. Returns Result with {:server-socket}.

net-recv!clj/s

(net-recv! this channel buf-size timeout-ms)

Receive data. Returns Result with {:data :bytes-read}.

Receive data. Returns Result with {:data :bytes-read}.

net-send!clj/s

(net-send! this channel data)

Send data on channel. Returns Result with {:bytes-sent}.

Send data on channel. Returns Result with {:bytes-sent}.
sourceraw docstring

IPathQueryclj/sprotocol

Path predicates and resolution. Pure queries — no mutation. SRP: separated from IFilesystem (which handles watch/write/lock). All return Result for railway composition via ok->/let-ok.

Path predicates and resolution. Pure queries — no mutation.
SRP: separated from IFilesystem (which handles watch/write/lock).
All return Result for railway composition via ok->/let-ok.

path-absolute?clj/s

(path-absolute? this path)

Check if path is absolute. Returns Result<boolean> (pure, no IO).

Check if path is absolute. Returns Result<boolean> (pure, no IO).

path-childrenclj/s

(path-children this dir opts)

List immediate children. opts: {:filter :dirs|:files|:all, :skip #{names}}. Returns Result<vec<string>>.

List immediate children. opts: {:filter :dirs|:files|:all, :skip #{names}}.
Returns Result<vec<string>>.

path-directory?clj/s

(path-directory? this path)

Check if path is directory. Returns Result<boolean>.

Check if path is directory. Returns Result<boolean>.

path-exists?clj/s

(path-exists? this path)

Check path existence. Returns Result<boolean>.

Check path existence. Returns Result<boolean>.

path-file?clj/s

(path-file? this path)

Check if path is regular file. Returns Result<boolean>.

Check if path is regular file. Returns Result<boolean>.

path-resolveclj/s

(path-resolve this base segments)

Join + normalize path segments. Returns Result<string>.

Join + normalize path segments. Returns Result<string>.
sourceraw docstring

IProcessclj/sprotocol

Process lifecycle management. All operations return Result.

Process lifecycle management. All operations return Result.

process-pipe!clj/s

(process-pipe! this from-process to-process)

Pipe stdout of one process to stdin of another. Returns Result.

Pipe stdout of one process to stdin of another. Returns Result.

process-signal!clj/s

(process-signal! this process signal)

Send signal to process. Returns Result.

Send signal to process. Returns Result.

process-spawn!clj/s

(process-spawn! this cmd opts)

Spawn a process. Returns Result with {:pid :process :stdout :stderr}.

Spawn a process. Returns Result with {:pid :process :stdout :stderr}.

process-wait!clj/s

(process-wait! this process timeout-ms)

Wait for process completion. Returns Result with {:exit-code :stdout :stderr}.

Wait for process completion. Returns Result with {:exit-code :stdout :stderr}.
sourceraw docstring

IShellclj/sprotocol

Shell execution with capture.

Shell execution with capture.

shell-envclj/s

(shell-env this)

Get current environment map.

Get current environment map.

shell-exec!clj/s

(shell-exec! this cmd opts)

Execute shell command. Returns Result with {:exit :stdout :stderr :duration-ms}.

Execute shell command. Returns Result with {:exit :stdout :stderr :duration-ms}.

shell-whichclj/s

(shell-which this program)

Resolve program path. Returns Result with {:path} or err.

Resolve program path. Returns Result with {:path} or err.
sourceraw docstring

IWorkerclj/sprotocol

Warm request/response worker over a long-lived process (IProcess). All operations return Result.

Warm request/response worker over a long-lived process (IProcess).
All operations return Result.

worker-call!clj/s

(worker-call! this request timeout-ms)

Send a framed request, read one framed response. Returns Result.

Send a framed request, read one framed response. Returns Result.

worker-healthclj/s

(worker-health this)

Worker process liveness. Returns Result.

Worker process liveness. Returns Result.

worker-stop!clj/s

(worker-stop! this)

Stop the worker and release its process. Returns Result.

Stop the worker and release its process. Returns Result.
sourceraw 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