perspt-store¶
DuckDB-backed session and ledger persistence.
Important
Perspt uses DuckDB, not SQLite, for its session store.
Core Type¶
pub struct SessionStore {
conn: Mutex<Connection>, // duckdb::Connection
}
impl SessionStore {
pub fn new() -> Result<Self>; // Default path
pub fn open(path: &Path) -> Result<Self>; // Custom path
pub fn open_read_only(path: &Path) -> Result<Self>; // Read-only mode
pub fn default_db_path() -> PathBuf; // ~/.local/share/perspt/
}
Note
open_read_only uses DuckDB’s AccessMode::ReadOnly and does not
call init_schema(). This makes it safe for concurrent dashboard reads
alongside the agent’s write lock. The database file must already exist.
Record Types¶
Type |
Description |
|---|---|
|
session_id, task, working_dir, merkle_root, detected_toolchain, status |
|
Per-node snapshot (id, state, energy, class, plugin, goal) |
|
v_syn, v_str, v_log, v_boot, v_sheaf, v_total per node |
|
model, prompt, response, tokens_in/out, latency_ms |
|
Content hash for interface seals |
|
What context each node received |
|
Classified escalation with energy and evidence |
|
Graph rewrite audit trail |
|
Cross-node validation results |
|
Branch lifecycle tracking |
|
Parent-child branch relationships |
|
Sealed interface records |
|
Flush cascade records |
|
DAG edges between nodes |
|
Human review decisions |
|
Full verification snapshots |
|
Stored artifact bundles per node |
DuckDB Tables¶
The schema is initialized by init_schema() and includes 17+ tables matching
the record types above.