Skip to content

feat: add ADR-conformant numeric coercion scenarios under @numeric-coercion #379

Open

Description

@toddbaert

Adds ADR-conformant numeric coercion coverage for the numeric coercion ADR, as a new opt-in suite so providers can adopt it as they migrate (following the opt-in @fractional-v1/@fractional-v2 precedent).

There is currently no numeric-coercion feature in the testbed, so this is purely additive; there is no prior suite to preserve.

  • add a new opt-in tag @numeric-coercion with scenarios matching the ADR:
    • 10.0 fetched as Integer resolves to 10 (lossless coercion)
    • 3.14 fetched as Integer returns TYPE_MISMATCH
    • int variant within safe range fetched as Float widens losslessly
    • wide/boundary values (e.g. 9007199254740991) resolved via the canonical Long accessor (@long)
    • int variant exceeding int32 fetched as Integer returns TYPE_MISMATCH, tagged @int32-bounded (only for languages whose Integer accessor is int32; Go/Python and other int64/wide-Integer languages exclude it)
    • int variant exceeding int32 fetched as Float succeeds
  • add the scenarios to both suites: the provider gherkin/ suite (real flagd container / wire) and the self-contained evaluator/ suite
  • add a flags/numeric-coercion-flags.json (auto-merged into allFlags.json) plus the matching evaluator/flags fixtures
  • register @numeric-coercion, @int32-bounded, @long, and the Long flag-value type token in agents.md and README.md
  • bump FLAGD_BASE_IMAGE to the flagd version that ships the contract
  • cut a new testbed release

Out of scope: load-time rejection of out-of-range values. The safe-integer cap is an ordinary schema validation (a warning in flagd today), not a hard load failure, so there is no "rejected at load" scenario here. The 2^53 - 1 boundary is covered by resolving it correctly via Long; hard-fail-on-out-of-range is a separate future feature.

Parent: open-feature/flagd#1995

Activity

  1. changed the title [-]feat: add ADR-conformant numeric coercion scenarios under @numeric-coercion-v2[/-] [+]feat: add ADR-conformant numeric coercion scenarios under @numeric-coercion[/+] on Oct 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions