Raxol.AgentClientProtocol.Ext.Journal.Record (Raxol Agent Client Protocol v0.1.0)

Copy Markdown View Source

One grow-only journal record.

Fields ONLY ever get ADDED (optional-with-default); never renamed, retyped, reordered, narrowed. A reader that meets an unknown kind skips/passes it through — never an error. This is what makes the generic _raxol/session.record delivery frame future-proof.

Field meanings:

  • offset — per-session positive integer, from 1, contiguous, strictly increasing in append order (THE OFFSET LAW in Raxol.AgentClientProtocol.Ext.Journal). Assigned atomically inside append (offset = current high_watermark + 1, under the Writer's single-mailbox serialization). Never reused/reordered.
  • session_id — binary, NEVER atomized.
  • kind — grow-only vocabulary, a STRING on disk/wire ("session_created", "session_update", "turn_started", "turn_completed", …). Never String.to_atom'd on read.
  • payload — JSON-safe wire map (string keys); value-identity under any Layer-2 codec so a writerless reader in another language needs no Elixir terms.
  • taint — trust classification, STAMPED at append, NEVER filtered on the delivery path (annotate-never-filter).
  • ts_hook — ms epoch assigned by the store clock at append.

Summary

Types

t()

@type t() :: %Raxol.AgentClientProtocol.Ext.Journal.Record{
  kind: String.t(),
  offset: pos_integer(),
  payload: map(),
  session_id: String.t(),
  taint: String.t(),
  ts_hook: integer()
}