Skip to main content

Crate av_bridge

Crate av_bridge 

Source
Expand description

The Portable Event Bridge (brief Module F).

A common bus for agent events that customers own, localize, and run air-gapped. The EventBus trait is the portability boundary:

  • embedded::EmbeddedBroker — the reference implementation: a file-backed, Kafka-shaped log (topics → partitions → append-only JSONL segments with offsets), partitioned by ai_agent.instance_uid for ordered per-agent replay. Zero external dependencies: this is what makes the single-binary air-gapped deployment real.
  • nats feature — NATS JetStream connector (edge/single-node alternative).
  • kafka feature — Kafka wire protocol connector (Redpanda is the reference self-hosted target).

Provisioning is declarative: a manifest::BridgeManifest fully describes topics, partitions, retention, and schema references; provision() stands up an identical bridge from the manifest alone (success criterion R12/R30).

Re-exports§

pub use bus::BusError;
pub use bus::EventBus;
pub use bus::PublishAck;
pub use bus::StoredEvent;
pub use embedded::EmbeddedBroker;
pub use manifest::BridgeManifest;
pub use manifest::ManifestError;
pub use manifest::RetentionSpec;
pub use manifest::TopicSpec;
pub use manifest::MANIFEST_VERSION;

Modules§

bus
The EventBus trait — the Bridge’s backend portability boundary.
embedded
The embedded file-backed broker — the Bridge reference backend.
kafka_bus
Kafka-wire connector (feature kafka), targeting Redpanda as the reference self-hosted broker (brief Module F). The event path uses rskafka; a statically linked librdkafka admin client provisions and verifies topic retention.
manifest
Declarative topic-schema manifest + provisioning (the Module F portability contract: “a customer stands up an identical bridge in a new region or air-gapped enclave from that manifest alone”).
nats_bus
NATS JetStream connector (brief Module F: “lighter-weight edge/embedded alternative”). Feature nats. One JetStream stream per topic (av_<topic> with dots mapped to underscores), one subject per partition (<topic>.p<N>), giving the same partitioned-ordered-replay contract as the embedded broker.