Repository navigation
chore(feature-flags): Parse and evaluate flag configurations locally - #764
Merged
Merged
Conversation
Adds the configuration snapshot that the runtime client evaluates from: v2 payload parsing, ordered rule evaluation, context validation and change detection, with the fixture corpus that checks them. Nothing is exported yet; the runtime client that uses it comes next. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
This was referenced Nov 4, 2026
Contributor
[Low impact] The PR appears safe to merge; the mapping fix leaves no identified blocking issue. SummaryAdds local feature flag parsing, evaluation, context checks, and change detection.
Reviews (3) · Last reviewed commit: "fix(feature-flags): Accept any mapping a..." · Reviewed by Greptile |
from_dict() takes a Mapping, but json only serializes dicts, so a valid payload wrapped in a MappingProxyType or UserDict was rejected as not JSON-serializable. Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Contributor
Author
|
@greptileai review |
Deborah-Digges
approved these changes
Nov 4, 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.
Stack. This is #762, split into four PRs for review. Merge them in order; after each merge I'll rebase the next one onto
main.Description
This adds the configuration snapshot the runtime client evaluates from. It has no network code.
FeatureFlagsConfigurationparses a v2 payload (GET /sdk/feature-flags?payload_version=2), given as any mapping, and keeps its own copy. It round-trips through JSON and pickle, so it can be cached and passed back as a bootstrap.{target_type: id}mapping, so custom target types work the same way asuserandorganization.changed_flagsreports which slugs a new snapshot changed, for change events.Nothing is exported yet, and nothing calls this code until #765. That's why the title is
chore:: it keeps this PR out of the changelog.Where to look: start with
_configuration.py(_parse_flag,_parse_rule,_CompiledFlag.evaluate), then_context.py. Of the 5,190 added lines, 4,275 are the four JSON fixture files. They're data and can be skimmed. They're shaped for the shared cross-SDK corpus (AUTH-7098).How I checked it:
test_corpus.py) evaluates every case with both caller defaults,FalseandTrue. That tells "no answer" apart from a realFalse, and the runner fails on any field it doesn't recognize. The same fixtures run again through the runtime client in feat(feature-flags): Evaluate feature flags locally with a polling runtime client #765.nox -s cipasses locally: format, lint, pyright (0 errors) and 3,109 tests.Documentation
Does this require changes to the WorkOS Docs? E.g. the API Reference or code snippets need updates.
Nothing user-facing yet. The docs follow-up is tracked on #765.
🤖 Generated with Claude Code