Repository navigation
docs(flags): defer local regex evaluation that could diverge from the service - #144
Draft
posthog[bot] wants to merge 3 commits into
Draft
posthog[bot] wants to merge 3 commits into
posthog[bot] wants to merge 3 commits into
Conversation
… service Seven SDKs converged on limiting local regex matching to a portable subset and deferring to the flags service everywhere their engine could disagree. The spec only required deferral when the SDK's own engine could not handle the pattern, so a compiling-but-divergent definitive boolean was compliant and suppressed remote fallback. Co-Authored-By: Claude Opus 5 <noreply@anthropic.com> Generated-By: PostHog Desktop Task-Id: 8e7f7655-037c-4a54-9dc4-321bf02219fe
turnipdabeets
changed the base branch from
docs/acceptance-step-catalogue
to
main
October 27, 2026 22:00
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.
Why
Seven SDKs fixed the same bug within two days, all referencing one agreed cross-SDK approach (posthog-js#5354 and its cross-SDK discussion): local flag evaluation could return a definitive regex result that disagrees with the flags service's Rust engine, and because the result was definitive it also suppressed the remote fallback that would have been correct.
The Regular-expression criteria perform safe case-sensitive search requirement only made an SDK defer when its own engine could not handle a pattern. A pattern that compiles and executes locally but means something different to the service was — and still is, in spec terms — compliant.
Source SDK changes:
^\d+$vs Arabic digits,\p{L}without Unicode mode,\b/\Bvs the service's backtracking budget^foo$matching"foo\n",[a&&b], Unicode property escapes^\d+$vs١, lookarounds/backreferences only the service compilesWhat changed
One requirement in
local-feature-flag-evaluator, proposed, applied and archived on this branch:^/$anchor to the whole input, with no trailing-line-feed exemption (^foo$does not match"foo\n"). An SDK whose engine differs translates the anchor or defers — this is the concrete result-level rule behind posthog-python's strict end anchors.\b/\Boutside a character class, quantified/nested/oversized repetition, and constructs only one engine compiles.not_regexor cohort negation, and local-only evaluation stays unresolved rather than guessing.a{2 }.acceptance/private/local-feature-flag-evaluator.feature, plus strict end-anchor rows on the existing outline.Conservative deferral means more
/flagsrequests and more unresolved local-only results. That is the intended trade against a wrong flag value, and the spec now says so.Uncertain / for reviewers
openspec validate --specs --strictreports the same pre-existing long-requirement findings before and after this change; the change itself validates.Created with PostHog Desktop
🤖 Generated with Claude Code