mod event#

module event#

Lifecycle event types and builder-backed event constructors.

Variables

const ATOF_VERSION: &str#

ATOF protocol version emitted by this runtime.

Functions

fn attributes_from_handle(attributes: HandleAttributes) -> Vec<String>#

Convert handle bitflags into ATOF attributes.

fn llm_attributes_to_strings(attributes: LlmAttributes) -> Vec<String>#

Convert LLM bitflags into ATOF attributes.

fn scope_attributes_to_strings(attributes: ScopeAttributes) -> Vec<String>#

Convert scope bitflags into ATOF attributes.

fn tool_attributes_to_strings(attributes: ToolAttributes) -> Vec<String>#

Convert tool bitflags into ATOF attributes.

Enums

enum Event#

Tagged union covering the two ATOF event kinds emitted by the runtime.

Scope(ScopeEvent)#

Scope lifecycle event.

Mark(MarkEvent)#

Point-in-time checkpoint event.

Implementations

impl Event#

Functions

fn annotated_request(&self) -> Option<&Arc<AnnotatedLlmRequest>>#

Return the runtime-only annotated LLM request.

fn annotated_response(&self) -> Option<&Arc<AnnotatedLlmResponse>>#

Return the runtime-only annotated LLM response.

fn attributes(&self) -> Option<&[String]>#

Return attributes for scope events.

fn category(&self) -> Option<&EventCategory>#

Return the semantic category if present.

fn category_profile(&self) -> Option<&CategoryProfile>#

Return the category-specific profile if present.

fn category_profile_mut(&mut self) -> Option<&mut CategoryProfile>#

Return the mutable category-specific profile if present.

fn data(&self) -> Option<&Json>#

Return the optional application payload attached to the event.

fn data_schema(&self) -> Option<&DataSchema>#

Return the optional data schema.

fn input(&self) -> Option<&Json>#

Return the semantic input payload for start events.

fn is_scope_end(&self) -> bool#

Return true for scope-end events.

fn is_scope_start(&self) -> bool#

Return true for scope-start events.

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

Return the ATOF event kind.

fn metadata(&self) -> Option<&Json>#

Return the optional metadata attached to the event.

fn model_name(&self) -> Option<&str>#

Return the normalized model name for LLM events.

fn name(&self) -> &str#

Return the human-readable event name.

fn output(&self) -> Option<&Json>#

Return the semantic output payload for end events.

fn parent_uuid(&self) -> Option<Uuid>#

Return the parent scope UUID, if the event is nested under a scope.

fn scope_category(&self) -> Option<ScopeCategory>#

Return the lifecycle phase for scope events.

fn scope_type(&self) -> Option<ScopeType>#

Return the semantic scope category for scope events.

fn timestamp(&self) -> &DateTime<Utc>#

Return the event timestamp.

fn tool_call_id(&self) -> Option<&str>#

Return the provider-specific tool-call correlation identifier.

fn uuid(&self) -> Uuid#

Return the unique event or span UUID.

enum ScopeCategory#

ATOF lifecycle phase for a scope event.

Start#

Scope was entered.

End#

Scope was exited.

Structs and Unions

struct BaseEvent#

Shared event metadata carried by every ATOF event.

atof_version: String#

ATOF protocol version.

parent_uuid: Option<Uuid>#

UUID of the parent scope, if any.

uuid: Uuid#

Unique identifier for the event or span.

timestamp: DateTime<Utc>#

Event timestamp in UTC.

name: String#

Human-readable event name.

data: Option<Json>#

Application-defined payload.

data_schema: Option<DataSchema>#

Optional schema identifier for data.

metadata: Option<Json>#

Optional tracing/correlation metadata.

struct CategoryProfile#

Category-specific profile data.

Unknown wire keys are preserved in extra. LLM annotations are runtime-only enrichment used by internal adaptive/ATIF logic and are never serialized.

model_name: Option<String>#

Normalized model identifier for LLM events.

tool_call_id: Option<String>#

LLM-provider correlation ID for Tool events.

subtype: Option<String>#

Vendor subtype required when category == "custom".

extra: BTreeMap<String, Json>#

Unknown category-profile keys preserved from newer producers.

annotated_request: Option<Arc<AnnotatedLlmRequest>>#

Normalized request annotation for LLM start events.

annotated_response: Option<Arc<AnnotatedLlmResponse>>#

Normalized response annotation for LLM end events.

Implementations

impl CategoryProfile#

Functions

fn is_wire_empty(&self) -> bool#

Return true when the profile has no wire-serialized fields.

struct DataSchema#

Identifier for the schema that describes an event’s opaque data payload.

name: String#

Schema name.

version: String#

Schema version.

struct EventCategory(String)#

Semantic category carried by ATOF category.

This is intentionally string-backed so consumers can preserve category values from newer producers without failing deserialization.

Implementations

impl EventCategory#

Functions

fn agent() -> Self#

Top-level agent or workflow scope.

fn as_str(&self) -> &str#

Return the string form serialized on the wire.

fn custom() -> Self#

Vendor-defined custom category.

fn embedder() -> Self#

Embedding-generation step.

fn evaluator() -> Self#

Evaluation or scoring step.

fn function() -> Self#

Generic function or application step.

fn guardrail() -> Self#

Guardrail or validation step.

fn llm() -> Self#

LLM call.

fn new(value: impl Into<String>) -> Self#

Create a category from an arbitrary producer-provided string.

fn reranker() -> Self#

Result reranking step.

fn retriever() -> Self#

Retrieval step.

fn to_scope_type(&self) -> ScopeType#

Convert this category to the closest legacy scope type for internal adapters that still need span-kind classification.

fn tool() -> Self#

Tool invocation.

fn unknown() -> Self#

Unknown or unclassified work.

Traits implemented

impl From<ScopeType> for EventCategory#
struct MarkEvent#

ATOF point-in-time mark event.

base: BaseEvent#

Shared ATOF envelope.

category: Option<EventCategory>#

Optional semantic category for the checkpoint.

category_profile: Option<CategoryProfile>#

Optional category-specific typed fields.

Implementations

impl MarkEvent#

Functions

fn new(base: BaseEvent, category: Option<EventCategory>, category_profile: Option<CategoryProfile>) -> Self#

Construct a mark event from a base envelope and optional category data.

struct ScopeEvent#

ATOF scope lifecycle event.

base: BaseEvent#

Shared ATOF envelope.

scope_category: ScopeCategory#

Scope lifecycle phase.

attributes: Vec<String>#

Canonical lowercase behavioral flags.

category: EventCategory#

Semantic category of work.

category_profile: Option<CategoryProfile>#

Category-specific typed fields.

Implementations

impl ScopeEvent#

Functions

fn new(base: BaseEvent, scope_category: ScopeCategory, attributes: Vec<String>, category: EventCategory, category_profile: Option<CategoryProfile>) -> Self#

Construct a scope event from a base envelope and ATOF-specific fields.