//! WAL wire format definitions.
//!
//! Two orthogonal formats live here:
//! - **Session journal** (`session`): variable-length records for session
//!   start/signal/close events, stored in `sessions.log`.
//! - **Signal batch** (`batch`): fixed-size event records (21-byte v1/v2, or
//!   32-byte v3 with the M9 governance envelope) grouped into
//!   BLAKE3-checksummed batches, stored in WAL segment files.

pub mod batch;
pub mod session;

// Re-export everything that was public from the old monolithic format.rs
// so that existing `use crate::wal::format::{...}` paths continue to resolve.

pub use batch::{
    BatchHeader, EVENT_SIZE, EVENT_SIZE_V3, EventRecord, FORMAT_VERSION, FORMAT_VERSION_V1,
    FORMAT_VERSION_V2, FORMAT_VERSION_V3, HEADER_PAYLOAD_LEN_OFFSET, HEADER_SIZE, MAGIC,
    MAX_EVENTS_PER_BATCH, RECORD_TYPE_SIGNAL, decode_batch, encode_batch, encode_batch_with_shard,
    event_content_hash, event_size_for_version, payload_len_from_header,
};
pub use session::{
    SESSION_RECORD_CLOSE, SESSION_RECORD_SIGNAL, SESSION_RECORD_START, SESSION_RECORD_VERSION_V2,
    SessionDecodeOutcome, SessionSeqNo, SessionWalEvent, decode_session_events,
    decode_session_events_with_diagnostics, encode_session_event,
};
