Expand description
SQLite-backed state for rollout metadata.
This crate is intentionally small and focused: it extracts rollout metadata
from JSONL rollouts and mirrors it into a local SQLite database. Backfill
orchestration and rollout scanning live in codex-core.
Modules§
- log_db
- Tracing log export into the local SQLite log database.
Structs§
- Anchor
- A pagination anchor used for keyset pagination.
- Backfill
State - Persisted lifecycle state for rollout metadata backfill.
- Backfill
Stats - Statistics about a backfill operation.
- External
Agent Config Import Details Record - External
Agent Config Import Failure Record - External
Agent Config Import History Record - External
Agent Config Import Success Record - Extraction
Outcome - The outcome of extracting metadata from a rollout.
- Goal
Store - Goal
Update - LogEntry
- LogQuery
- LogRow
- Memory
Store - Store for generated memory state and memory extraction/consolidation jobs.
- Remote
Control Enrollment Record - Persisted remote-control server enrollment, including the lookup key.
- Runtime
DbBackup - Runtime
DbPath - Sqlite
Config - Resolved configuration shared by all Codex SQLite connections.
- Stage1
JobClaim - Claimed stage-1 job with thread metadata.
- Stage1
Output - Stored stage-1 memory extraction output for a single thread.
- Stage1
Startup Claim Params - State
Runtime - Preferred entrypoint: owns configuration and metrics.
- Thread
Filter Options - Thread
Goal - Thread
Metadata - Canonical persisted thread metadata.
- Thread
Metadata Builder - Builder data required to construct
ThreadMetadatawithout parsing filenames. - Thread
State Audit Row - Minimal thread metadata used by read-only state database audits.
- Threads
Page - A single page of thread metadata results.
Enums§
- Backfill
Status - Backfill lifecycle status.
- Directional
Thread Spawn Edge Status - Status attached to a directional thread-spawn edge.
- Goal
Accounting Mode - Goal
Accounting Outcome - Phase2
JobClaim Outcome - Result of trying to claim a phase-2 consolidation job.
- Sort
Direction - Sort direction to use when listing threads.
- SortKey
- The sort key to use when listing threads.
- Stage1
JobClaim Outcome - Result of trying to claim a stage-1 memory extraction job.
- Thread
Goal Status - Thread
Relation Filter - Spawn-graph relationship used to filter thread listings.
Constants§
- DB_
ERROR_ METRIC - Errors encountered during DB operations. Tags: [stage]
- DB_
FALLBACK_ METRIC - Rollout fallback attempts. Tags: [caller, reason]
- DB_
INIT_ DURATION_ METRIC - SQLite initialization latency. Tags: [status, phase, db, error]
- DB_
INIT_ METRIC - SQLite initialization attempts. Tags: [status, phase, db, error]
- DB_
METRIC_ BACKFILL - Metrics on backfill process. Tags: [status]
- DB_
METRIC_ BACKFILL_ DURATION_ MS - Metrics on backfill duration. Tags: [status]
- GOALS_
DB_ FILENAME - LOGS_
DB_ FILENAME - MEMORIES_
DB_ FILENAME - SQLITE_
HOME_ ENV - Environment variable for overriding the SQLite state database home directory.
- STATE_
DB_ FILENAME - THREAD_
HISTORY_ DB_ FILENAME
Traits§
- DbTelemetry
- Low-cardinality sink for SQLite startup and fallback telemetry.
Functions§
- apply_
rollout_ item - Low-level storage engine: useful for focused tests.
- backup_
runtime_ db_ for_ fresh_ start - Move one Codex runtime SQLite database out of the way so that database can be recreated without discarding unrelated runtime databases.
- goals_
db_ filename - goals_
db_ path - install_
process_ db_ telemetry - Install the process-wide SQLite telemetry sink.
- is_
sqlite_ corruption_ error - logs_
db_ filename - logs_
db_ path - memories_
db_ filename - memories_
db_ path - open_
thread_ history_ db - Open and migrate the rebuildable paginated thread-history database.
- read_
thread_ state_ audit_ rows - Read persisted thread rows from a state DB without creating, migrating, or repairing it.
- record_
backfill_ gate - record_
fallback - rollout_
item_ affects_ thread_ metadata - Return whether this rollout item can mutate thread metadata stored in SQLite.
- runtime_
db_ path_ for_ corruption_ error - runtime_
db_ paths - sqlite_
error_ detail_ is_ corruption - sqlite_
error_ detail_ is_ lock - sqlite_
integrity_ check - Run SQLite’s built-in integrity check against an existing database file.
- state_
db_ filename - state_
db_ path - thread_
history_ db_ filename - thread_
history_ db_ path