Repository Public
1<!--2ORIX Sonata3File: Documentation/manual/migration.md4Author: Simon-Pierre Boucher5Contact: contact@spboucher.ai6-->7# Versions and migration89## Three version numbers1011| What | Current | Meaning |12|---|---|---|13| Language | 0.1 | what a source file means |14| IR schema | 1 | the shape of the JSON printed by `sonata build` |15| Toolchain | 0.1.0 | a particular build: `sonata version` |1617They change independently.1819## The version line2021A file may begin with the language version it was written for:2223```sonata24sonata 0.12526composition "Versioned" {27 instrument piano: GrandPiano {28 play C429 }30}31```3233The line is optional. Without it, a file is read as the language of the tool that compiles34it. A file that asks for a *newer* language than the tool knows is refused (I7004): the35compiler never guesses at syntax it does not understand. The formatter keeps the line as you36wrote it and never adds one.3738## What may change3940Until version 1.0:4142* A **patch** release (0.1.x) does not change the meaning of a program that compiles, and43 does not make a valid program invalid — except to fix a compiler bug that contradicted the44 specification; such fixes are listed in the change log.45* A **minor** release (0.2) may change syntax or meaning. Each such change will come with an46 entry in the compatibility page, a diagnostic that explains the old form and, where a47 mechanical rewrite exists, an automatic migration.4849There is nothing to migrate in 0.1: it is the first version.5051"Meaning" is the compiled music: the same source and the same seed give the same notes, times,52automation and routing. The *sound* of an instrument or effect belongs to the engines; a53change to the sound of a preset is announced in the change log as a behaviour change.5455## Things that can grow without a new language version5657* The standard library can gain names. A definition in your project with the same name always58 takes precedence, so a new standard name cannot break your project.59* Engines, effects, parameters with a default, and presets can be added.6061## Projects6263A `.sonataproject` records the version of its own format. The app opens older formats and64updates them when you save; it refuses, with a clear message, a project written by a newer65version of the app, instead of risking your data. Backups of your sources are kept outside66the project ([Modules and projects](modules-and-projects.md#projects)).6768## Stable interfaces6970* The command line's exit codes and the fields of its `--json` output.71* The diagnostic codes: a code keeps its meaning; new codes can be added.72* The `// expect:` comments understood by `sonata test`.7374The full policy is `Documentation/spec/compatibility.md`.75