diff --git a/.changeset/multivariate-evaluation.md b/.changeset/multivariate-evaluation.md deleted file mode 100644 index b65d2150c..000000000 --- a/.changeset/multivariate-evaluation.md +++ /dev/null @@ -1,17 +0,0 @@ ---- -"@reflag/flag-evaluation": major ---- - -Introduce a v2-only compiled-variant evaluator: - -- `newEvaluator({ flags, segments })` prepares a complete collection and returns `evaluateAll(context)` and `evaluateFlag(context, flagKey)` methods. The batch result contains shared normalized context and per-flag results without repeated context. Single-flag evaluation visits only the requested flag and its dependencies. Unresolved batch entries do not prevent other flags from being evaluated. Remove the v1 value-rule APIs and the one-shot `evaluateFlag` wrapper. -- Preserve flag and segment reference nodes instead of inlining their filters. Flag references explicitly match variant keys; segments remain reusable predicates. Resolve references recursively without dependency-result caching or memoization. -- Preserve diagnostics from unsuccessful referenced rules without suppressing a valid matching selection. Invalid nonmatches remain fail-closed through negation. Propagated diagnostics identify their source flag or segment. -- Reject duplicate keys, missing references, unknown referenced variant keys and cycles at preparation, including mixed flag/segment cycles. Evaluating an unknown flag key throws. -- Preserve arbitrary variant value types through `CompiledFlag` and `EvaluationResult` (default `any`). `resolved: true | false` distinguishes a selected value, including `undefined`, from failure. Successful results require the variant key and matched rule ID. -- Keep membership Sets and prepared percentage bounds private. `ANY_OF` / `NOT_ANY_OF` use cached Set lookups, including under groups and negations; percentage distributions use precomputed bounds and a simple scan. -- Evaluate rules sequentially with explicit fallthrough and source-version/rule/allocation diagnostics. -- Return structured `INVALID_COMPARISON` errors for invalid numeric/date comparisons instead of logging context values. Invalid conditions cannot match through negation. -- Retain the original hash function and threshold rollout filter for boolean cohort compatibility. The inclusive maximum distribution bucket selects the last nonzero allocation. - -The runtime exports are `newEvaluator`, `flattenContext`, and `hashInt`. Removed APIs include `evaluateFlagRules`, `newFlagEvaluator`, `evaluateFlag`, the scalar `evaluate` helper, and the legacy `flattenJSON` / `unflattenJSON` helpers. diff --git a/.changeset/pin-legacy-node-evaluator.md b/.changeset/pin-legacy-node-evaluator.md deleted file mode 100644 index f0cbcdba2..000000000 --- a/.changeset/pin-legacy-node-evaluator.md +++ /dev/null @@ -1,5 +0,0 @@ ---- -"@reflag/node-sdk": patch ---- - -Keep the existing Node SDK on evaluator 1.1.2 through the `@reflag/flag-evaluation-v1` npm alias. This preserves its legacy protocol and prevents the evaluator's v2 workspace release from automatically upgrading its dependency before SDK migration. diff --git a/packages/flag-evaluation/CHANGELOG.md b/packages/flag-evaluation/CHANGELOG.md index b6889eb02..7a74def8d 100644 --- a/packages/flag-evaluation/CHANGELOG.md +++ b/packages/flag-evaluation/CHANGELOG.md @@ -1,5 +1,22 @@ # @reflag/flag-evaluation +## 2.0.0 + +### Major Changes + +- d7078e0: Introduce a v2-only compiled-variant evaluator: + - `newEvaluator({ flags, segments })` prepares a complete collection and returns `evaluateAll(context)` and `evaluateFlag(context, flagKey)` methods. The batch result contains shared normalized context and per-flag results without repeated context. Single-flag evaluation visits only the requested flag and its dependencies. Unresolved batch entries do not prevent other flags from being evaluated. Remove the v1 value-rule APIs and the one-shot `evaluateFlag` wrapper. + - Preserve flag and segment reference nodes instead of inlining their filters. Flag references explicitly match variant keys; segments remain reusable predicates. Resolve references recursively without dependency-result caching or memoization. + - Preserve diagnostics from unsuccessful referenced rules without suppressing a valid matching selection. Invalid nonmatches remain fail-closed through negation. Propagated diagnostics identify their source flag or segment. + - Reject duplicate keys, missing references, unknown referenced variant keys and cycles at preparation, including mixed flag/segment cycles. Evaluating an unknown flag key throws. + - Preserve arbitrary variant value types through `CompiledFlag` and `EvaluationResult` (default `any`). `resolved: true | false` distinguishes a selected value, including `undefined`, from failure. Successful results require the variant key and matched rule ID. + - Keep membership Sets and prepared percentage bounds private. `ANY_OF` / `NOT_ANY_OF` use cached Set lookups, including under groups and negations; percentage distributions use precomputed bounds and a simple scan. + - Evaluate rules sequentially with explicit fallthrough and source-version/rule/allocation diagnostics. + - Return structured `INVALID_COMPARISON` errors for invalid numeric/date comparisons instead of logging context values. Invalid conditions cannot match through negation. + - Retain the original hash function and threshold rollout filter for boolean cohort compatibility. The inclusive maximum distribution bucket selects the last nonzero allocation. + + The runtime exports are `newEvaluator`, `flattenContext`, and `hashInt`. Removed APIs include `evaluateFlagRules`, `newFlagEvaluator`, `evaluateFlag`, the scalar `evaluate` helper, and the legacy `flattenJSON` / `unflattenJSON` helpers. + ## 1.1.2 ### Patch Changes diff --git a/packages/flag-evaluation/package.json b/packages/flag-evaluation/package.json index ec532c5ad..d8fb405a4 100644 --- a/packages/flag-evaluation/package.json +++ b/packages/flag-evaluation/package.json @@ -1,6 +1,6 @@ { "name": "@reflag/flag-evaluation", - "version": "2.0.0-next.0", + "version": "2.0.0", "license": "MIT", "repository": { "type": "git", diff --git a/packages/node-sdk/CHANGELOG.md b/packages/node-sdk/CHANGELOG.md index 48ef5a10a..5e80c62c2 100644 --- a/packages/node-sdk/CHANGELOG.md +++ b/packages/node-sdk/CHANGELOG.md @@ -1,5 +1,11 @@ # @reflag/node-sdk +## 1.8.3 + +### Patch Changes + +- d7078e0: Keep the existing Node SDK on evaluator 1.1.2 through the `@reflag/flag-evaluation-v1` npm alias. This preserves its legacy protocol and prevents the evaluator's v2 workspace release from automatically upgrading its dependency before SDK migration. + ## 1.8.2 ### Patch Changes diff --git a/packages/node-sdk/package.json b/packages/node-sdk/package.json index 2f876158f..c631f9cef 100644 --- a/packages/node-sdk/package.json +++ b/packages/node-sdk/package.json @@ -1,6 +1,6 @@ { "name": "@reflag/node-sdk", - "version": "1.8.2", + "version": "1.8.3", "license": "MIT", "repository": { "type": "git", diff --git a/packages/openfeature-node-provider/CHANGELOG.md b/packages/openfeature-node-provider/CHANGELOG.md index fad07bb72..8e2054b5a 100644 --- a/packages/openfeature-node-provider/CHANGELOG.md +++ b/packages/openfeature-node-provider/CHANGELOG.md @@ -1,5 +1,12 @@ # @reflag/openfeature-node-provider +## 1.2.8 + +### Patch Changes + +- Updated dependencies [d7078e0] + - @reflag/node-sdk@1.8.3 + ## 1.2.7 ### Patch Changes diff --git a/packages/openfeature-node-provider/package.json b/packages/openfeature-node-provider/package.json index edc8a296b..124fb0dd6 100644 --- a/packages/openfeature-node-provider/package.json +++ b/packages/openfeature-node-provider/package.json @@ -1,6 +1,6 @@ { "name": "@reflag/openfeature-node-provider", - "version": "1.2.7", + "version": "1.2.8", "license": "MIT", "repository": { "type": "git", @@ -36,7 +36,7 @@ "fmt:fix": "oxfmt --write ." }, "dependencies": { - "@reflag/node-sdk": "1.8.2" + "@reflag/node-sdk": "1.8.3" }, "devDependencies": { "@babel/core": "~7.29.6", diff --git a/yarn.lock b/yarn.lock index 0b1c7ce06..260f0c5a4 100644 --- a/yarn.lock +++ b/yarn.lock @@ -6830,7 +6830,7 @@ __metadata: languageName: unknown linkType: soft -"@reflag/node-sdk@npm:1.8.2, @reflag/node-sdk@workspace:*, @reflag/node-sdk@workspace:^, @reflag/node-sdk@workspace:packages/node-sdk": +"@reflag/node-sdk@npm:1.8.3, @reflag/node-sdk@workspace:*, @reflag/node-sdk@workspace:^, @reflag/node-sdk@workspace:packages/node-sdk": version: 0.0.0-use.local resolution: "@reflag/node-sdk@workspace:packages/node-sdk" dependencies: @@ -6878,7 +6878,7 @@ __metadata: "@babel/core": "npm:~7.29.6" "@openfeature/core": "npm:^1.5.0" "@openfeature/server-sdk": "npm:>=1.16.1" - "@reflag/node-sdk": "npm:1.8.2" + "@reflag/node-sdk": "npm:1.8.3" "@reflag/tsconfig": "npm:~0.0.2" "@types/node": "npm:^22.12.0" flush-promises: "npm:~1.0.2"