Part of #11
Summary
Create shared reader helpers in discovery/reader.rs that abstract the three storage backends used by agent traces: JSONL files, JSON files, and SQLite databases.
Storage Backends
| Backend |
Agents |
Format |
| JSONL |
Claude Code, Codex, Gemini CLI, Copilot |
One JSON object per line |
| JSON |
Cline, Amp, OpenClaw, Pi |
Single JSON file per session/task |
| SQLite |
Cursor (state.vscdb), Hermes (state.db), OpenCode (opencode.db) |
SQL queries on agent DBs |
API
/// Read a JSONL file, yielding parsed JSON values line by line.
pub fn read_jsonl(path: &Path) -> AgentResult<Vec<serde_json::Value>>;
/// Read a JSONL file incrementally from a byte offset (for cursor-based scanning).
pub fn read_jsonl_since(path: &Path, offset: u64) -> AgentResult<(Vec<serde_json::Value>, u64)>;
/// Read and parse a JSON file.
pub fn read_json(path: &Path) -> AgentResult<serde_json::Value>;
/// Open a read-only SQLite connection.
pub fn open_sqlite_readonly(path: &Path) -> AgentResult<rusqlite::Connection>;
New Dependency
rusqlite = { version = "0.31", features = ["bundled"] }
Acceptance Criteria
Estimated Effort
1-2 days
Part of #11
Summary
Create shared reader helpers in
discovery/reader.rsthat abstract the three storage backends used by agent traces: JSONL files, JSON files, and SQLite databases.Storage Backends
state.vscdb), Hermes (state.db), OpenCode (opencode.db)API
New Dependency
Acceptance Criteria
Estimated Effort
1-2 days