honest framework

honest-alerts

Messages between actors. The mailbox is a projection over the event log; a crash loses nothing.

You know WebSocket and SSE push. honest-alerts routes messages by a table and derives each mailbox from an append-only log, so nothing is lost in flight.

Two parts of your system need to talk. So one calls the other's function directly, holding a reference to it. Then a third needs the same notification, so it registers a callback. Then a retry is needed, and the retry state goes into a variable somewhere. Soon "who gets told when X happens" is a web of direct references and ad-hoc callbacks, the delivery status lives in mutable fields, and a message lost in a crash is lost for good, because it existed only as a function call in flight.

honest-alerts is the framework's message-passing layer: messages between actors, delivered through a mailbox that is a *projection over the event log*, not a mutable queue. Sending a message appends an event. A recipient's mailbox is the fold of those events. Routing is a table; the supervisor that restarts a failed actor is stateless; the lifecycle of a message is a state machine. The decisions are pure; delivery, the emit, and the reply-wait reach the world only through an injected runtime.

The mailbox is derived, not stored

Because the mailbox is a projection over the append-only log, it is reconstructable: a crash does not lose messages, because the messages are events, and the mailbox is recomputed by replaying them. send returns once the message is recorded; send_and_wait records the message and folds forward until the reply event appears. Neither holds delivery state in a mutable field: the log is the state, the mailbox is a read of it.

Routing is a dict-dispatch from message kind to handler, not a switch. The supervisor holds no state between decisions: given a failure event, it returns the restart action. The DOM surfaces render the three notification zones the page declares, and the observe catalog names every event the layer emits.

Why the event-log mailbox is a poka-yoke

Message passing built on direct references and mutable queues loses messages exactly when it matters most — at a crash — and makes "was this delivered?" a question no one can answer after the fact. Derive the mailbox from an append-only log and the category closes: every message is a durable event, delivery is a state machine over those events, and the full history is queryable. A message cannot vanish, because it was never only in flight; it was written down. honest-alerts imports neither honest-persist nor honest-observe; the injected runtime hands it the log writer, so the layer stays pure and its home stays independent.