class

Smith::TranscriptLog

Inherits Reference < Object

The transcript as it actually was, before compaction shortened it.

Compaction rewrites the message array in place and the session file holds only that working history, so shortening a session is otherwise the same as destroying the record of it — dropped thinking, stubbed results and summarized-away turns are not recoverable from anything smith keeps.

It is also the only basis on which anyone can later check whether the compaction thresholds were good numbers. Without it, the next calibration is guesswork again.

Append-only, one JSON message per line, never read on the normal path. A log that cannot be written is reported once and then given up on: a record of the session must not be able to take the session down with it.

Constructors

new(session_dir : String, warn_io : IO = STDERR)
Source

Instance methods

append(messages : Array(LLM::Message)) : Nil
Source
exists?
Source
failed?
Source
messages

Only for reporting and tests — nothing on the normal path reads the log.

Source
path
Source
seed(messages : Array(LLM::Message)) : Nil

Writes the history a session already had. Used once, for a session recorded before this log existed: that is the longest transcript the user has, and otherwise the only one that never gets a raw copy.

Source