Skip to content

Commit 87b91cb

Browse files
talissoncostakhvn26
authored andcommitted
feat(sdk): add flag dependencies to the evaluation context
Adds the schema surface needed to evaluate flags that depend on other flags, as an equivalent to LaunchDarkly's flag prerequisites. `EvaluationContext.flags` is a map of already-evaluated flag results keyed by feature name, so that segment conditions can reference `$.flags.<name>.enabled`, `.value` and `.variant`. Entries reference `FlagResult` in evaluation-result.json directly, so the context and the result cannot drift, and it is `readOnly` as the engine populates it. No behaviour change; this lands the schema so the engines can generate their context types from it.
1 parent cb66498 commit 87b91cb

1 file changed

Lines changed: 9 additions & 0 deletions

File tree

sdk/evaluation-context.json

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,15 @@
344344
"description": "Features to be evaluated in the context.",
345345
"title": "Features",
346346
"type": "object"
347+
},
348+
"flags": {
349+
"additionalProperties": {
350+
"$ref": "evaluation-result.json#/$defs/FlagResult"
351+
},
352+
"description": "Results of features already evaluated for this context, mapped by feature name. Populated by the engine as evaluation progresses, so that segment conditions may reference `$.flags.<feature name>.enabled`, `.value` and `.variant` to express feature dependencies.",
353+
"readOnly": true,
354+
"title": "Flags",
355+
"type": "object"
347356
}
348357
},
349358
"required": [

0 commit comments

Comments
 (0)