Problem
Union disambiguation and explicit validation need a way to score how well a payload matches a model — but it's expensive and must never run implicitly.
Proposed change
Generate a memoized, opt-in validate()/isValid()/validity() triad, never called on the deserialize path. Use validity-scoring only as the fallback union strategy (prefer a discriminator when present, to avoid N full deserializations).
Acceptance
Depends on the four-state field model.
Dependencies
Priority: low · Effort: medium
Problem
Union disambiguation and explicit validation need a way to score how well a payload matches a model — but it's expensive and must never run implicitly.
Proposed change
Generate a memoized, opt-in
validate()/isValid()/validity()triad, never called on the deserialize path. Use validity-scoring only as the fallback union strategy (prefer a discriminator when present, to avoid N full deserializations).Acceptance
Depends on the four-state field model.
Dependencies
Priority: low · Effort: medium