class

Smith::Checkpoints::Store

Inherits Reference < Object

Constructors

new(session_dir : String, enabled : Bool = true)
Source

Instance methods

blob_count
Source
blobs_dir

Blobs are shared across all checkpoints of a session, not stored per checkpoint — otherwise ten edits of one file would still keep ten copies, which is exactly what content addressing is meant to avoid.

Source
checkpoints_dir
Source
current_message_index

Set by the agent before each batch of tool calls. The registry has no business knowing about the transcript, so the position is handed in rather than looked up.

Source
current_message_index=(current_message_index : Int32)

Set by the agent before each batch of tool calls. The registry has no business knowing about the transcript, so the position is handed in rather than looked up.

Source
default_target

What a bare rewind acts on: the newest checkpoint, so one invocation undoes one step. Rewinding the whole session by accident is the expensive direction to get wrong, and --to <id> reaches further on purpose.

Source
enabled?
Source
list
Source
prune(max : Int32, retention : Time::Span) : Nil
Source
rewind_to(target : Entry, force : Bool = false, dry_run : Bool = false) : RestoreResult

Undoes target and everything after it.

Applied per file rather than per entry: the newest entry for a file describes the state smith left it in, which is what an external change is measured against, while the oldest holds the content to put back.

Source
seal(entry : Entry) : Nil

Called once the tool has run, so a later rewind can tell smith's own change apart from one made afterwards by someone else.

Not named finalize: that is Crystal's GC hook.

Source
session_dir
Source
snapshot(tool : String, args : JSON::Any) : Entry | Nil
Source