Schema 3 to 4 reader
Schema 3 is a real compatibility input. Its shapes were frozen at 5ce3eef.
The small DTOs in mod.rs own the changed data payloads and old message values;
closed element/relation constructor lists prevent new vocabulary from entering
the old reader. Unchanged ports, diagram placements/routes, artifacts and traces
reuse their typed records. The intermediate JSON bridge rejects duplicate keys.
Nature, bounded types, field defaults/direction/storage, and single supertypes
receive explicit documented defaults. Interface lists become identified ordered
allocations with UUID v5 namespace equal to the project UUID and name
v2-interface-item:<interface-uuid>:<item-uuid>. The name remains the same for
V2 and V3 inputs so the migration route cannot change the generated identity.
Existing IDs never move; deterministic collisions fail with a located diagnostic.
Aliases use the normal deterministic collision suffix. Unique legacy message
paths are qualified; ambiguous annotations retain their expression and warning.
V1 first normalizes to the frozen V2 DTO. V2 port/endpoint normalization emits an explicit schema3 candidate and then runs this reader before current decoding. Generated object, record and reference budgets cover the combined stages.
language::resolve_declarations shares lexical/AST parsing, including nesting,
but chooses frozen source3 payload defaults and rejects new constructors. Both
single-file parsing and source_project::compile_bundle take this explicit path.
The bundle compiler first stabilizes omitted IDs, then performs targeted token
edits in source_project/source_migration.rs. Original files, includes, lexical
ownership and comments survive. New allocation declarations stay in the source
interface's module. The returned source and index describe schema4 bytes; loading
does not rewrite original disk files. Canonical output and second-save stability
are schema4. No whole-project formatting fallback handles authored source3.
Frozen source/JSON fixtures live under tests/fixtures/v3-data-contract.*; the
original V2 golden files remain unchanged.