Skip to main content

Module kernel_event

Module kernel_event 

Source
Expand description

KernelEvent schema — Phase 3a (立契约).

The single source of truth for all observable state transitions in a turn. Every variant is #[non_exhaustive]; consumers must handle unknown variants gracefully. Adding fields is backward-compatible; removing or renaming requires a schema upcast function + schema_version bump.

Status: v1 (2026-06-15). Double-write started in Phase 3a; only consumed in Phase 3b once completeness verification passes.

Structs§

KernelEventEnvelope
Row written to the kernel_events SQLite table.
MessageRange
Inclusive message-index range [from, to] (0-based, across all messages).
PolicyDecision
Policy metadata resolved for a planned call (subset relevant to replay).

Enums§

ApprovalVerdict
Whether the user approved or rejected a planned tool call.
CapacityAction
What the capacity subsystem decided to do at a checkpoint.
CapacityCheckpointKind
Which code path triggered a capacity checkpoint.
DeltaKind
Stream delta type during model response.
KernelEvent
Append-only, strongly-typed, monotonically-sequenced log of all observable state transitions in a single turn.
OverflowStrategy
Strategy applied when recovering from a context overflow.
ToolOutcome
Resolved outcome for a single tool call.
TurnOutcome
Reason a turn ended. Supersedes bare TurnOutcomeStatus with richer detail so that the state-machine can branch without out-of-band flags.

Type Aliases§

ArtifactId
Identifier for a compaction/snapshot artifact stored in the artifact store.
CallId
Unique identifier for a single tool call attempt.
TurnId
Unique identifier for a turn (maps to TurnContext::id).