Files
ARCADIA-Studio/crates/oa-core/src/migration_v2

Frozen version 2 reader

model.rs, validation.rs, state_validation.rs, references.rs, the drift comparison in transitions.rs, and the typed declaration reader in source.rs were captured from commit c20a207 before the writable model changed to schema 3. The modules are private; they are not another authoring model.

Imports point at the frozen modules, and the unused demo factory is excluded. The declaration reader shares lexical/AST mechanics with the current language, but constructs and validates the frozen DTO, preserves located old-contract errors, then calls adapter.rs. Original staged scenario/state defaults and generic port/optional FE endpoint contracts therefore remain explicit.

adapter.rs budgets generated data, validates V2 and transforms only the changed port/endpoint payloads into an explicit schema 3 candidate. The schema 3 reader then performs the data-contract upgrade and validates schema 4. Serialization between compatibility DTOs copies unchanged fields; original input bytes are never deserialized into the new Project. V1 normalization also constructs this V2 DTO before the shared stages. Combined generation stays within one budget.

Do not update these frozen shapes when extending the current model. Add another versioned migration when the persistent contract changes again. Golden V2 source/JSON fixtures remain unchanged.