Skip to content

Commit 48c4b1a

Browse files
author
Yogthos
committed
phase 1: SQLite session database with FTS5
Port of Hermes's hermes_state.py. Persists session transcripts in .dirge/sessions/state.db with the same schema: sessions table + messages table + messages_fts FTS5 virtual table with content sync triggers. Features: - SessionDb::open() with WAL mode + DELETE fallback for NFS/SMB - Schema versioning with forward migrations (v1 baseline) - insert_session / insert_message with message count tracking - search_messages with FTS5 full-text search + optional role filter - list_sessions_rich with source exclusion (review-fork, etc.) - set_parent_session for compression-driven session splitting - resolve_parent for walking lineage chain to root - get_anchored_view for ±N message windows around an anchor 9 tests: CRUD, FTS5 search, role filter, source exclusion, session splitting, parent resolution, anchored message windows. Added rusqlite with bundled SQLite feature.
1 parent 723b059 commit 48c4b1a

4 files changed

Lines changed: 659 additions & 0 deletions

File tree

Cargo.lock

Lines changed: 53 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ html2text = "0.17"
121121
indexmap = "2"
122122
lsp-types = { version = "0.97", optional = true }
123123
tree-sitter-elixir = { version = "0.3.5", optional = true }
124+
rusqlite = { version = "0.31", features = ["bundled"] }
124125

125126
[dev-dependencies]
126127
tokio = { version = "1", features = ["test-util"] }

src/extras/mod.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,3 +12,4 @@ pub mod acp;
1212

1313
pub mod dirge_paths;
1414
pub mod memory;
15+
pub mod session_db;

0 commit comments

Comments
 (0)