prev: #648

New Changes according to review:

1. Stringly-typed API & Source Compatibility

Stringly-typed API in Scala 2 which is NOT source-compatible with typed API in Scala 3

Fixed. I removed all “stringly-typed” convenience methods (e.g., addField("name", ...)) from the public API.

  • Unified API: Both Scala 2 and Scala 3 now expose the exact same selector-based signature:
    renameField(from: A => Any, to: B => Any).
  • Consistency: This guarantees full source compatibility and enforces type-safety across both platforms using version-specific macros.

2. Compile-Time Validation & Runtime Safety

There is no compile-time validation… weak System.err support…

Fixed.

  • Compile-Time Validation (Scala 2 & 3): I implemented comprehensive macros for BOTH platforms (MigrationBuilderValidation for Scala 3, MigrationBuilderMacros for Scala 2) that perform deep AST traversal of the builder chain. They statically verify that:

    • All fields in the Source schema are handled (dropped / renamed / used).
    • All fields in the Target schema are produced (added / renamed).

    Result: Incomplete migrations now fail to compile with clear error messages (e.g.,
    Migration incomplete: target fields [age] are not produced).

  • Runtime Safety: I completely removed System.err.println. The runtime validation (used by Scala 2 or as a backup) now throws distinct exceptions (IllegalStateException) if a migration is invalid, ensuring visible failures.

3. Structural Types & Intermediate Versions

No support for structural types… This work should not include the Schema#structural macro

Addressed.

  • Explicit Removal: As requested, I removed StructuralSchemaDerivation.scala and all related macro code from this PR.
  • Standardization: The migration system now targets standard Schema[A] resolution (e.g., case classes). This allowed me to implement strict compile-time validation, which is much more reliable on concrete types. Once the structural macro is implemented in a separate PR, this system is designed to support it via the standard Schema interface.

4. Error Handling (SchemaError)

Probably should use / expand SchemaError instead of MigrationError

Fixed. I deleted MigrationError entirely.

  • All components (MigrationAction, DynamicMigration, Migration) now return Either[SchemaError, A].
  • I integrated migration-specific failures (like Type Mismatch or Evaluation Failed) into SchemaError.

/claim #519

Claim

Total prize pool $4,000
Total paid $0
Status Pending
Submitted January 11, 2026
Last updated January 11, 2026

Contributors

JA

Jash Ambaliya

@AJ0070

100%

Sponsors

ZI

ZIO

@ZIO

$4,000