Skip to main content

EventBody

Enum EventBody 

Source
pub enum EventBody {
    SessionStart {
        agent: String,
        harness: String,
        model: Option<String>,
        trace_format: Option<String>,
    },
    SessionEnd {
        outcome: SessionOutcome,
    },
    Resume {
        last_seq_seen: u64,
    },
    TurnStart,
    TurnEnd,
    PromptAssembled {
        budget_tokens: u32,
        declared_total_tokens: u64,
        composition_digest: Option<String>,
        frames: Vec<RenderedFrame>,
    },
    ModelResponse {
        tool_calls: Vec<String>,
    },
    ToolCall {
        call_id: String,
        tool: String,
    },
    ToolResult {
        call_id: String,
        status: ToolStatus,
    },
    VerifyObserved {
        frame: FrameId,
        verdict: Verdict,
    },
    SideEffect {
        effect_id: String,
        kind: String,
        call_id: Option<String>,
    },
}
Expand description

The event bodies. Serialized internally tagged on event and flattened into the TraceEvent envelope, so a journal line reads {"seq":5,…,"event":"tool_call","call_id":"call_1",…}.

Variants§

§

SessionStart

The recording opens: which agent, under which harness, is being traced.

Fields

§agent: String

The agent under trace (adapter-declared, e.g. example-agent).

§harness: String

The harness identity and version (e.g. stella/0.9).

§model: Option<String>

The model in use, when the adapter knows it.

§trace_format: Option<String>

The trace vocabulary this journal is written to — see TRACE_FORMAT.

§

SessionEnd

The session tore down deliberately. A journal without one records a crash.

Fields

§

Resume

The harness came back after a crash. last_seq_seen is the highest seq the resumed harness actually recovered — the journal knows what it recorded, so the delta between the two is quantified work loss. A resume implicitly closes any open turn and orphans any unresolved tool calls; resumed work starts a new turn.

Fields

§last_seq_seen: u64
§

TurnStart

A turn opens. The envelope turn names it.

§

TurnEnd

The open turn closes. The envelope turn must match.

§

PromptAssembled

The harness composed a prompt and sent it. Recording assembly as the model request is deliberate: the journal claims what was sent is what was assembled, and every context guarantee is checked at this moment — the point of use.

Fields

§budget_tokens: u32

The context budget the harness announced for this prompt, in budget tokens (SPEC.md §7).

§declared_total_tokens: u64

The harness’s own total of the rendered frame costs — checked against the per-frame declarations, so the arithmetic can’t drift from the itemization.

§composition_digest: Option<String>

Digest of the composed context section (algorithm recorder-declared, e.g. sha256:<hex>). Optional; when present, an unchanged frame set MUST reproduce it byte-identically (docs/context-reuse.md §1 prefix stability, finally checkable).

§frames: Vec<RenderedFrame>

The frames rendered into this prompt, in composition order.

§

ModelResponse

The model answered, requesting zero or more tool calls by id. The ids are the loop’s contract: each must be resolved exactly once before the next prompt_assembled.

Fields

§tool_calls: Vec<String>
§

ToolCall

The harness began executing a model-requested call. Executing a call the model never requested is the phantom-execution defect.

Fields

§call_id: String
§tool: String
§

ToolResult

A requested call was resolved — executed to completion, errored, or declined (ToolStatus::Rejected).

Fields

§call_id: String
§status: ToolStatus
§

VerifyObserved

The host observed a context/verify answer for a frame it holds (docs/context-reuse.md §4). Rendering the same identity after a stale/gone verdict is the citing-dead-evidence defect.

Fields

§frame: FrameId
§verdict: Verdict
§

SideEffect

The harness performed an externally visible action (file write, network call, command). effect_id names an intended-once effect: a deliberate re-execution is a new id, so the same id twice is the crash-replay bug by construction.

Fields

§effect_id: String
§kind: String

e.g. file_write, network, command.

§call_id: Option<String>

The tool call this effect was performed under, when there is one.

Implementations§

Source§

impl EventBody

Source

pub fn kind(&self) -> &'static str

The event’s wire name, for evidence strings and log lines.

Trait Implementations§

Source§

impl Clone for EventBody

Source§

fn clone(&self) -> EventBody

Returns a duplicate of the value. Read more
1.0.0 (const: unstable) · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for EventBody

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for EventBody

Source§

fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl PartialEq for EventBody

Source§

fn eq(&self, other: &EventBody) -> bool

Equality operator ==. Read more
1.0.0 (const: unstable) · Source§

fn ne(&self, other: &Rhs) -> bool

Inequality operator !=. Read more
Source§

impl Serialize for EventBody

Source§

fn serialize<__S>(&self, __serializer: __S) -> Result<__S::Ok, __S::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl StructuralPartialEq for EventBody

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.