Implements the numeric coercion ADR in flagd and flagd-core (Go).
- implement lossless numeric coercion in the evaluator (
core/pkg/evaluator/json.go): replace the bare int64(val) cast in ResolveIntValue with a lossless check (reject a non-zero fractional part and out-of-accessor-range values with TYPE_MISMATCH); 10.0 -> 10 and lossless widening to Float continue to work
- contract applies uniformly to gRPC, OFREP, and in-process paths (no wire changes)
- bump the
flagd-schemas submodule to pick up the safe-integer range constraint. This remains an ordinary schema validation (surfaced as today, i.e. a warning); no new hard load-failure path is added here. Hard-failing on schema violations is a separate future feature.
- bump the
flagd-testbed submodule and adopt the new @numeric-coercion scenarios
- update ADR status:
draft -> accepted; add the per-language accessor-width table
Accessor width: Go's ResolveIntValue is int64, i.e. Go's Integer accessor is the canonical Long. Go therefore excludes the @int32-bounded testbed scenarios; no separate Long accessor is required in Go core.
Breaking (lossless coercion changes existing truncation behavior, e.g. 3.14 via Integer now returns TYPE_MISMATCH); feat!:, minor bump, call out in release notes.
Parent: #1995
Implements the numeric coercion ADR in flagd and flagd-core (Go).
core/pkg/evaluator/json.go): replace the bareint64(val)cast inResolveIntValuewith a lossless check (reject a non-zero fractional part and out-of-accessor-range values withTYPE_MISMATCH);10.0 -> 10and lossless widening toFloatcontinue to workflagd-schemassubmodule to pick up the safe-integer range constraint. This remains an ordinary schema validation (surfaced as today, i.e. a warning); no new hard load-failure path is added here. Hard-failing on schema violations is a separate future feature.flagd-testbedsubmodule and adopt the new@numeric-coercionscenariosdraft->accepted; add the per-language accessor-width tableAccessor width: Go's
ResolveIntValueisint64, i.e. Go's Integer accessor is the canonicalLong. Go therefore excludes the@int32-boundedtestbed scenarios; no separate Long accessor is required in Go core.Breaking (lossless coercion changes existing truncation behavior, e.g.
3.14via Integer now returnsTYPE_MISMATCH);feat!:, minor bump, call out in release notes.Parent: #1995