Summary
Discriminator validation currently diverges between the stack-based engine and legacy per-schema validate methods. As it is deferred work to runtime, the compiler is allowing completely invalid discriminators through. Tighten compile-time schema checks and retire the duplicate validation path so discriminators always honour the "tag exemption" rules.
Scope
- Enforce discriminator mapping constraints during schema compilation (properties schemas only, no nullable mappings, discriminator key not shadowed).
- Remove direct
validate implementations on schema records and rely exclusively on the stack validator.
- Update stack handling to apply the discriminator tag exemption without special casing.
- Refresh tests and documentation to match the stricter behaviour.
Plan
See PLAN.md in the repository root for the proposed work breakdown, risks, and testing strategy.
Summary
Discriminator validation currently diverges between the stack-based engine and legacy per-schema
validatemethods. As it is deferred work to runtime, the compiler is allowing completely invalid discriminators through. Tighten compile-time schema checks and retire the duplicate validation path so discriminators always honour the "tag exemption" rules.Scope
validateimplementations on schema records and rely exclusively on the stack validator.Plan
See
PLAN.mdin the repository root for the proposed work breakdown, risks, and testing strategy.