Documentation
¶
Overview ¶
Package checkpoint persists Ralph loop state between runs so a halted loop can be resumed with `ralph resume <file>`.
The format is intentionally simple JSON; older checkpoints written by future Ralph versions remain readable as long as new fields are added (never renamed or repurposed).
Index ¶
Constants ¶
View Source
const CurrentVersion = 1
CurrentVersion is the schema version written into every checkpoint.
Variables ¶
View Source
var ErrUnsupportedVersion = errors.New("unsupported checkpoint version")
ErrUnsupportedVersion is returned when Load encounters a checkpoint with a version Ralph does not understand.
Functions ¶
Types ¶
type State ¶
type State struct {
Version int `json:"version"`
SavedAt time.Time `json:"saved_at"`
Prompt string `json:"prompt"`
Model string `json:"model"`
WorkingDir string `json:"working_dir"`
PromisePhrase string `json:"promise_phrase,omitempty"`
Iteration int `json:"iteration"`
MaxIterations int `json:"max_iterations"`
LastSummary string `json:"last_summary,omitempty"`
ConsecutiveErrors int `json:"consecutive_errors,omitempty"`
ConsecNoChanges int `json:"consecutive_no_changes,omitempty"`
}
State is the serialised loop state.
Click to show internal directories.
Click to hide internal directories.