Detect the container
Import begins by detecting whether the input is canonical text `.eev`, compressed `.eevz`, or an already-issued `.eevc` / `.eevcz` file that must only be read. Compression does not create another dialect. It only transports canonical text inside a binary envelope.
Normalize toward the text parser
Once decompressed if necessary, every variant goes through the same text parser. This rule limits behaviour drift between transport forms and preserves a single logical core for application-level reading.
Build a clean internal model
The parser should produce an explicit model: library, entries, metadata, global, matrices, vectors, modes, peak tracks, and optional blocks. That internal model supports validation, display, and re-export. It should not collapse into a loose bag of raw lines.
Re-emit canonically
The writer must not improvise. It re-emits in a stable order, with current fields in the right places, without reproducing legacy ambiguities tolerated only during reading.