ADR-0034 — One version of each file format is read; old files are converted once¶
Status: Accepted by the operator on 2026-12-03 ("yes", to "rewrite the old files once, in the new way; after that, the software only ever knows one way") Date: 2026-12-03 Context documents: ADR-0023 decision 8 (every stored profile is migrated, not read in two shapes), ADR-0007 (run format 1 is not read; the old runs were imported again)
Context¶
RFC-0034 step 1 (891a555) changed the layout of a profile's error budget and raised
profile_version to 2. It left the files already saved in version 1 as they were and taught every
reader to convert version 1 on the way in (runfile.profile.upgrade, MIGRATIONS). That put two
layouts in the code for good, and its follow-ups kept growing: which layout a save writes, a diff
of a version-1 file against its own conversion, readers that skipped the conversion. It also went
against ADR-0023 decision 8, which had already said a profile is not read in two shapes.
An audit of every file the platform writes (2026-12-03) found one other format with more than one version: Mission Control's database, which converts itself when it opens and so already keeps one version. Every other format has only ever had one.
Decision¶
- A reader reads one version of a format: the current one. Any other version is refused, with a message that names the version it reads.
- When a format's shape changes, the change that raises its version also converts every existing file, in the repository and in the stores on the machines it runs on, in one step. No conversion code stays behind in the readers.
- Adding an optional field needs no new version. Renaming or removing a field, or changing what a field holds, does.
- A recorded run is never rewritten. It records what happened. When a run format changes, the old runs are imported again into the new format (ADR-0007); a profile a run carries is read as the run recorded it.
- A database converts itself when it opens (Mission Control's
store.py,PRAGMA user_version). That is the same rule: after opening, one version exists.
For the profile, today: version 2 was the only version read. The one version-1 file in the
repository (robots/nxt-shooterbot/profile.json) and the test fixtures were converted (none had an
error budget, so the number alone changed); the profile store on this machine was empty.
upgrade, MIGRATIONS and the version-1 tests are removed.
Version 3 (2026-12-03) renamed the judge block to evaluator, by the same rule: the two
profiles in the repository and the test fixtures were converted in that change, and the profile
store on this machine was empty again.
Consequences¶
- Positive: one layout per format in the code; a save writes the only layout there is; no reader can forget a conversion.
- Negative: converting a file changes its checksum. A run that recorded the old checksum can still say which file it used, but no longer prove the file is byte for byte what it ran with. The Observatory then falls back to the profile file as it is now and says so.
- Negative: a machine with stored files in the old version must convert them when it updates; until then its reader refuses them, naming the version it reads.
- Neutral: a run's embedded profile is not validated by the replay (
duck_lab.replay), so old runs still replay; if a future change makes the replay read a changed field, that change says how old runs are read.
Alternatives considered¶
- Read every old version for good, converting on the way in (built in 891a555, removed here): keeps old files' checksums, at the cost of two layouts in every reader and every save.
- Convert on save only: an old file stays old until someone saves it, so the readers still need both layouts.