Skip to main content

Module broker

Module broker 

Source
Expand description

HTTP broker for agent coordination.

Provides an HTTP server that agents use to publish messages, poll for incoming messages, and report status. The broker runs on a background tokio runtime and is managed through BrokerHandle.

§Lock discipline

BrokerState wraps its inner state in an RwLock. Guards MUST NOT be held across .await boundaries. The clippy::await_holding_lock lint is enabled project-wide to catch violations at compile time. Use the read() / write() methods to obtain guards inside synchronous closures only.

Re-exports§

pub use messages::BrokerMessage;

Modules§

conflict
Broker-internal conflict detector.
delivery
Message routing, cursor-based polling, and log flush.
learnings
Broker-internal learnings aggregator.
messages
Broker message types, validation, and branch slug conversion.
publish
Helpers for constructing and publishing BrokerMessage values to a running broker over HTTP.
server
Axum HTTP server for the broker.
watcher
Git-status polling watcher.

Structs§

AgentRecord
Record of a known agent’s latest state.
AgentStatusEntry
JSON-serializable snapshot of an agent’s status for the /status endpoint and the dashboard TUI.
BrokerHandle
Handle to a running broker, including the optional flush thread.
BrokerState
Shared broker state.
BrokerStateInner
Mutable broker state protected by an RwLock.
WatchTarget
Worktree to watch for git-status changes.

Enums§

BrokerError
Errors specific to broker operations.
ProbeResult
Result of probing an existing listener on the broker port.

Functions§

probe_broker
Probes an existing listener at the given URL to determine what is running.
start_broker
Starts the HTTP broker server.
start_broker_with
Starts the HTTP broker server with optional conflict-detector wiring and a configurable learnings-flush interval.