Skip to content

feat(flags): add rules engine boundary (FFL-2837 PR1) - #1346

Draft
btthomas wants to merge 2 commits into
blake.thomas/FFL-2837from
blake.thomas/FFL-2837-PR1
Draft

feat(flags): add rules engine boundary (FFL-2837 PR1)#1346
btthomas wants to merge 2 commits into
blake.thomas/FFL-2837from
blake.thomas/FFL-2837-PR1

Conversation

@btthomas

@btthomas btthomas commented Jul 24, 2026

Copy link
Copy Markdown
Collaborator

Pull request stack

  1. Plan PR (#1345)
  2. PR1: Rules engine boundary (feat(flags): add rules engine boundary (FFL-2837 PR1) #1346) <- you are here
  3. PR2: Dynamic offline evaluation (#1347)
  4. PR3: Provider API and documentation (#1348)

Summary

This PR adds the internal boundary for dynamic offline rule evaluation.

  • It adds one adapter for the flagging-core rules engine.
  • It converts SDK contexts to flat rules contexts.
  • It preserves the difference between a missing targeting key and an empty targeting key.
  • It clones and freezes the temporary rules configuration.
  • It omits an invalid flag without removing valid sibling flags.
  • It normalizes evaluation results.
  • It rejects serialization when a configuration contains rules.
  • It adds rules-wire and adapter contract tests.
  • It does not change FlagsClient or provider behavior.

Reason

The React Native SDK must not implement a second rules engine. The adapter keeps flagging-core details out of the SDK state machine. Tests can replace the adapter with a deterministic fake.

Temporary upstream code

The latest published flagging-core version is 2.0.2. It does not contain the rules wire and protobuf evaluator from openfeature-js-client#344.

This PR has three TODO(FFL-2837) items:

The fake rules engine is a permanent unit-test boundary. It is not an upstream compatibility shim.

Rules evaluations do not recover extraLogging. That field is deprecated and is not part of the new rules response.

User impact

There is no new user-visible behavior in this PR. Existing online and precomputed offline evaluation do not change.

Checks

  • yarn tsc --noEmit -p packages/core/tsconfig.json
  • Targeted ESLint for all changed TypeScript files
  • 23 rules and wire tests
  • 55 configuration tests
  • 92 flags tests

@btthomas
btthomas force-pushed the blake.thomas/FFL-2837-PR1 branch from bb7ad12 to d8dd76f Compare July 27, 2026 19:53
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