{
  "description": "S2: a numeric unit key MUST be stringified with the single canonical rule ECMAScript Number::toString (String() applied to the number parsed from JSON), so the SAME numeric key produces the SAME bucket on every SDK. These cases lock the canonical string form for magnitudes > 2^53, where reading the raw JSON token instead of the parsed IEEE-754 double would yield a different string (and bucket). HAND-AUTHORED and independently verified with the reference engine (js-sdk/packages/core); NOT regenerated by scripts/generate-fixtures.ts so the demonstrative 2^53+1 input token is preserved (a JSON re-serialize would collapse it to the parsed double).",
  "bundle": "bundle_numeric_unit_key.json",
  "testCases": [
    {
      "name": "big_integer_beyond_2_53",
      "comment": "userId 9007199254740993 (2^53 + 1) parses to the IEEE-754 double 9007199254740992; Number::toString renders '9007199254740992'. An SDK using a bignum JSON parser that preserved the raw 17-digit token would hash a different string and get a different bucket. bucket('9007199254740992':layer_numeric) mod 1000 = 244 -> low.",
      "context": {
        "userId": 9007199254740993
      },
      "expectedHashing": {
        "layer_numeric": {
          "unitKeyValue": "9007199254740992",
          "bucket": 244,
          "comment": "canonical Number::toString of the parsed double, then SHA-256 v2 mod 1000"
        }
      },
      "expectedAssignments": {
        "exp.flag": "off"
      },
      "expectedLayers": [
        {
          "layerId": "layer_numeric",
          "bucket": 244,
          "policyId": "policy_numeric",
          "allocationName": "low"
        }
      ]
    },
    {
      "name": "exponential_magnitude",
      "comment": "userId 1e21 parses to 1e+21; Number::toString renders the exponential form '1e+21' (NOT '1000000000000000000000'). bucket('1e+21':layer_numeric) mod 1000 = 593 -> high.",
      "context": {
        "userId": 1e21
      },
      "expectedHashing": {
        "layer_numeric": {
          "unitKeyValue": "1e+21",
          "bucket": 593,
          "comment": "canonical Number::toString exponential form, then SHA-256 v2 mod 1000"
        }
      },
      "expectedAssignments": {
        "exp.flag": "on"
      },
      "expectedLayers": [
        {
          "layerId": "layer_numeric",
          "bucket": 593,
          "policyId": "policy_numeric",
          "allocationName": "high"
        }
      ]
    }
  ]
}
