Skip to main content

Crate codex_rollout

Crate codex_rollout 

Source
Expand description

Rollout persistence and discovery for Codex session files.

Re-exports§

pub use state_db::StateDbHandle;
pub use state_db::sqlite_telemetry_recorder;

Modules§

state_db

Structs§

Cursor
Pagination cursor identifying the last item in a page.
ModelContextScan
Accumulates newest-to-oldest rollout items until they are sufficient to reconstruct the latest model context.
ReverseJsonlScanner
Read-only scanner for newline-delimited JSON records, starting from the end.
RolloutConfig
RolloutLineReader
Line-oriented rollout reader returned by open_rollout_line_reader.
RolloutPersistenceBatchMeasurement
RolloutPersistenceTelemetry
RolloutRecorder
Writes canonical session rollout items to JSONL.
RolloutReferenceIndex
Direct history-base edges discovered from local rollout metadata.
SessionMeta
SessionMeta contains session-level data that doesn’t correspond to a specific turn.
ThreadItem
Summary information for a thread rollout file.
ThreadListConfig
ThreadsPage
Returned page of thread (thread) summaries.

Enums§

ModelContextScanProgress
Whether a reverse model-context scan needs more rollout items.
RolloutRecorderParams
ScanOutcome
SortDirection
ThreadListLayout
ThreadSortKey

Constants§

ARCHIVED_SESSIONS_SUBDIR
SESSIONS_SUBDIR

Statics§

INTERACTIVE_SESSION_SOURCES

Traits§

RolloutConfigView

Functions§

append_rollout_item_to_path
Append one already-filtered rollout item to an existing rollout JSONL file.
append_thread_name
Append a thread name update to the session index. Name updates are append-only; the most recent entry wins when resolving names or ids.
builder_from_items
existing_rollout_path
Returns the existing rollout path, preferring the plain .jsonl file over its .jsonl.zst compressed sibling.
find_archived_thread_path_by_id_str
Locate an archived thread rollout file by its UUID string.
find_conversation_path_by_id_str
Locate a recorded thread rollout file by its UUID string using the existing paginated listing implementation. Returns Ok(Some(path)) if found, Ok(None) if not present or the id is invalid.
find_thread_meta_by_name_str
Locate a recorded thread rollout and read its session metadata by thread name. Returns the newest indexed name that still has a readable rollout header.
find_thread_name_by_id
Find the latest thread name for a thread id, if any.
find_thread_names_by_ids
Find the latest thread names for a batch of thread ids.
find_thread_path_by_id_str
Locate a recorded thread rollout file by its UUID string using the existing paginated listing implementation. Returns Ok(Some(path)) if found, Ok(None) if not present or the id is invalid.
first_rollout_content_match_snippet
get_threads
Retrieve recorded thread file paths with token pagination. The returned next_cursor can be supplied on the next call to resume after the last returned item, resilient to concurrent new sessions being appended. Ordering is stable by the requested sort key (timestamp desc).
get_threads_in_root
is_persisted_rollout_item
Whether a rollout item should be persisted in rollout files.
measure_and_filter_rollout_items
Measures logical JSON sizes while applying the shared rollout persistence policy once.
open_rollout_line_reader
Opens a rollout line reader that transparently handles plain .jsonl and .jsonl.zst files.
parse_cursor
Pagination cursor token format: an RFC3339 timestamp with an optional thread ID tie-breaker.
persisted_rollout_items
Return the rollout items that should be persisted for a live append.
plain_rollout_path
Returns the plain .jsonl path for a plain or compressed rollout path.
read_head_for_summary
Read up to HEAD_RECORD_LIMIT records from the start of the rollout file at path. This should be enough to produce a summary including the session meta line.
read_session_meta_line
Read the SessionMetaLine from the head of a rollout file for reuse by callers that need the session metadata (e.g. to derive a cwd for config).
read_thread_item_from_rollout
Read a single rollout file into the same summary item shape used by thread listing.
remove_thread_name_entries
Remove all recorded names for a thread from the session index.
rollout_date_parts
Extract the YYYY/MM/DD directory components from a rollout filename.
search_rollout_matches
search_rollout_paths
should_persist_response_item_for_memories
Whether a ResponseItem should be persisted for the memories.
spawn_rollout_compression_worker
Starts a best-effort background job that compresses cold local rollout files.

Type Aliases§

Config