Skip to main content

Module engine_journal

Module engine_journal 

Source
Expand description

Durable engine journal for restart-safe command/event logging.

This module provides persistent storage for engine commands and their resulting events, enabling:

  • Restart-safe ACK: API responses only after DB commit
  • Idempotency: duplicate request_id returns cached response
  • Auditability: full command + event trace queryable
  • Future replay: schema supports snapshot + replay recovery

Structs§

EngineJournalWriter
Durable engine journal writer
InMemoryJournalWriter
In-memory journal writer for testing. Exercises real idempotency logic without requiring a database.
JournalAppendResult
Result of appending a transition to the journal
JournalCommandSummary
JournalEventRecord
JournalFullRecord

Enums§

EngineJournalError
Error type for engine journal operations
EventPersistenceMode
Event persistence mode for journal writes. Controls the latency/durability tradeoff.

Traits§

JournalWriter
Trait for journal writers (enables mock implementations for testing)

Functions§

ensure_no_fill_events 🔒
get_critical_event_types 🔒
Get the set of critical event types that are always persisted in Full mode. These events are needed for the outbox publisher to replay state correctly. Configured via ENGINE_JOURNAL_CRITICAL_EVENT_TYPES env var. Default: “L2Update” (essential for cache state rebuild)
is_critical_event_type 🔒
Check if an event type is critical and should always be persisted in Full mode

Type Aliases§

SharedEngineJournalWriter
Thread-safe wrapper for journal writers (trait object for mock support)