polyc_eventlog_model/lib.rs
1//! Storage-agnostic vocabulary and verification for Polychrome journals.
2//!
3//! This crate deliberately contains no storage runtime, opener, mutable host,
4//! or filesystem handle. Policy and read-plane crates can therefore compile
5//! against [`Event`], trust metadata, integrity verification, and navigation
6//! without acquiring the capability to open durable journal authority.
7
8pub mod event;
9pub mod integrity;
10pub mod nav;
11pub mod taint;
12
13pub use event::{Event, EventCfg};
14pub use integrity::{
15 IntegrityError, MMR_SIGNED_ROOT_KIND, extend_and_sign, rebuild_from_events, verify_replay,
16 verify_replay_with_trust,
17};
18pub use taint::{
19 GrantedCapabilities, TrifectaLegs, TrustTag, any_untrusted, any_untrusted_excluding,
20 trifecta_legs,
21};
22
23/// A replay that may stop before the partition tail at a caller byte budget.
24#[derive(Debug, Clone)]
25pub struct BoundedReplay {
26 /// Ordered `(position, event)` pairs read before the budget tripped.
27 pub events: Vec<(u64, Event)>,
28 /// Sum of every returned event payload's encoded body length.
29 pub bytes_read: u64,
30 /// Whether the caller's byte budget stopped the replay early.
31 pub budget_exceeded: bool,
32}