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§
- Kernel
Event Envelope - Row written to the
kernel_eventsSQLite table. - Message
Range - Inclusive message-index range
[from, to](0-based, across all messages). - Policy
Decision - Policy metadata resolved for a planned call (subset relevant to replay).
Enums§
- Approval
Verdict - Whether the user approved or rejected a planned tool call.
- Capacity
Action - What the capacity subsystem decided to do at a checkpoint.
- Capacity
Checkpoint Kind - Which code path triggered a capacity checkpoint.
- Delta
Kind - Stream delta type during model response.
- Kernel
Event - Append-only, strongly-typed, monotonically-sequenced log of all observable state transitions in a single turn.
- Overflow
Strategy - Strategy applied when recovering from a context overflow.
- Tool
Outcome - Resolved outcome for a single tool call.
- Turn
Outcome - Reason a turn ended. Supersedes bare
TurnOutcomeStatuswith richer detail so that the state-machine can branch without out-of-band flags.
Type Aliases§
- Artifact
Id - 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).