Skip to content

[AI-FSSDK] [FSSDK-12760] add localHoldouts to datafile for backward compatibility#1157

Open
jaeopt wants to merge 1 commit into
masterfrom
ai/jaeopt/FSSDK-12760-local-datafile
Open

[AI-FSSDK] [FSSDK-12760] add localHoldouts to datafile for backward compatibility#1157
jaeopt wants to merge 1 commit into
masterfrom
ai/jaeopt/FSSDK-12760-local-datafile

Conversation

@jaeopt

@jaeopt jaeopt commented Jun 12, 2026

Copy link
Copy Markdown
Contributor

Summary

Adds support for a new top-level localHoldouts datafile section so older SDK
versions (Gen 1 / Gen 2) ignore local holdouts safely instead of misapplying
them as global holdouts. Section membership in holdouts vs localHoldouts is
now the sole signal for holdout scope.

  • Entries in holdouts are always global; includedRules on these entries is
    stripped at parse time so scope is unambiguous.
  • Entries in localHoldouts are always local (rule-scoped via includedRules);
    entries missing or with empty includedRules are invalid, logged at ERROR,
    and excluded from evaluation (no fallback to global).
  • Backward compatible: datafiles without a localHoldouts section continue to
    work unchanged.

Changes

  • lib/project_config/project_config.ts
    • ProjectConfig.localHoldouts: Holdout[] added (defaults to []).
    • createMutationSafeDatafileCopy shallow-copies entries in both holdout
      sections so per-entry mutations (e.g. stripping includedRules) don't bleed
      into the caller's datafile.
    • parseHoldoutsConfig rewritten to partition by section membership; threads
      an optional LoggerFacade for invalid-entry diagnostics.
    • createProjectConfig and tryCreatingProjectConfig thread the logger
      through so parse-time errors are surfaced.
    • Docstrings on HoldoutConfig, getGlobalHoldouts, getHoldoutsForRule
      updated — section membership is the sole signal.
  • lib/shared_types.ts — docstrings on Holdout.includedRules and
    Holdout.isGlobal updated to reflect section-driven scope.
  • lib/project_config/project_config.spec.ts — existing FSSDK-12369 tests
    migrated to the two-section layout; new FSSDK-12760 suite covers
    localHoldouts parsing, backward compat, strip-and-ignore for global-section
    includedRules, caller-mutation regression, both-sections partitioning,
    invalid-entry logging (missing / null / empty), and variation map coverage.
  • lib/core/decision_service/index.spec.tsmakeLocalHoldoutDatafile
    helper updated to emit local holdouts in the localHoldouts section.

Reference implementations

Jira

FSSDK-12760

@coveralls

Copy link
Copy Markdown

Coverage Status

coverage: 77.626% (-0.09%) from 77.713% — ai/jaeopt/FSSDK-12760-local-datafile into master

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