Skip to content

Conversation

@jaeopt
Copy link
Owner

@jaeopt jaeopt commented Feb 2, 2026

Summary

This PR excludes CMAB (Contextual Multi-Armed Bandit) experiments from using the User Profile Service (UPS) for sticky bucketing.

Changes Made

  • Modified get_variation() to skip UPS lookup for CMAB experiments
  • Modified get_variation() to skip UPS save for CMAB experiments
  • Added debug logging when UPS is skipped for CMAB experiments
  • Created 3 comprehensive unit tests covering CMAB UPS exclusion scenarios

Rationale

  • Decision: CMAB should not use UPS for sticky bucketing
  • Reason: UPS maintains decisions across the experiment lifetime without considering TTL or user attributes, which contradicts CMAB's dynamic nature
  • Impact: CMAB decisions remain dynamic while non-CMAB experiments continue using UPS normally

Testing

  • ✅ All 51 decision_service tests pass
  • ✅ 3 new tests added:
    • test_get_variation_cmab_experiment_skips_user_profile_lookup
    • test_get_variation_cmab_experiment_skips_user_profile_save
    • test_get_variation_non_cmab_uses_user_profile_normally

Quality Assurance Summary

  • Iterations: 1/5 (completed on first iteration)
  • Tests: 51/51 passed
  • Code Review: Production-ready

Files Modified

  • optimizely/decision_service.py (+11 lines, -2 lines)
  • tests/test_decision_service.py (+223 lines)

Jira Ticket: FSSDK-12262

🤖 Generated with AI assistance

- Skip User Profile Service lookup for CMAB experiments
- Skip User Profile Service save for CMAB experiments
- CMAB decisions are dynamic and should not be persisted
- Add comprehensive unit tests for CMAB UPS exclusion
- All 51 decision_service tests pass

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
@jaeopt jaeopt closed this Feb 2, 2026
@jaeopt jaeopt deleted the ai/jaeopt/FSSDK-12262-cmab-ups branch February 2, 2026 23:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants