Expand description
Deterministic sans-I/O text-message engine.
The engine is a reducer: platform code feeds it commands (compose, receive, transmit updates, archive results, ticks) and drains a bounded queue of effects and events. It never calls a database, sleeps, or transmits directly, so it can be tested without a radio, clock, executor, or platform runtime, and runs identically on mobile and pager targets.
§Output contract
Outputs carry stable IDs and may be re-emitted; platform storage must
apply message mutations idempotently (a mutation with a revision not
newer than the last applied for its handle is a no-op). Rendered bodies
live in an internal arena addressed by BodyRef; drain all outputs
after each command — the arena resets once the queue is empty.
Modules§
- fragment
- Outbound fragmentation planning and fixed-capacity reassembly.
- repair
- Resend-service bookkeeping: pending archive lookups, response coalescing, and deterministic jitter.
- sequence
- Per-stream sequence state: serial-number arithmetic, duplicate windows, and wire-ID-to-handle mappings.
Structs§
- Archive
Key - Archive key identifying resendable outbound material.
- BodyRef
- Reference into the engine’s render arena; resolve with
Engine::body. Valid until the output queue has been fully drained. - Engine
- The deterministic text engine.
- Engine
Config - Tuning knobs. Defaults suit a LoRa mesh; a pager may shrink the windows.
- Message
Mutation - An idempotent transcript mutation.
- Stream
Checkpoint - Persisted outbound stream checkpoint.
- Transmission
- A frame for the platform to transmit.
Enums§
- Archive
Result - Result of an outbound archive lookup.
- Completion
Status - Completeness of a message’s body.
- Compose
Error - Compose
Intent - What the caller wants to send.
- Compose
Ref - Reference to a previously composed original for edits and deletes.
- Delivery
State - Destination
- Where a transmit effect should be sent.
- Diagnostic
- Non-fatal observations, surfaced for logging and counters.
- Direction
- Event
- Application-visible events.
- Mutation
Kind - Output
- One drained output: an effect for the platform or an application event.
- Presence
- Presence of a message’s ordered transcript slot.
- Receive
Error - Regarding
Ref - What a reply or emote is about.
- Repair
Outcome - Resolved
Ref - A protocol-level reference, resolved to a stable handle when unambiguous.
Constants§
- MAX_
FRAME - Maximum encoded text payload the engine will hand to a transport.
Functions§
- destination_
for - Delivery mode of a conversation, used for original sends and for resend responses (which return on the conversation’s mode, not the request’s arrival path).