Skip to main content

Module persist

Module persist 

Source
Expand description

Session persistence (JSON + SQLite backends).

Modules§

compaction_artifact_store
SQLite persistence for compaction artifacts (kernel-v2 Phase 2-C).
context_reference
Durable context-reference metadata (session resume, HTTP runtime).
kernel_event_log
Append-only SQLite log for KernelEvent records — Phase 3a double-write.
kernel_event_writer
Background drain for KernelEvent double-write (Phase 3b batch 2).
session_manager
Session management for resuming conversations.
session_store_sqlite

Structs§

ContextReference
Durable, compact metadata for a user-visible context reference.
KernelEventLog
Append-only writer for the kernel_events table.
KernelEventWriter
Owns the channel sender, shared DB handle, and the background drain task handle.
SavedSession
A saved session containing full conversation history
SessionContextReference
Durable context-reference metadata attached to a user message.
SessionManager
Manager for session persistence operations
SessionMetadata
Session metadata stored with each saved session

Enums§

ContextReferenceKind
ContextReferenceSource

Functions§

delete_compaction_artifacts_for_session
Delete all artifacts for session_id (call when deleting a session).
delete_session_sqlite
ensure_compaction_artifacts_table
Ensures the compaction_artifacts table exists in db.
ensure_kernel_events_table
Ensure the kernel_events table and index exist. Safe to call on every startup — uses CREATE … IF NOT EXISTS.
list_sessions_sqlite
load_compaction_artifacts
Load all artifacts for session_id, ordered oldest → newest.
load_session_sqlite
open_sqlite_session_db
Opens (or creates) the SQLite DB at db_path. If JSON files exist in sessions_dir and the DB is empty, auto-migrates.
prune_workspace_snapshots
Prune snapshots older than max_age for workspace.
save_compaction_artifact
Persist one CompactionArtifact to db.
save_session_sqlite