File format spec
§16
Versioning, migration and forward compatibility
On this page4 sections
Status
Stable (format version
1.0.0, frozen 2026-10). Backward compatible within 1.x (§16.4). Supersedes the draft v0.1, kept as a historical record; 0.1 files open through the 0.1 → 1.0 migration (§16.2).Schema
https://getkimo.design/schema/kimo-1.0.json (JSON Schema draft 2020-12), generated into packages/core-schema/schema/kimo-1.0.schema.json . The 0.1 schema stays published at …/kimo-0.1.json (schema/kimo-0.1.schema.json, frozen).Reference
@kimo/core-schema (packages/core-schema). Where this document and the implementation disagree, that is a bug in one of them; file an issue.Plan of record
docs/teardown.md §10. Every place where this spec resolves an ambiguity in, or deviates from, that section is listed in §20.License
MIT
16.1 Version numbers
format is major.minor.patch. Major and minor identify the format; a patch release is editorial and never changes what a document may contain (a 1.0 reader treats 1.0.7 as current). A minor release may add optional fields, node types, paint kinds and features. A major release may change or remove anything. Within 1.x every minor release is backward compatible (§16.4); the 0.x line, which allowed breaking minors, ended with 0.1. Defaults MUST NOT change within a major version.
Keywords:
MUST
MUST NOT
SHOULD
MAY
set in small mono caps wherever they are normative
16.2 Migrations
- A migration is a pure function from one format line (
major.minor) to the next, registered in@kimo/core-schema(MIGRATIONS, e.g.migrations/1.0→1.1), tested with fixtures. The 1.0 registry holds one step,0.1 → 1.0: format 1.0 is format 0.1 declared stable, so every 0.1 document is a valid 1.0 document and the step is the identity; only theformatand$schemaheader lines change (fixturesfixtures/migrations/). A file with any0.1.xformat therefore opens migrated in memory behind the upgrade prompt below. - Readers open an older file migrated in memory. Autosave of a migrated file goes to a recovery file (
~/.kimo/recovery/<hash>), never to the working file, until the user accepts a one-time "Upgrade file format" prompt or saves explicitly. The upgrade then changes theformatand$schemaheader lines, plus whatever the migration itself must rewrite. - Migrations MUST preserve every property they do not understand.
- A file with no migration path to the reader's version opens read-only.
16.3 Forward compatibility
- A file whose
formatmajor or minor is newer than the reader's, or whosefeaturesinclude one the reader does not support, opens read-only: saves are refused with a "newer Kimo needed" message. A validator does not validate a newer document beyond its version (FORMAT_NEWER). - Readers MUST preserve unknown properties, unknown root members, unknown node fields and unknown node types on round-trip.
- Conformance test (in
@kimo/core-schema): a newer file is byte-identical after open and re-serialization, and an edit to one node changes only that node's line. - A store that failed to load is read-only and cannot be saved. Editors SHOULD also open documents with validation errors read-only unless the user chooses to repair them.
16.4 Rules for future versions
- Appendix A is frozen for the 0.x and 1.x lines: keys introduced by later versions are never ranked, so they sort after all ranked keys by code unit, and everything below them is ordered purely by code unit (§15.2). This is what lets an older reader re-serialize a newer document byte-identically. At the root this holds for every new member (§15.1 rule 2). Below the root, ranking is by name, so later versions MUST NOT introduce a property whose name is already in Appendix A on an object that does not define it in 1.0; they pick an unranked name instead.
- New record-valued properties are opaque to older readers, so their subtrees are ordered purely by code unit in every version.
- New semantics MUST be introduced through new properties, node types, paint kinds or feature flags, never by changing the meaning or default of an existing property within a major version.