mod envelope;
mod kv_handoff;
mod trait_;
pub use envelope::{EnvelopeSignature, HandoffEnvelope, HandoffProof, MerklePrefixProof};
pub use kv_handoff::KvHandoff;
pub use trait_::{Handoff, HandoffError, HandoffState};
pub fn audited_handoff(
kv: std::sync::Arc<dyn klieo_core::KvStore>,
trust_registry: std::sync::Arc<dyn crate::source_identity_registry::SourceIdentityRegistry>,
) -> KvHandoff {
let base = KvHandoff::new(kv, trust_registry);
if let Some(ctx) = crate::run_context::current_run_context() {
base.with_audit(ctx.episodic, ctx.run_id)
} else {
base
}
}