Skip to main content

Module message_origin

Module message_origin 

Source
Expand description

Where a message in an agent’s conversation came from, as srv knows it when it writes the message down (docs/specs/SPEC_MESSAGE_ORIGIN_AND_ONE_CONTAINER_2026_10_25.md §3).

Every producer of an agent message (a pane, a jekt, a Swarm broadcast, a schedule, the Supervisor, a paired phone, AgentMux itself) builds one MessageOrigin from the typed values it already holds, and passes it down the delivery path with the message. The record writers store it beside the message in the record’s amx object:

{"type":"user","message":{"role":"user","content":"…"},
 "amx":{"v":1,"origin":{"kind":"agent","from":"agent1","trust":"host-verified"},
        "notes":["[AgentMux] AgentMux was upgraded …"]}}

Nothing here reads a message body: the origin is never inferred from text. A producer that sets none is a compile error, because the parameter is not optional anywhere on the path.

Structs§

MessageOrigin
Who or what a message is from, set by srv from typed values.
RecordOrigin
What a record writer stores beside a message: its origin and the notes srv attached to it.

Enums§

OriginDelivery
How a jekt reached this srv, as in the marker’s DELIVERY=.
OriginSig
Whether the sender’s signature checked out (the marker’s SIG=); absent when the message carried none.
OriginTier
A jekt’s sensitivity tier, as in the marker’s TIER=.
OriginTrust
How far a jekt’s sender is trusted, as the jekt marker’s TRUST= says (reactive::sanitize::jekt_trust).

Constants§

ORIGIN_VERSION
The shape version of amx.origin; a reader that doesn’t know a version treats the record as untyped.

Functions§

stamp_bytes
stamp_line for a line with its trailing newline, which is kept.
stamp_line
line (one NDJSON user record, no trailing newline) with record added to its amx. A line that is not a JSON object is returned as it is: the record then has no origin, and a reader takes it as untyped.