Accepted (2026-05-12, addressing Sprint 5-5 / A9)
Addendum 2026-05-17: Sprint 5-7 / Phase 2-1 added
workspace_name, bumpingSNAPSHOT_VERSIONto v3. v3 auto-migrates both v1 and v2. Read "v2 is the standard schema" below as "v3 is the standard schema". The plan to raiseSNAPSHOT_VERSION_MINto2at the v2.0.0 release is unchanged (v2 stays absorbed; only v1 is dropped).
The session-persistence snapshot in nexterm-server currently supports two schema versions in parallel: v1 and v2.
// nexterm-server/src/snapshot.rs (as of 2026-05-17)
pub const SNAPSHOT_VERSION: u32 = 3;
pub const SNAPSHOT_VERSION_MIN: u32 = 1;- v1: the initial schema (
shell_argswas added later and kept compatible via#[serde(default)]). - v2: added the
session_titlefield. From Sprint 5-1 onwards,persist::load_snapshotauto-migrates v1 to v2. - v3: Sprint 5-7 / Phase 2-1 added
workspace_name. Both v1 and v2 are auto-upgraded to v3 at load time.
The audit flagged that "the removal timing of Snapshot v1 must be made explicit" (the planned raise of snapshot.rs:34's SNAPSHOT_VERSION_MIN = 1 to 2 at v2.0 was undocumented).
This ADR finalises the policy, mirroring ADR-0003 (Plugin API v2 removal).
- v2 is the standard schema. All newly saved snapshots are written as v2 (already implemented).
- Loading v1 snapshots will be removed at the v2.0.0 release.
- Loading a v1 snapshot logs a migration warning. (Existing behaviour is preserved.)
SNAPSHOT_VERSION_MINwill be raised to 2 at the v2.0.0 release.- Migration steps for users holding v1 snapshots:
- Start the server at least once while still on a v1.x release; the snapshot is automatically rewritten as v2.
- Upgrading directly to v2.0.0 without that intermediate step makes v1 snapshots unloadable. Call this out in the CHANGELOG.
- v2.0.0 is the major-version bump where we conventionally collect breaking changes (matches ADR-0003).
- The design auto-migrates during the v1.x line, so users do not need to do anything.
- Removing the v1 fallback branch in
persist.rsimproves maintainability.
- The removal date is explicit (v2.0.0), so users can plan their upgrade.
- The v1 migration code in
persist::load_snapshotcan be removed at v2.0.0. - Bumping
SNAPSHOT_VERSION_MINmakes the security-relevant compatibility boundary explicit.
- We must maintain the migration code until v2.0.0 (small incremental cost, since the code already exists).
- A user who skips the last v1.x release entirely and jumps straight to v2.0.0 loses their session — communicate this in the CHANGELOG / README.
- Alternative A: support v1 indefinitely — migration-branch code lingers forever, and
SNAPSHOT_VERSION_MINloses meaning. - Alternative B: drop v1 immediately — disruptive for users that already hold v1 snapshots, especially those keeping long-lived sessions.
- Alternative C: auto-backup + drop v1 — implementation cost is high. The existing v1→v2 auto-migration already provides equivalent protection.
SNAPSHOT_VERSION/SNAPSHOT_VERSION_MINdefinitions innexterm-server/src/snapshot.rs- Migration logic in
nexterm-server/src/persist.rs(load_snapshot) - ADR-0003: Plugin API v1 → v2 removal timing (same policy)
- Audit round 2, item A9