open-feature / open-feature/flagd-testbed

feat: add ADR-conformant numeric coercion scenarios under @numeric-coercion-v2

Open
#379 0 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Gherkin
Stars
5
Forks
14
Avg merge
3h 17m
Merged PRs (30d)
13

Description

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: https://github.com/open-feature/flagd/issues/1995

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by comparing the existing opt-in @fractional-v1/@fractional-v2 scenarios in gherkin/ and evaluator/. Add the numeric-coercion scenarios and fixtures in flags/numeric-coercion-flags.json and evaluator/flags, then update agents.md, README.md, FLAGD_BASE_IMAGE, and the release metadata mentioned in the issue. Done means both suites cover the ADR cases and the new tags and Long token are registered.

Written by the indexing model from the issue text.

Assessment

Domain
documentation, release, testing-qa
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Quiet
Clarity
Mostly clear
Newbie friendliness
45/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.