Skip to main content

Crate hostbat

Crate hostbat 

Source
Expand description

Generic deterministic module host for the batpak family.

hostbat is the thin, content-identified shell that composes a syncbat::Core from one or more modules and adds the things a raw syncbat runtime has no concept of: content identity (H_module per module and a host-composition HostFingerprint), modules that bundle operations, an admission guard, lifecycle hooks, and supervised jobs as one mountable unit, a generic Supervisor over the reviewed batpak::store::Spawn seam, and a deterministic startup/shutdown hook schedule.

It does not reimplement dispatch, receipts, or admission — those stay in syncbat. hostbat lowers mounted modules into one syncbat::CoreBuilder and delegates invocation to the composed Core. Meaning lives in the modules a caller mounts (e.g. bvisor’s boundary module); the host stays generic.

§Shape

HostModule::builder(id, version)        // declare ops + guard + hooks + jobs
    .operation(descriptor, handler)?
    .build()?                           // → sealed, content-identified module

HostBuilder::new()
    .mount(module)?                     // cross-module collision + hash checks
    .build()?                           // → Host (one syncbat Core + supervisor)

The manifest is derived from exactly the registered parts — it is never authored beside the implementation, so the declaration and the behavior it attests cannot drift.

Re-exports§

pub use builder::HostBuilder;
pub use composition::CompositionSchema;
pub use composition::HostCompositionManifest;
pub use descriptor::GuardDescriptor;
pub use descriptor::HookDescriptor;
pub use descriptor::HookPhase;
pub use descriptor::JobDescriptor;
pub use error::HookFailure;
pub use error::HostError;
pub use error::HostRuntimeError;
pub use error::SchemaCollision;
pub use event_payload_binding::EventPayloadBinding;
pub use host::Host;
pub use host_control_backend::HostControlEffectBackend;
pub use host_control_backend::HostControlError;
pub use host_control_backend::HostController;
pub use identity::Digest;
pub use identity::HostFingerprint;
pub use identity::InterfaceFingerprint;
pub use identity::ModuleDigest;
pub use manifest::HostModuleManifest;
pub use module::HostModule;
pub use module::HostModuleBuilder;
pub use module::JobBody;
pub use module::LifecycleHook;
pub use schema::CanonicalEncoding;
pub use schema::DiagnosticRustType;
pub use schema::GoldenVector;
pub use schema::SchemaDescriptor;
pub use schema::SchemaId;
pub use schema::SchemaRegistry;
pub use schema::SchemaRole;
pub use schema::SchemaVersion;
pub use subscription::BackpressurePolicy;
pub use subscription::EventCategory;
pub use subscription::OperationStatusSelector;
pub use subscription::ProjectionId;
pub use subscription::ReceiptFilter;
pub use subscription::SubscriptionDelivery;
pub use subscription::SubscriptionDescriptor;
pub use subscription::SubscriptionId;
pub use subscription::SubscriptionSource;
pub use subscription::SUBSCRIPTION_WIRE_REQUIRES;
pub use supervisor::Supervisor;
pub use validating_effect_backend::ValidatingEffectBackend;

Modules§

builder
The host builder: mount content-identified modules, validate them against each other, then lower the whole set into one syncbat runtime.
composition
The content-addressed host-composition schema manifest.
descriptor
Declarative, content-hashable descriptors for the non-operation axes a host module mounts: its admission guard, its lifecycle hooks, and its supervised jobs.
error
Typed host-composition failures.
event_payload_binding
Event-kind to event-payload schema bindings for host-mediated appends.
host
The composed, runnable host.
host_control_backend
The host-layer EffectBackend that PERFORMS an operation’s declared host-control effect.
identity
Content identity: the canonical-hash primitive plus the two digest newtypes the host uses to name modules and whole compositions.
interface
Client-visible interface identity for a composed host.
manifest
The content-identified module manifest.
module
The runtime module: the manifest’s declared parts plus the implementations they describe, sealed together so they cannot drift.
schema
D7 schema identity: stable, language-neutral wire-shape descriptors.
subscription
Subscription descriptor types for the client-visible host interface.
supervisor
The generic supervisor: it runs long-running module work off the checkout path over the reviewed batpak::store::Spawn seam.
validating_effect_backend
Schema-validating wrapper around a syncbat::EffectBackend.