#[non_exhaustive]pub enum KernelEvent {
Show 25 variants
SchemaVersion {
version: u32,
},
TurnStarted {
turn_id: TurnId,
mode: TurnLoopMode,
input_text: String,
max_steps: u32,
},
TurnEnded {
turn_id: TurnId,
outcome: TurnOutcome,
total_steps: u32,
},
ModelRequestIssued {
turn_id: TurnId,
step_idx: u32,
request_fp: RequestFingerprint,
token_budget: u32,
},
ModelDelta {
turn_id: TurnId,
step_idx: u32,
kind: DeltaKind,
call_id: Option<CallId>,
text: String,
},
ModelMessage {
turn_id: TurnId,
step_idx: u32,
usage: Usage,
block_count: u32,
text_preview: String,
assistant_text: String,
},
ToolCallPlanned {
turn_id: TurnId,
step_idx: u32,
call_id: CallId,
tool_name: String,
input_json: String,
decision: PolicyDecision,
},
ToolCallStarted {
turn_id: TurnId,
call_id: CallId,
wave_idx: u32,
},
ToolCallFinished {
turn_id: TurnId,
call_id: CallId,
tool_name: String,
outcome: ToolOutcome,
duration_ms: u32,
wrote_state: bool,
result_preview: String,
session_content: String,
},
ApprovalResolved {
turn_id: TurnId,
call_id: CallId,
verdict: ApprovalVerdict,
},
CompactionArtifactCreated {
turn_id: TurnId,
artifact_id: ArtifactId,
replaced_range: MessageRange,
summary_token_count: u32,
},
ContextOverflowRecovered {
turn_id: TurnId,
step_idx: u32,
strategy: OverflowStrategy,
source_budget_cap: Option<u32>,
},
SteerInjected {
turn_id: TurnId,
step_idx: u32,
text: String,
},
ScratchpadReminderInjected {
turn_id: TurnId,
step_idx: u32,
area_path: String,
},
ScratchpadSummaryInjected {
turn_id: TurnId,
at_step: u32,
},
CycleBriefingInjected {
turn_id: TurnId,
cycle: u32,
step_idx: u32,
},
TopicMemoryInjected {
turn_id: TurnId,
step_idx: u32,
block_token_est: u32,
},
MemoryPlaneQueried {
turn_id: TurnId,
step_idx: u32,
layer: String,
query_key: String,
compiler_source: String,
},
LayeredContextSeamInjected {
turn_id: TurnId,
step_idx: u32,
level: u32,
messages_covered: u32,
text_preview: String,
},
LoopGuardTriggered {
turn_id: TurnId,
call_id: CallId,
reason: String,
},
CapacityCheckpoint {
turn_id: TurnId,
step_idx: u32,
kind: CapacityCheckpointKind,
tokens_used: u32,
token_budget: u32,
action: CapacityAction,
cooldown_blocked: bool,
},
CycleAdvanced {
turn_id: TurnId,
from_cycle: u32,
to_cycle: u32,
reason: String,
},
StepLimitContinuation {
turn_id: TurnId,
step_idx: u32,
lht_objective_injected: bool,
},
LoopGuardContinuation {
turn_id: TurnId,
step_idx: u32,
},
DeferredToolActivated {
turn_id: TurnId,
step_idx: u32,
tool_name: String,
},
}Expand description
Append-only, strongly-typed, monotonically-sequenced log of all observable state transitions in a single turn.
Replaces: core::Event free-string table, RuntimeEventRecord, EventFrame,
and SSE-compat surface — four representations become one.
§Schema evolution
- Adding a variant: add
#[serde(default)]fields; increment nothing. - Adding a field to existing variant: add
#[serde(default)]; no bump. - Removing or renaming: provide
upcast_v{N}_to_v{N+1}()and bumpSchemaVersion.
Variants (Non-exhaustive)§
This enum is marked as non-exhaustive
SchemaVersion
First record in every kernel_events table partition.
Currently always version: 1.
TurnStarted
Fields
mode: TurnLoopModeTurnEnded
ModelRequestIssued
Fields
request_fp: RequestFingerprintModelDelta
Fields
ModelMessage
Fields
ToolCallPlanned
Fields
input_json: StringJSON-serialised tool input. Large inputs (>16 KB) are stored as an
artifact reference; this field holds the truncated preview or {}
with a large_input_artifact_id field added.
decision: PolicyDecisionToolCallStarted
ToolCallFinished
Fields
outcome: ToolOutcomewrote_state: boolWhether the tool performed any filesystem/state writes. Mirrors
tool_writes_state() at call time; used to rebuild deferred-tool
activation projection in Phase 3b.
ApprovalResolved
CompactionArtifactCreated
Fields
artifact_id: ArtifactIdreplaced_range: MessageRangeMessage indices [from, to] replaced by this compaction artifact.
ContextOverflowRecovered
Fields
strategy: OverflowStrategySteerInjected
ScratchpadReminderInjected
ScratchpadSummaryInjected
Fields
CycleBriefingInjected
TopicMemoryInjected
Episodic topic-memory block injected into the system prompt (B2 double-write).
Fields
MemoryPlaneQueried
Read-side memory plane query executed (v3 Effect::QueryMemory double-write).
Fields
LayeredContextSeamInjected
Flash layered-context seam appended as assistant message (v3 #159 double-write).
Fields
LoopGuardTriggered
Fields
CapacityCheckpoint
CycleAdvanced
Fields
StepLimitContinuation
LoopGuardContinuation
DeferredToolActivated
A previously-deferred tool was promoted into the active tool set.
This event is emitted by maybe_activate_deferred_tool whenever the
model requests a tool that was not yet active. It is necessary for
Phase 3b: active_tool_names (host state) must be rebuildable from
the log so that TurnMachine::step can be a pure function.
Implementations§
Trait Implementations§
Source§impl Clone for KernelEvent
impl Clone for KernelEvent
Source§fn clone(&self) -> KernelEvent
fn clone(&self) -> KernelEvent
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read more