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