Expand description
Unified per-session state store for VT Code.
This crate is the single source of truth for an agent session’s state,
context, and history. Each session is persisted under
.vtcode/sessions/<session_id>/ as:
events.jsonl— the canonical append-onlyThreadEventlog (schema-versioned). Everything else is derived from this.manifest.json— session metadata and counters.index/turns.json— byte-offset index enabling O(1) turn reconstruction.derived/— regenerated views (trajectory.jsonl,memory.json, …).
The store is intentionally append-only and off the agent’s hot path: the live conversation stays in memory and is never reloaded from disk into context. Reads happen only for revert, compaction, analytics, and long-term-learning queries.
Re-exports§
pub use error::SessionStoreError;pub use event_log::SessionEventLog;pub use event_log::SessionManifest;pub use event_log::TurnIndex;pub use event_log::TurnIndexEntry;pub use migration::MigrationReport;pub use migration::migrate_legacy;pub use progress::Milestone;pub use progress::MilestoneStatus;pub use progress::ProgressLedger;pub use progress::load_progress;pub use progress::progress_path;pub use progress::save_progress;pub use query::FactRecord;pub use query::SessionSummary;pub use query::query_facts;pub use query::recent_sessions;pub use retention::RetentionPolicy;pub use retention::apply_retention;pub use retention::gc_legacy;
Modules§
- error
- Error type for the session store.
- event_
log - Append-only per-session
ThreadEventlog plus index and manifest. - migration
- One-off migration of the legacy, overlapping history stores into the unified per-session store.
- progress
- Durable, compaction-safe progress ledger.
- query
- Read-only queries across sessions for analytics and long-term learning.
- retention
- Retention and garbage-collection for the unified session store.
Constants§
- DERIVED_
DIR - Sub-directory inside a session holding regenerated views.
- SESSIONS_
DIR - Directory (relative to the workspace) holding all per-session stores.
- SESSION_
STORE_ SCHEMA_ VERSION - Schema version for the on-disk session store layout.
Functions§
- open
- Open (creating if necessary) the event log for a session.
- session_
dir - Resolve the directory for a single session.
- sessions_
root - Resolve the sessions root directory for a workspace.