Closes #519
/claim #519
This PR introduces a pure, algebraic migration engine for ZIO Schema 2. It represents structural transformations between schema versions as first-class, serializable data, bypassing runtime reflection and closure pollution.
By separating the user-facing typed Builder API (Migration[A, B]) from the untyped traversal execution engine (DynamicMigration), this architecture supports zero-overhead schema evolution with offline backward/forward serialization constraints perfectly intact.
MigrationAction)MigrationAction ADT operating directly on DynamicOptic.AddField naturally structural-reverses to DropField).DynamicMigration)DynamicValue is fully refactored onto a custom Trampoline interpreter.StackOverflowError risks.MigrationBuilder)MigrationBuilder[A, B] for highly fluent migrations mapping structural identities (Enum operations, elements, and keys natively supported)..build): Fully interprets both Scala 2.13 and Scala 3 AST logic, mapping .renameField(_.source, _.target) safely into DynamicOptic(Node.Field("...")).A) and Target (B) case accessors at compile time via Quotes/Blackbox. Any new fields in the target that are not covered by an action (AddField, Rename) trigger a direct compilation abort cleanly guiding the developer..buildPartial as an escape hatch.MigrationSpec.scala testing standard data preservation mapped back to Migration.identity, as well as sequential associativity limits (m1 ++ m2).MIGRATION_GUIDE.md to establish user onboarding and document macro-error expectations natively for the toolkit.2.13.12 and Scala 3.7.4.Mohit Jeswani
@mohitjeswani01
marianaguzmanguerrero16-dev
@marianaguzmanguerrero16-dev
ZIO
@ZIO