(Compile-time validation where possible, runtime checks where necessary)
Introduce refinement types that:
- Enforce constraints at compile time for literals and compile-time-known values.
- Generate runtime checks for dynamic values (e.g., variables computed at runtime).
- Integrate with Kotlin’s contracts and smart-casting to minimize boilerplate.