-
Notifications
You must be signed in to change notification settings - Fork 6
Description
Ruby SDK maps identity.django_id to identity.key in evaluation contexts, causing inconsistent evaluation results across SDKs.
Other SDKs (PHP, Python, Go, Rust, Java) omit identity key during context mapping, relying on engine enrichment to generate composite keys.
Acceptance criteria
- Remove
identity.django_id→identity.keymapping in context mappers - Rely on engine enrichment to generate composite key
#{environment[:key]}_#{identifier} - Evaluation results match other SDK implementations for identical environment documents
Context
Evaluation context schema made identity.key optional in 7b4f3b2. Engine enrichment added in 37c424f generates composite keys when missing.
Ruby SDK backfills identity.key from django_id during context mapping:
| key: identity.django_id&.to_s || identity.composite_key, |
This causes different hash inputs for percentage-based operations:
- Ruby: Hash uses
["segment_key", "12345"](django_id) - Other SDKs: Hash uses
["segment_key", "[email protected]"](composite key)
Impact
Identical identities evaluate to different segment memberships and multivariate variants across SDK implementations. Percentage split operators and multivariate feature distributions produce inconsistent results.