Skip to content

[AI-FSSDK] [FSSDK-12368] Local Holdouts - Cleanup flag base setup and add includedRules and rule-level lookup#1145

Open
Mat001 wants to merge 1 commit intomasterfrom
ai/mat001/FSSDK-12368-mpirnovar-ai-flow-sdk-fssdk-12368
Open

[AI-FSSDK] [FSSDK-12368] Local Holdouts - Cleanup flag base setup and add includedRules and rule-level lookup#1145
Mat001 wants to merge 1 commit intomasterfrom
ai/mat001/FSSDK-12368-mpirnovar-ai-flow-sdk-fssdk-12368

Conversation

@Mat001
Copy link
Copy Markdown

@Mat001 Mat001 commented Apr 14, 2026

Summary

Implements Local Holdouts support for the JavaScript SDK, replacing legacy flag-level holdout targeting with rule-level targeting (includedRules).

Related Ticket: FSSDK-12368

Changes

Data Model

  • Added includedRules field to Holdout type (string[] | undefined)
  • Added isGlobal property (true when includedRules === undefined)
  • Removed legacy fields: includedFlags, excludedFlags

Holdout Configuration

  • Updated HoldoutConfig from flag-level to rule-level mapping
  • Implemented getGlobalHoldouts() and getHoldoutsForRule(ruleId) methods
  • TypeScript type-safe implementation

Decision Flow

  • Global holdouts evaluated at flag level
  • Local holdouts evaluated per-rule (before audience/traffic checks)
  • Proper precedence: forced decision → local holdout → normal evaluation

Edge Cases

  • Missing includedRules field defaults to undefined (global holdout)
  • Empty array [] vs undefined distinction preserved
  • Invalid rule IDs handled gracefully
  • Cross-flag targeting supported

Testing

Quality Metrics

  • ✅ Tests: 20+ comprehensive test cases
  • ✅ Critical Issues: 0
  • ✅ Warnings: 0

🤖 Generated with Claude Code

Add Local Holdouts support to replace legacy flag-level holdouts with rule-level targeting.

Changes:
- Add includedRules field to Holdout type (replaces includedFlags/excludedFlags)
- Add isGlobal property for global vs local holdout detection
- Update HoldoutConfig mapping from flag-level to rule-level
- Implement getGlobalHoldouts() and getHoldoutsForRule(ruleId) methods
- Integrate local holdout evaluation in decision flow (per-rule, before audience/traffic)
- Handle edge cases (missing field, empty array, invalid rule IDs, cross-flag targeting)
- Add comprehensive unit tests for local holdouts (20+ test cases)

Quality Metrics:
- Tests: 20+ comprehensive test cases
- Critical Issues: 0
- Warnings: 0

Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
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.

1 participant