Skip to main content

Module event

Module event 

Source
Expand description

Canonical event schema. OTel logs data model + ECS attribute conventions, with a zeroclaw.* namespace for the alias-bound domain attribution fields.

On-disk JSON shape is the canonical contract — third-party tail consumers parse serde_json::Value and walk the keys. This struct is pub(crate) to keep external consumers off the typed surface.

Structs§

Event
One emission’s call-site descriptor. Built by the record! macro from the Event constructor + builder calls and consumed by the layer. Everything is by-value; the macro takes &Event to keep call sites non-moving.
EventDescriptor
ECS-style nested event descriptor.
LogEvent
One row in the canonical log stream.
ServiceDescriptor
Service-identifier block. Constant for the daemon’s lifetime.
ZeroclawAttribution
ZeroClaw-domain attribution. Every field is alias-bound where applicable: channel is the <type>.<alias> composite, model_provider is the <type>.<alias> composite, etc. Composites are stored as three keys (<prefix>, <prefix>_type, <prefix>_alias) so filters can match either coarse or precise.

Enums§

Action
Closed event.action taxonomy. Adding a verb requires extending this enum — no Other(&str) escape hatch on purpose. The snake_case form of each variant is the on-disk event.action string, derived via strum::IntoStaticStr.
EventCategory
ECS-style event.category coarse axis.
EventOutcome
ECS event.outcome. Default unknown.
Severity
OTel severity buckets. Stored alongside severity_number so consumers can range-compare numerically and pattern-match textually.

Constants§

ATTRIBUTION_FIELDS
Plain alias-bound attribution fields. Adding to this list is the ONLY per-field change needed — Layer/reader/gateway/UI all read this list at runtime instead of hardcoding the per-field plumbing.
COMPOSITE_PREFIXES
Composite alias-bound prefixes. Each prefix gets three on-disk keys: <prefix> (full <type>.<alias>), <prefix>_type, <prefix>_alias. Adding to this list propagates to every consumer the same way as ATTRIBUTION_FIELDS.

Functions§

alias_field
Derive the _alias decomposed key for a composite prefix. Single source of the _alias suffix.
is_attribution_field
True when name matches a known plain attribution field, a composite prefix, or a composite’s decomposed _type / _alias suffix.
severity_text_from_number
Lookup helper used by callers that already have an OTel-style severity number and want the text bucket.
severity_text_from_tracing_level
type_field
Derive the _type decomposed key for a composite prefix. Single source of the _type suffix — every reader/writer routes through this.