Versioning & Compatibility
Every ContextBrew file stamps the format version it was written against
("schemaVersion": "0.3.0"). Formats evolve — scm is at 0.3, c4 at 0.5 — so
sooner or later you will open a file that is older than the version your
ContextBrew knows. This page is the complete answer to what happens then.
The contract in one line
Section titled “The contract in one line”Read old. Write current. Show anything. Edit current.
One load path accepts every published version of a format, migrates older documents to the current shape for display, and remembers which version the file declared. One save path always writes the current version. Old files never become unreadable, and old versions are never silently rewritten.
What you will see in Context Studio
Section titled “What you will see in Context Studio”| The file you open… | Loading | Viewing | Editing | Saving |
|---|---|---|---|---|
| Older version (e.g. scm 0.1, current 0.3) | Opens normally — migrated for display | Rendered like any other model, with a note of the version it declares | Fully editable | Saved as the current version; the upgrade is visible, never silent |
| Current version | Opens normally | Rendered | Fully editable | Saved as current |
| Newer version (written by a future ContextBrew) | Opens best-effort — never disappears — and is flagged in the version timeline | Read-only — “upgrade ContextBrew to edit” | Blocked | Blocked (this is what prevents silent data loss: an older editor would drop fields it does not know) |
| Unknown or corrupt | Loud error with guidance | Error card | Blocked | Blocked |
The row that surprises people is the third: a newer file opens read-only rather than editable. That is deliberate. An editor that half-understands a format must not be allowed to save a file, because saving would drop every field it does not know — silent data loss. Showing is safe with any version; editing is only ever done in the current format.
One migration chain, not per-version forks
Section titled “One migration chain, not per-version forks”ContextBrew does not keep a separate load/save/edit implementation per published version. That design would multiply every editor and generator by the number of versions and they would drift apart. Instead, each format has:
- one canonical parser — it accepts every published input version and runs a chain of small, pure migrations, oldest → current;
- one serializer — always writes the current version;
- one creation path — new models are always stamped current.
The migration steps are field-filling and lossless wherever possible. Because format evolution is additive by convention (new fields are optional), most bumps need no migration code at all — an old document is already a valid current document. The accumulated migration code for all eleven model formats today is one function.
The original version a file declared is preserved as provenance: the app can always tell you “this file was authored as scm 0.1” even while displaying it in the current shape.
What is kept forever
Section titled “What is kept forever”- The schema artifacts. Every published version directory
(
schemas/<format>/v<major.minor>/) is permanent — served at its stable$idURL, never edited, never removed. A file written against v0.1 keeps validating against the v0.1 schema for as long as the site exists. - The conformance bundles.
schemas/conformance/<format>/<version>/ships a valid document and deterministic invalid mutations per version, so third-party tooling can be verified against any era of the format. - Your history. The version chain (recipe-server commits) stores full snapshots verbatim and is append-only. Old commits are never rewritten — opening a two-year-old version in the timeline shows the file exactly as it was, migrated for display by the same chain described above.
The server that stores versions is deliberately version-blind: it content-addresses blobs and never interprets them. All compatibility intelligence lives in the one place that parses the files — which is why it can be maintained as one pipeline instead of N forks.
Retiring ancient versions
Section titled “Retiring ancient versions”“Forever” applies to the published artifacts, not to runtime reader code. Once no reachable history contains v0.x files anymore, the reader support for that version can be retired in favor of an honest “this file is too old to open” state — the same lifecycle schema registries in the Avro/Protobuf world use. Retirement is announced, never sprung: files do not stop opening in a patch release you did not expect.
Breaking changes
Section titled “Breaking changes”Additive changes (new optional fields) ride a minor bump and old files keep working without any action. A genuinely breaking change — removing a field, changing a type, tightening a constraint — bumps the major version and adds a new schema directory alongside the old one. Opening such a file in Context Studio offers an explicit, one-time Upgrade action with a report of what will change; the original stays intact in history either way.
Until a format reaches 1.0, the convention is 0.minor.additive: minor
bumps are additive, the 0 signals that the format is still settling. From
1.0 on, the same policy is plain semver: minor = additive, major = breaking
with a migration.
Producing old-version files
Section titled “Producing old-version files”There is no downgrade. ContextBrew always saves the current version of every
format it writes, and old snapshots in your history are immutable. If a
specific consumer ever needs an older-era file, the honest answer is a
dedicated export tool with a --target-version flag — deliberately not
built until someone actually needs it.
For tool authors
Section titled “For tool authors”If you write your own reader for ContextBrew formats:
- Validate a file against the schema version it declares, not the
newest one — every version’s schema is permanently available at its
$idURL. - Accept the versions you know, loudly refuse the ones you do not. A future version you have never seen should produce a clear “written by a newer ContextBrew” error (or a read-only view), never a silent partial parse.
- Tolerate nothing extra. The schemas set
additionalProperties: false— machine-serialized files are strict, and unknown keys indicate writer drift, which you want to hear about.
See the overview for the per-format version table and validation snippets, and the per-format pages for each version’s reference.
