vtcode_core/cli/args/session_store.rs
1use std::path::PathBuf;
2
3/// Subcommands for the unified per-session state store.
4#[derive(Debug, Clone, clap::Subcommand)]
5pub enum SessionStoreCommand {
6 /// Migrate legacy `history/` and `logs/` stores into the unified
7 /// per-session store. Pass `--remove-legacy` to delete the originals
8 /// afterwards.
9 Migrate {
10 /// Delete the now-imported `history/` and `logs/` directories.
11 #[arg(long)]
12 remove_legacy: bool,
13 },
14 /// Apply retention policy, evicting the oldest/stale sessions.
15 Gc {
16 /// Maximum number of sessions to keep.
17 #[arg(long, default_value_t = 50)]
18 max_sessions: usize,
19 /// Maximum session age in days.
20 #[arg(long, default_value_t = 30)]
21 max_age_days: u64,
22 },
23 /// List recent sessions.
24 List {
25 /// Number of sessions to show.
26 #[arg(long, default_value_t = 20)]
27 limit: usize,
28 },
29 /// Print a session's manifest.
30 Inspect {
31 /// Session id (directory name under `.vtcode/sessions/`).
32 session: String,
33 },
34 /// Query grounded facts across all sessions (long-term learning).
35 Facts {
36 /// Maximum number of facts to return.
37 #[arg(long, default_value_t = 100)]
38 limit: usize,
39 },
40 /// Create or verify a digest-verified audit pack for a session.
41 ///
42 /// A pack is a SHA-256 manifest of every file in the session store
43 /// (`events.jsonl`, manifest, index, derived views) that a reviewer can
44 /// re-verify to prove the artifacts are unmodified.
45 Pack {
46 /// Session id (directory name under `.vtcode/sessions/`).
47 session: String,
48 /// Write the audit pack here (default: `<session>/derived/audit-pack.json`).
49 #[arg(long, value_name = "FILE")]
50 output: Option<PathBuf>,
51 /// Verify an existing audit pack against the current session contents
52 /// instead of creating a new one.
53 #[arg(long, value_name = "FILE", conflicts_with = "output")]
54 verify: Option<PathBuf>,
55 },
56}