Repository navigation
feat(feature-flags): add Python-format rule engine store - #5920
Merged
Merged
Conversation
Evaluate shared Python Flag Documents from an asynchronous JSON source. Validate every retrieval and support all non-time Actions with strict comparisons, first-match Rule priority, and value-free diagnostics. Add Python 3.36.0 conformance cases, explicit compatibility differences, and a typed inline-document example. Reject time and modulo Actions until their separate implementation lands. Fixes #5902
…rors Include each Condition's zero-based index in validation diagnostics so callers can locate malformed entries without exposing operand values. Keep evaluation diagnostics unchanged and cover a malformed second Condition in a three-Condition Rule. Refs #5902
svozza
reviewed
Nov 6, 2026
Move the JMESPath comparator into commons without changing its body so other packages can use Python-compatible Unicode ordering. Export compareStringsByCodePoint from the root and cover string ordering, prefixes, astral characters, and non-normalized strings. Refs #5902
…e objects Compare string operands with the shared Unicode comparator while preserving native number ordering and incompatible-operand errors. Cover all four ordering Actions with BMP-versus-astral operands and record code-point ordering as Python parity. Constrain test contexts to ContextValue and exercise object operands only on the document side, as the public API requires. Refs #5902
…string containers Replace the array-only membership predicate that rejected otherwise valid shared Python documents. Check own object keys and Unicode code-point substrings while preserving strict array equality and incompatible-operand errors, including through negation. Keep array quantifiers separate and cover membership types, surrogate boundaries, the reviewer regression, and Python parity. Retain the four documented compatibility differences without adding restrictions. Refs #5902
Replace UTF-16 prefix and suffix comparisons with code-point arrays so lone surrogates cannot match half of an astral character. Preserve the existing string operand guard and empty prefix and suffix behavior. Cover surrogate boundaries, astral matches, standalone surrogates, longer operands, empty strings, and Python parity for both Actions. Refs #5902
svozza
approved these changes
Nov 10, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add
ruleEngineStore, which evaluates Flag Documents in the Powertools for Python format locally, from any async JSON source. This lets TypeScript and Python functions share one freeform AppConfig document. Part of RFC discussion #5614.Changes
ruleEngineStore({ source, logger? })factory, which returns a plainStoreobject, with validation, evaluation, and the action table as separate internal modules.boolean_type(omitted meanstrue), and rule and condition structure. Validation errors name the flag, rule, condition index, key, and action, never values.isStrictEqualhelper and settingenabledviaisTruthy.MODULO_RANGEas "not supported yet" until Feature request: time Actions and MODULO_RANGE in ruleEngineStore #5903 adds them, so shared documents that use them fail loudly.SchemaValidationErrorandConditionEvaluationError."10"are rejected, andrulesthat is not an object is rejected.Issue number: closes #5902
By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of your choice.
Disclaimer: We value your time and bandwidth. As such, any pull requests created on non-triaged issues might not be successful.