Skip to main content

HarnessEvent

Enum HarnessEvent 

Source
pub enum HarnessEvent {
Show 16 variants RunStarted { run_id: RunId, agent_id: AgentId, }, ContextBuilt { run_id: RunId, turn_id: TurnId, context: ContextPack, }, ContextCompacted { run_id: RunId, turn_id: TurnId, estimated_tokens_before: u32, estimated_tokens_after: u32, dropped_turn_start: u64, dropped_turn_end_exclusive: u64, }, ModelRequested { run_id: RunId, turn_id: TurnId, step: u32, model: ModelName, }, ModelFailed { run_id: RunId, turn_id: TurnId, step: u32, reason: String, }, ModelResponded { run_id: RunId, turn_id: TurnId, step: u32, output: Message, proposed_calls: Vec<ToolProposal>, served_model: Option<ModelName>, usage: Option<ModelUsage>, }, ToolProposalsRejected { run_id: RunId, turn_id: TurnId, reason: String, }, ToolCallProposed { run_id: RunId, turn_id: TurnId, call: ToolCall, }, PolicyEvaluated { run_id: RunId, call_id: ToolCallId, decision: PolicyDecision, }, ApprovalGranted { run_id: RunId, call_id: ToolCallId, actor_id: ActorId, }, ApprovalDenied { run_id: RunId, call_id: ToolCallId, actor_id: ActorId, reason: String, }, ToolStarted { run_id: RunId, call_id: ToolCallId, }, ToolFinished { run_id: RunId, result: ToolResult, }, ToolFailed { run_id: RunId, call_id: ToolCallId, reason: String, }, RunFinished { run_id: RunId, }, RunFailed { run_id: RunId, reason: String, },
}
Expand description

Durable event log entries. Transcript, metrics, replay, and audit views are derived from this log.

The tagged JSON schema rejects unknown fields rather than discarding durable data.

Variants§

§

RunStarted

Binds a fresh state machine to one run and agent.

Fields

§run_id: RunId

Durable run identifier shared by every later event.

§agent_id: AgentId

Agent identity selected by the host for this run.

§

ContextBuilt

Records the exact bounded context selected for a model turn.

Fields

§run_id: RunId

Run receiving the context.

§turn_id: TurnId

New turn identifier; concluded turn identifiers cannot be reused.

§context: ContextPack

Lane-labeled context that must pass budget validation.

§

ContextCompacted

Records prior turns omitted from the next model context.

Fields

§run_id: RunId

Run receiving the compacted context.

§turn_id: TurnId

Turn whose context will reflect the compaction.

§estimated_tokens_before: u32

Estimated tokens before prior turns were dropped.

§estimated_tokens_after: u32

Estimated tokens after prior turns were dropped.

§dropped_turn_start: u64

Zero-based first dropped prior-turn position.

§dropped_turn_end_exclusive: u64

Exclusive end of the dropped prior-turn range.

§

ModelRequested

Records that a model request crossed the provider boundary.

Fields

§run_id: RunId

Run making the request.

§turn_id: TurnId

Turn whose context is being submitted.

§step: u32

Monotonic model step expected by the run state.

§model: ModelName

Host-selected model used for the request.

§

ModelFailed

Records that the pending model request failed without terminating the run.

Fields

§run_id: RunId

Run containing the pending request.

§turn_id: TurnId

Turn of the pending model request.

§step: u32

Model step of the pending request.

§reason: String

Durable host-reported failure reason.

§

ModelResponded

Records the normalized result returned by the pending model request.

Fields

§run_id: RunId

Run receiving the response.

§turn_id: TurnId

Turn of the pending model request.

§step: u32

Model step of the pending request.

§output: Message

Normalized model-authored message.

§proposed_calls: Vec<ToolProposal>

Unvalidated model proposals; an empty list concludes the turn.

§served_model: Option<ModelName>

Provider-reported model that served the response, when available.

This is an auditable response fact. The host-selected request model remains recorded separately on HarnessEvent::ModelRequested. Unknown values are omitted so pre-field 0.3.0 records round-trip without gaining a field.

§usage: Option<ModelUsage>

Provider-reported token usage, or None when usage is unknown.

Reported zero counts remain known usage rather than None.

§

ToolProposalsRejected

Rejects every unvalidated tool proposal in the pending model response.

Fields

§run_id: RunId

Run containing the pending proposals.

§turn_id: TurnId

Turn that produced the pending proposals.

§reason: String

Non-empty host explanation for rejecting the whole proposal batch.

§

ToolCallProposed

Records a model proposal after host validation and effect classification.

Fields

§run_id: RunId

Run containing the proposal.

§turn_id: TurnId

Turn that produced the proposal.

§call: ToolCall

Host-validated call; its tool and input must match a pending proposal.

§

PolicyEvaluated

Records the policy decision for the pending validated call.

Fields

§run_id: RunId

Run containing the call.

§call_id: ToolCallId

Pending call evaluated by policy.

§decision: PolicyDecision

Durable allow, approval, or denial decision.

§

ApprovalGranted

Records who granted a pending approval.

Fields

§run_id: RunId

Run containing the call.

§call_id: ToolCallId

Pending call approved for execution.

§actor_id: ActorId

Human or host actor that granted approval.

§

ApprovalDenied

Records who denied a pending approval and why.

Fields

§run_id: RunId

Run containing the call.

§call_id: ToolCallId

Pending call denied before execution.

§actor_id: ActorId

Human or host actor that denied approval.

§reason: String

Durable denial reason for audit and continuation context.

§

ToolStarted

Records that the host began executing the approved call.

Fields

§run_id: RunId

Run containing the call.

§call_id: ToolCallId

Approved call that crossed the execution boundary.

§

ToolFinished

Records the structured result returned by the running call.

Fields

§run_id: RunId

Run containing the call.

§result: ToolResult

Result whose call id must match the running call.

§

ToolFailed

Records that the running call failed without a result.

Fields

§run_id: RunId

Run containing the call.

§call_id: ToolCallId

Running call that failed.

§reason: String

Durable host-reported failure reason.

§

RunFinished

Terminates a concluded turn as a successful run.

Fields

§run_id: RunId

Run that completed.

§

RunFailed

Terminates any started, nonterminal run as failed.

Fields

§run_id: RunId

Run that failed.

§reason: String

Durable terminal failure reason.

Implementations§

Source§

impl HarnessEvent

Source

pub fn run_id(&self) -> &RunId

Returns the owning run id without validating event order or phase.

Source

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

Returns the stable snake-case event name used in transition diagnostics.

Trait Implementations§

Source§

impl Clone for HarnessEvent

Source§

fn clone(&self) -> HarnessEvent

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 HarnessEvent

Source§

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

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

impl<'de> Deserialize<'de> for HarnessEvent

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 HarnessEvent

Source§

fn eq(&self, other: &HarnessEvent) -> 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 HarnessEvent

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 HarnessEvent

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.