FAILURE MAP
← Case archive

FA-73981 / Feature flag rollout bucketing / Open access

Bucketing attribute selection: Numeric-looking strings are normalised · case 01

Keys "05" and "5" share a bucket, merging distinct customers.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Digit-only strings are parsed to int before stringifying, removing leading zeros.

THE FAILURE

Digit-only strings are parsed to int before stringifying, removing leading zeros.

Unsuccessful approach: Stripping leading zeros textually performs the same unwanted normalisation.

Case contract

The bucketing identity is user[bucket_by] when bucket_by is non-empty and present, else user["key"]. Booleans, None and non-scalar values are unbucketable -> [None, 0]; integral floats use their integer form, other floats are unbucketable; ints and strings are used verbatim via str(). Return [identity, crc32(flag_key + "." + salt + "." + identity) % 100000].

Why this case matters

Bucketing by organisation or device keeps whole accounts in one variant; the identity must be stable.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import zlib
N = 1
observations = []
def solve(flag_key, salt, user, bucket_by):
    if bucket_by and bucket_by in user:
        value = user[bucket_by]
    else:
        value = user.get('key')
    if isinstance(value, bool) or value is None:
        return [None, 0]
    if isinstance(value, float):
        if value != int(value):
            return [None, 0]
        value = int(value)
    if not isinstance(value, (int, str)):
        return [None, 0]
    ident = str(int(value)) if isinstance(value, str) and value.isdigit() else str(value)
    return [ident, zlib.crc32((flag_key + '.' + salt + '.' + ident).encode()) % 100000]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('boolean attribute is unbucketable', ['new-nav', 'a', {'key': 'u1', 'org': True}, 'org'], [None, 0]),
  ('integral float bucketed as integer', ['new-nav', 'a', {'key': 'u1', 'org': 5.0}, 'org'], ['5', 7520]),
  ('integral float matches integer identity', ['new-nav', 'a', {'key': 'u1', 'org': 5}, 'org'], ['5', 7520]),
  ('missing bucket attribute falls back to key', ['new-nav', 'a', {'key': 'u1'}, 'org'], ['u1', 4562]),
  ('zero attribute is a real identity', ['bulk-edit', 'b', {'key': 'u2', 'org': 0}, 'org'], ['0', 47112]),
  ('leading-zero string kept verbatim', ['new-nav', 'a', {'key': 'u1', 'org': '007'}, 'org'], ['007', 42108]),
  ('leading-zero key kept verbatim', ['bulk-edit', 'b', {'key': '05'}, None], ['05', 9565]),
  ('identity sample 1', ['new-nav', 'b', {'key': '05', 'org': '', 'team': 5.0}, 'team'], ['5', 56729])],
 [('integral float bucketed as integer', ['new-nav', 'a', {'key': 'u1', 'org': 5.0}, 'org'], ['5', 7520]),
  ('integral float matches integer identity', ['new-nav', 'a', {'key': 'u1', 'org': 5}, 'org'], ['5', 7520]),
  ('missing bucket attribute falls back to key', ['new-nav', 'a', {'key': 'u1'}, 'org'], ['u1', 4562]),
  ('zero attribute is a real identity', ['bulk-edit', 'b', {'key': 'u2', 'org': 0}, 'org'], ['0', 47112]),
  ('fractional float is unbucketable', ['new-nav', 'a', {'key': 'u1', 'org': 2.5}, 'org'], [None, 0]),
  ('leading-zero key kept verbatim', ['bulk-edit', 'b', {'key': '05'}, None], ['05', 9565]),
  ('identity sample 6', ['new-nav', 'b', {'key': 'u1', 'org': -3.0, 'team': 2.5}, 'org'], ['-3', 33868]),
  ('identity sample 23', ['new-nav', 'a', {'key': '05', 'org': 3.9, 'team': '05'}, 'team'], ['05', 69931])],
 [('integral float matches integer identity', ['new-nav', 'a', {'key': 'u1', 'org': 5}, 'org'], ['5', 7520]),
  ('missing bucket attribute falls back to key', ['new-nav', 'a', {'key': 'u1'}, 'org'], ['u1', 4562]),
  ('zero attribute is a real identity', ['bulk-edit', 'b', {'key': 'u2', 'org': 0}, 'org'], ['0', 47112]),
  ('fractional float is unbucketable', ['new-nav', 'a', {'key': 'u1', 'org': 2.5}, 'org'], [None, 0]),
  ('leading-zero string kept verbatim', ['new-nav', 'a', {'key': 'u1', 'org': '007'}, 'org'], ['007', 42108]),
  ('identity sample 11', ['new-nav', 'a', {'key': 'u1', 'org': 12, 'team': 2.5}, None], ['u1', 4562]),
  ('identity sample 43', ['new-nav', 'a', {'key': '007', 'team': False}, None], ['007', 42108]),
  ('identity sample 44', ['new-nav', 'a', {'key': '05', 'team': [1]}, 'org'], ['05', 69931])],
 [('missing bucket attribute falls back to key', ['new-nav', 'a', {'key': 'u1'}, 'org'], ['u1', 4562]),
  ('zero attribute is a real identity', ['bulk-edit', 'b', {'key': 'u2', 'org': 0}, 'org'], ['0', 47112]),
  ('fractional float is unbucketable', ['new-nav', 'a', {'key': 'u1', 'org': 2.5}, 'org'], [None, 0]),
  ('leading-zero string kept verbatim', ['new-nav', 'a', {'key': 'u1', 'org': '007'}, 'org'], ['007', 42108]),
  ('leading-zero key kept verbatim', ['bulk-edit', 'b', {'key': '05'}, None], ['05', 9565]),
  ('identity sample 2', ['new-nav', 'b', {'key': 'u1', 'org': '05', 'team': [1]}, 'org'], ['05', 58693]),
  ('identity sample 5', ['new-nav', 'a', {'key': 'abc', 'team': '05'}, 'team'], ['05', 69931]),
  ('identity sample 16', ['new-nav', 'b', {'key': 'u1', 'org': '0012', 'team': ''}, None], ['u1', 96668])],
 [('zero attribute is a real identity', ['bulk-edit', 'b', {'key': 'u2', 'org': 0}, 'org'], ['0', 47112]),
  ('fractional float is unbucketable', ['new-nav', 'a', {'key': 'u1', 'org': 2.5}, 'org'], [None, 0]),
  ('leading-zero string kept verbatim', ['new-nav', 'a', {'key': 'u1', 'org': '007'}, 'org'], ['007', 42108]),
  ('leading-zero key kept verbatim', ['bulk-edit', 'b', {'key': '05'}, None], ['05', 9565]),
  ('false attribute is unbucketable', ['bulk-edit', 'b', {'key': 'u1', 'org': False}, 'org'], [None, 0]),
  ('identity sample 21', ['new-nav', 'a', {'key': 'u42', 'org': 12, 'team': False}, 'team'], [None, 0]),
  ('identity sample 30', ['new-nav', 'a', {'key': '05', 'team': 2.5}, None], ['05', 69931]),
  ('identity sample 33', ['bulk-edit', 'b', {'key': '007', 'org': 'acme', 'team': 0}, None], ['007', 54512])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boolean attribute is unbucketable[None, 0][None, 0]Passed
integral float bucketed as integer['5', 7520]['5', 7520]Passed
integral float matches integer identity['5', 7520]['5', 7520]Passed
missing bucket attribute falls back to key['u1', 4562]['u1', 4562]Passed
zero attribute is a real identity['0', 47112]['0', 47112]Passed
leading-zero string kept verbatim['7', 94092]['007', 42108]Failed
leading-zero key kept verbatim['5', 48935]['05', 9565]Failed
identity sample 1['5', 56729]['5', 56729]Passed

SHA-256 / e5d6c7aacbc2867b9bee32111989cda3817d46d4a27a4352f2254acb3a11a88d

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import zlib
N = 1
observations = []
def solve(flag_key, salt, user, bucket_by):
    if bucket_by and bucket_by in user:
        value = user[bucket_by]
    else:
        value = user.get('key')
    if isinstance(value, bool) or value is None:
        return [None, 0]
    if isinstance(value, float):
        if value != int(value):
            return [None, 0]
        value = int(value)
    if not isinstance(value, (int, str)):
        return [None, 0]
    ident = (value.lstrip('0') or '0') if isinstance(value, str) else str(value)
    return [ident, zlib.crc32((flag_key + '.' + salt + '.' + ident).encode()) % 100000]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('boolean attribute is unbucketable', ['new-nav', 'a', {'key': 'u1', 'org': True}, 'org'], [None, 0]),
  ('integral float bucketed as integer', ['new-nav', 'a', {'key': 'u1', 'org': 5.0}, 'org'], ['5', 7520]),
  ('integral float matches integer identity', ['new-nav', 'a', {'key': 'u1', 'org': 5}, 'org'], ['5', 7520]),
  ('missing bucket attribute falls back to key', ['new-nav', 'a', {'key': 'u1'}, 'org'], ['u1', 4562]),
  ('zero attribute is a real identity', ['bulk-edit', 'b', {'key': 'u2', 'org': 0}, 'org'], ['0', 47112]),
  ('leading-zero string kept verbatim', ['new-nav', 'a', {'key': 'u1', 'org': '007'}, 'org'], ['007', 42108]),
  ('leading-zero key kept verbatim', ['bulk-edit', 'b', {'key': '05'}, None], ['05', 9565]),
  ('identity sample 1', ['new-nav', 'b', {'key': '05', 'org': '', 'team': 5.0}, 'team'], ['5', 56729])],
 [('integral float bucketed as integer', ['new-nav', 'a', {'key': 'u1', 'org': 5.0}, 'org'], ['5', 7520]),
  ('integral float matches integer identity', ['new-nav', 'a', {'key': 'u1', 'org': 5}, 'org'], ['5', 7520]),
  ('missing bucket attribute falls back to key', ['new-nav', 'a', {'key': 'u1'}, 'org'], ['u1', 4562]),
  ('zero attribute is a real identity', ['bulk-edit', 'b', {'key': 'u2', 'org': 0}, 'org'], ['0', 47112]),
  ('fractional float is unbucketable', ['new-nav', 'a', {'key': 'u1', 'org': 2.5}, 'org'], [None, 0]),
  ('leading-zero key kept verbatim', ['bulk-edit', 'b', {'key': '05'}, None], ['05', 9565]),
  ('identity sample 6', ['new-nav', 'b', {'key': 'u1', 'org': -3.0, 'team': 2.5}, 'org'], ['-3', 33868]),
  ('identity sample 23', ['new-nav', 'a', {'key': '05', 'org': 3.9, 'team': '05'}, 'team'], ['05', 69931])],
 [('integral float matches integer identity', ['new-nav', 'a', {'key': 'u1', 'org': 5}, 'org'], ['5', 7520]),
  ('missing bucket attribute falls back to key', ['new-nav', 'a', {'key': 'u1'}, 'org'], ['u1', 4562]),
  ('zero attribute is a real identity', ['bulk-edit', 'b', {'key': 'u2', 'org': 0}, 'org'], ['0', 47112]),
  ('fractional float is unbucketable', ['new-nav', 'a', {'key': 'u1', 'org': 2.5}, 'org'], [None, 0]),
  ('leading-zero string kept verbatim', ['new-nav', 'a', {'key': 'u1', 'org': '007'}, 'org'], ['007', 42108]),
  ('identity sample 11', ['new-nav', 'a', {'key': 'u1', 'org': 12, 'team': 2.5}, None], ['u1', 4562]),
  ('identity sample 43', ['new-nav', 'a', {'key': '007', 'team': False}, None], ['007', 42108]),
  ('identity sample 44', ['new-nav', 'a', {'key': '05', 'team': [1]}, 'org'], ['05', 69931])],
 [('missing bucket attribute falls back to key', ['new-nav', 'a', {'key': 'u1'}, 'org'], ['u1', 4562]),
  ('zero attribute is a real identity', ['bulk-edit', 'b', {'key': 'u2', 'org': 0}, 'org'], ['0', 47112]),
  ('fractional float is unbucketable', ['new-nav', 'a', {'key': 'u1', 'org': 2.5}, 'org'], [None, 0]),
  ('leading-zero string kept verbatim', ['new-nav', 'a', {'key': 'u1', 'org': '007'}, 'org'], ['007', 42108]),
  ('leading-zero key kept verbatim', ['bulk-edit', 'b', {'key': '05'}, None], ['05', 9565]),
  ('identity sample 2', ['new-nav', 'b', {'key': 'u1', 'org': '05', 'team': [1]}, 'org'], ['05', 58693]),
  ('identity sample 5', ['new-nav', 'a', {'key': 'abc', 'team': '05'}, 'team'], ['05', 69931]),
  ('identity sample 16', ['new-nav', 'b', {'key': 'u1', 'org': '0012', 'team': ''}, None], ['u1', 96668])],
 [('zero attribute is a real identity', ['bulk-edit', 'b', {'key': 'u2', 'org': 0}, 'org'], ['0', 47112]),
  ('fractional float is unbucketable', ['new-nav', 'a', {'key': 'u1', 'org': 2.5}, 'org'], [None, 0]),
  ('leading-zero string kept verbatim', ['new-nav', 'a', {'key': 'u1', 'org': '007'}, 'org'], ['007', 42108]),
  ('leading-zero key kept verbatim', ['bulk-edit', 'b', {'key': '05'}, None], ['05', 9565]),
  ('false attribute is unbucketable', ['bulk-edit', 'b', {'key': 'u1', 'org': False}, 'org'], [None, 0]),
  ('identity sample 21', ['new-nav', 'a', {'key': 'u42', 'org': 12, 'team': False}, 'team'], [None, 0]),
  ('identity sample 30', ['new-nav', 'a', {'key': '05', 'team': 2.5}, None], ['05', 69931]),
  ('identity sample 33', ['bulk-edit', 'b', {'key': '007', 'org': 'acme', 'team': 0}, None], ['007', 54512])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
boolean attribute is unbucketable[None, 0][None, 0]Passed
integral float bucketed as integer['5', 7520]['5', 7520]Passed
integral float matches integer identity['5', 7520]['5', 7520]Passed
missing bucket attribute falls back to key['u1', 4562]['u1', 4562]Passed
zero attribute is a real identity['0', 47112]['0', 47112]Passed
leading-zero string kept verbatim['7', 94092]['007', 42108]Failed
leading-zero key kept verbatim['5', 48935]['05', 9565]Failed
identity sample 1['5', 56729]['5', 56729]Passed

SHA-256 / 3113f2da48bfa4e713707c7dc0b5feda36654f1db2dffc0e95b92e4ae4798401

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.

Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.

Member access is invitation-based. Sign in with your invited account to inspect the repair.

Sign in to the archive ↗

Verification & scope

A deterministic toy flag-evaluation model with a stipulated contract; it does not reproduce any vendor SDK byte for byte. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:48:52.580664+00:00.

Case digest / 608323a078c54b6bdf1f189c26b41c672f67db181737c26d8e8f79cac9f7e0f1