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_valueandFeatureStateModel.get_valueare 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.keyis set to what's currently defined asmv_hashing_seed). -
EvaluationContext/EvaluationResultare fully typed with Core API metadata TypedDicts. - A segment condition on
$.flags.<name>.enabledevaluates correctly end-to-end viaPOST /identities,GET /flags. - (Stretch goal) Vendored Pydantic engine models are removed in favour of
flagsmith_common.schemas.
Source: Flagsmith/flagsmith