Skip to main content

Module checkpoint

Module checkpoint 

Source
Expand description

The logical checkpoint and its bounded tail (spec §12).

A checkpoint is not a snapshot of the kernel’s internals. It is a stable, versioned DTO whose shape is a contract in its own right, and every design rule below corrects the retired full-journal recovery format:

  1. Nothing here is derived from a private layout. LogicalKernelState is built by an explicit projection — LogicalStateProjection from the semantic driver, the transition partition from the transaction — so a field added to LoopStateMachine cannot silently change the checkpoint format, and a field this DTO needs cannot silently disappear. The old snapshot serialised the whole last planned step, rendered context and all, which made the blob a function of the rendered prompt rather than of the state.
  2. Every piece of correctness state has exactly one home. The four partitions of §12.1 — transition / syscall / scheduler / context_vm — partition the state, they do not overlap it: pending effects, the input replay ledger and the terminal live in transition, task attempts in scheduler, P3 handles in context_vm, and the checkpoint header repeats none of them. single_ownership_is_structural proves it by scanning the serialised document.
  3. The bounded tail is exact. tail_inputs covers (base_step_seq, through_step_seq] with no hole, no duplicate and nothing outside the range — checked at construction, so a checkpoint that would replay a different history than the journal did is not constructible.
  4. Three digests, three questions. state_digest answers “is this the logical state that was captured”, tail_digest answers “is this the tail that was captured”, and checkpoint_digest answers “is this the whole checkpoint, header included”. They all use the record layer’s canonical bytes, so a host validator that already implements §7.1.1 for records needs no second serialiser.

What this module deliberately does not do: install, restore, rebase or ack. §12.3’s second half is Task 16. What exists here is generation — [KernelTransaction::checkpoint_candidate] and the shapes it produces — plus the verification a restore will call into.

Structs§

AcceptedCancellationState
AcceptedInputState
One entry of the replay ledger (§12.3 rules 7 and 10).
AuthoredMemoryQueryState
AuthoredMemoryWriteState
CanonicalInput
One accepted input inside a checkpoint’s bounded tail.
CheckpointAckToken
Handle the host returns to ack_checkpoint once the blob is durably installed (§12.3).
CheckpointCandidate
§12.3 · what kernel.checkpoint_candidate() hands the host.
CheckpointDraft
Everything KernelCheckpoint::assemble needs. A struct rather than eight positional arguments, because two of them are step sequences and two are digests.
CheckpointRevision
The checkpoint format revision, fail-closed on the wire.
ChildProcessState
ContextVmStateV1
§12.1 · the P3 plane: the handle table and its allocator, skills and their leases, the knowledge slots, the signal partition and the compaction/renewal clocks.
EntropyState
EntropyTurnState
HandleState
One P3 handle. residency is the label plus the locator fields that residency carries, so the DTO neither mirrors the internal enum’s shape nor loses what a page-in needs.
InlineMessageBody
KernelCheckpoint
One logical checkpoint (§12.1).
KnowledgeSlotState
One knowledge slot, body included.
LaunchTokenState
LogicalCompressionEntry
LogicalKernelState
The versioned logical state of one operation, partitioned as §12.1 requires.
LogicalPlanStep
LogicalStateProjection
What the semantic driver contributes to a checkpoint.
LogicalTaskState
§12.1 · the durable task board, projected.
LogicalToolCall
MilestoneState
PartitionTokenState
PendingPayloadLoadState
PendingProviderCallState
QueuedSignalState
ReferencedMessageBody
ResolvedEffectState
SchedulerStateV1
§12.1 · the P2 plane: task control blocks and their attempts, budgets and waits, the workflow graph, queued signals plus dedupe memory, and the milestone cascade.
SkillLeaseState
StoredMessageState
One stored message, projected (§12.1, adjudication §5q-2).
StructuredMessageBody
SyscallStateV1
§12.1 · governance revision, the live policy, the rate-limit window, and the provider-tool causation the P1 gate derives a caller from.
TaskAttemptState
TaskControlState
One task control block, projected. The lifecycle travels as its label rather than as the internal enum: TaskLifecycle::Done(TerminationReason) is a semantic-kernel shape, and a checkpoint that mirrored it would be a checkpoint of a private layout.
TransitionStateV1
§12.1 · operation lifecycle, execution focus, the effect ledger, input replay, cancellation and the terminal.
WorkflowGraphState
WorkflowNodeState
One workflow node as source state rather than a snapshot of TaskGraph internals.

Enums§

CheckpointError
Why a checkpoint could not be assembled, decoded or verified.
MessagePartition
Which partition a StoredMessageState belongs to.
StoredMessageBody
A message body, inline or by reference (§7.10).

Constants§

CHECKPOINT_ERROR_MARKER
Prefix of every checkpoint-layer rejection, so all four hosts classify on one marker.