Skip to content

[AI-FSSDK] [FSSDK-12369] Add local holdouts support to JavaScript SDK#1151

Open
Mat001 wants to merge 2 commits into
masterfrom
ai/mat001/FSSDK-12369-local-holdouts
Open

[AI-FSSDK] [FSSDK-12369] Add local holdouts support to JavaScript SDK#1151
Mat001 wants to merge 2 commits into
masterfrom
ai/mat001/FSSDK-12369-local-holdouts

Conversation

@Mat001
Copy link
Copy Markdown
Contributor

@Mat001 Mat001 commented May 14, 2026

Summary

Adds Local Holdouts support to the JavaScript SDK. Local holdouts allow targeting specific experiment or delivery rules within a flag, while global holdouts (the existing behavior) apply to all rules across all flags. This introduces a new rule-level targeting system using an includedRules field on the holdout data model.

Changes

  • Added includedRules and isGlobal fields to the Holdout interface in shared_types.ts
  • Added HoldoutConfig interface and getGlobalHoldouts / getHoldoutsForRule helper functions to project_config.ts; parseHoldoutsConfig now builds and stores these lookups during config initialization
  • Updated decision_service/index.ts to evaluate global holdouts via getGlobalHoldouts() at flag level and check local holdouts per-rule (after forced decisions, before regular rule evaluation) for both experiment rules and delivery rules
  • Added Level 1 unit tests for config/parsing (isGlobal classification, backward compat, edge cases) and Level 2 decision service tests (one per branch of the local holdout pseudocode)

Jira Ticket

FSSDK-12369

@coveralls
Copy link
Copy Markdown

coveralls commented May 14, 2026

Coverage Status

coverage: 77.761% (-0.1%) from 77.906% — ai/mat001/FSSDK-12369-local-holdouts into master

@Mat001 Mat001 requested a review from raju-opti May 18, 2026 17:14
Copy link
Copy Markdown
Contributor

@raju-opti raju-opti left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I would like to refactor few thing. But good for now

* When present, the caller should use this as the full decision result
* instead of constructing one from the experiment.
*/
localHoldoutDecision?: DecisionObj;
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This field does not make sense inside this type. This will work functionally now, but I would like to refactor it later


// Level 2 decision service tests for local holdouts (FSSDK-12369)
// One test per branch of the pseudocode in Step 3 of the ticket.
describe('local holdouts (FSSDK-12369)', () => {
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove ticket number from the title

});
});

// Level 2 decision service tests for local holdouts (FSSDK-12369)
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

please remove the ticket number

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.

3 participants