#6654·flagsmith

Make flag-engine the sole flag evaluation authority in Core API

Author: gagantrivediCreated Feb 4, 2026Updated Sep 18, 2026

Core API still evaluates flags without relying on the Python flagsmith-engine.

This blocks #1674: the engine resolves flag dependencies from EvaluationContext.features, which Core API never populates.

Core API's only contribution to evaluation should be building an EvaluationContext from the database. Everything after that is the engine's job.

Acceptance criteria

  • Every code path that returns a flag value for an identity — SDK endpoints, dashboard, integrations, Edge — obtains it from get_evaluation_result.
  • Core API no longer implements override precedence or multivariate bucketing. FeatureState.__gt__, get_multivariate_feature_state_value and FeatureStateModel.get_value are gone.
  • Identity overrides are expressed to the engine the same way SDKs express them: a synthetic segment with priority = -inf.
  • Multivariate bucketing is unchanged for existing identities (FeatureContext.key is set to what's currently defined as mv_hashing_seed).
  • EvaluationContext / EvaluationResult are fully typed with Core API metadata TypedDicts.
  • A segment condition on $.flags.<name>.enabled evaluates correctly end-to-end via POST /identities, GET /flags.
  • (Stretch goal) Vendored Pydantic engine models are removed in favour of flagsmith_common.schemas.