Message envelope
The shape of a Message envelope as it is persisted in SQLite, returned by the broker layer, and rendered by the CLI.
Persisted shape
Every message is a flat row of typed columns in messages — there is no JSON blob; messages.text carries the body and the remaining columns carry the routing and lifecycle fields. See data-model.md for durable message ownership and lifecycle. The persisted shape is the canonical source of truth; every render the broker produces is a projection of these columns.
Rendered shape
The broker's read paths return the persisted columns as a flat dict (the typed-column dict), projected per output mode below.
Text-mode projection
The compact text rendering omits the columns whose values are constant or recoverable from context:
JSON output
The JSON contract defines complete untruncated envelopes; Output shapes owns each command's wrapper, including send notification status and broadcast counts.
Example
A poll result with one unicast delivery (id 42, from 7, to 3, body "build OK").
cafleet message poll 3 --json:
A broadcast summary renders kind: "broadcast_summary" and its self-referencing
origin: <id>. Its body is "Broadcast sent to N recipients"; the broadcast
result contains this summary with recipient/delivery counts, as defined in
Output shapes.
Text mode
The bracketed envelope uses status_timestamp; a nonempty body follows on
the next line:
Broadcast summary rows are never empty — the broker writes the human-readable summary "Broadcast sent to N recipients" at insert time, so summary rows always render their body line. Body truncation (the … suffix at CAFLEET_MAX_TEXT_LEN codepoints) is documented in cli-options.md.