pub enum JournalOp {
Message {
message: Box<NativeTurn>,
},
Rewind {
to: usize,
},
Unrewind,
Enqueue {
queue: QueueKind,
text: String,
},
Dequeue {
queue: QueueKind,
count: usize,
},
Plan {
steps: Vec<PlanEntry>,
},
Rename {
from: String,
to: String,
},
Checkpoint {
messages: usize,
},
ModelChange {
record: ModelChangeRecord,
},
Usage {
record: UsageRecord,
},
Upgrade {
from_version: u32,
to_version: u32,
original: String,
},
}Expand description
What a journal line records.
Variants§
Message
One conversation message, appended the moment the agent produced it — the append-only half of “every event flushed to disk during the session”.
Fields
message: Box<NativeTurn>The message, in the same full-fidelity wire shape the native-v2
sidecar uses (metadata included — see NativeTurn).
Rewind
The conversation was rewound to to messages. Nothing is deleted:
replay_str moves the removed tail onto an undo stack that
JournalOp::Unrewind pops.
Unrewind
The inverse of the most recent JournalOp::Rewind: the removed
tail comes back.
Enqueue
A pending user input was queued.
Dequeue
count pending inputs were consumed from queue (drained into the
conversation), oldest first.
Plan
The session’s plan was replaced wholesale (update_plan replaces,
it does not merge).
Rename
The session’s resume handle changed.
Checkpoint
The durable view is caught up: <name>.jsonl now holds messages
messages, and every record above this line is already in it. What
follows is exactly what a crash would lose — see
JournalState::unpersisted.
Fields
ModelChange
BP-13 (catalog Domain 9): the model this session sends to CHANGED
mid-session — a user /model switch or a fallback hop the loop
performed after a failure. The append-only journal is where every
persisted routing record lives; there is no second file.
Fields
record: ModelChangeRecordThe typed record, exactly as Agent::model_change_records
carries it in memory.
Usage
BP-13: one completed model round-trip’s usage accounting, carrying the model REQUESTED and (when the provider reported one) the model that actually SERVED it.
Fields
record: UsageRecordThe typed record, exactly as Agent::usage_records carries it.
Upgrade
An on-disk file of an older generation was upgraded in place.