What happened?
~/.spawn/history.json is read and written directly with no schema version field. The SpawnRecord and VMConnection shapes are validated on read via type guards (validateConnectionIP, validateLaunchCmd, etc.), but there is no version marker and no migration path.
Why this is a problem
When a new version of spawn adds, removes, or renames fields on SpawnRecord / VMConnection, users who upgrade with an existing history file will hit one of:
- Silent data loss — old fields are dropped, new required fields are
undefined, and the record is treated as valid but incomplete
- Silent corruption — a new field repurposes an old key name with a different type/meaning
- Confusing errors — the type guards reject old records and history appears empty, with no explanation
There is no "your history format is from an older version, migrating…" path. Users who have accumulated many sessions over time (SSH keys, server IDs, agent preferences) could silently lose that data on upgrade.
Suggested fix
- Add a
version field to the top-level history file structure (e.g., { "version": 1, "records": [...] })
- On read, check the version and run any necessary migrations before passing records to the rest of the app
- Before writing, stamp the current schema version
A minimal v1 migration would just be: "if no version field → this is v0 → apply v0→v1 transform". Keeps it simple while creating the escape hatch for future changes.
Filed from Slack by Ori
What happened?
~/.spawn/history.jsonis read and written directly with no schema version field. TheSpawnRecordandVMConnectionshapes are validated on read via type guards (validateConnectionIP,validateLaunchCmd, etc.), but there is no version marker and no migration path.Why this is a problem
When a new version of spawn adds, removes, or renames fields on
SpawnRecord/VMConnection, users who upgrade with an existing history file will hit one of:undefined, and the record is treated as valid but incompleteThere is no "your history format is from an older version, migrating…" path. Users who have accumulated many sessions over time (SSH keys, server IDs, agent preferences) could silently lose that data on upgrade.
Suggested fix
versionfield to the top-level history file structure (e.g.,{ "version": 1, "records": [...] })A minimal v1 migration would just be: "if no version field → this is v0 → apply v0→v1 transform". Keeps it simple while creating the escape hatch for future changes.
Filed from Slack by Ori