This PR implements a pure, algebraic migration system for ZIO Schema 2 as described in issue #519.

Key Features:

  • Pure Algebraic Core: Migrations are represented as first-class, serializable data structures ([[DynamicMigration]] and [[MigrationAction]] ADT).
  • Macro-Validated User API: [[MigrationBuilder]] uses version-specific macros (Scala 3 Quotes and Scala 2 Whitebox) to extract [[DynamicOptic]] paths from lambda selectors (e.g., _.name ).
  • Structural Types Support: Enables evolving schemas without intermediate runtime representations by using structural types for past versions.
  • Invertibility: All core actions support a reverse operation for structural inverse (best-effort semantic inverse).
  • Algebraic Laws: Verified Identity and Associativity laws through a comprehensive suite of tests in MigrationSpec.scala .
  • No Runtime Overhead: Transformations operate on [[DynamicValue]] directly, avoiding old case class instantiation or reflection.

Implementation Details:

  • Implemented AddField , DropField , RenameField , Join , Split , and TransformValue interpreters.
  • Handled version-specific macro requirements in shared/src/main/scala-3 and shared/src/main/scala-2 .
  • Added diagnostic error reporting capturing the failing DynamicOptic path.

Closes #519

/claim #519

Claim

Total prize pool $8,000
Total paid $0
Status Pending
Submitted March 15, 2026
Last updated March 15, 2026

Contributors

AL

allornothingai

@allornothingai

100%

Sponsors

MA

marianaguzmanguerrero16-dev

@marianaguzmanguerrero16-dev

$4,000
ZI

ZIO

@ZIO

$4,000