Repository navigation
docs(flags): identify the flag definition on locally evaluated flag-called events - #168
Draft
posthog[bot] wants to merge 1 commit into
Draft
posthog[bot] wants to merge 1 commit into
posthog[bot] wants to merge 1 commit into
Conversation
…cally evaluated flag-called events Adds a requirement that $feature_flag_called carries $feature_flag_id and $feature_flag_version for locally evaluated reads, taken from the local flag definition, alongside the remote-metadata source the spec already implied. Applied and archived under openspec/changes/archive/2026-11-03-add-local-flag-called-identity/. Generated-By: PostHog Desktop Task-Id: 112c6ed8-79c4-492d-8bd5-7b3e2d16ed61
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
Nothing in the specs says a
$feature_flag_calledevent identifies which flag definition produced the value.feature-flag-called-trackernames$feature_flag_idand$feature_flag_versiononly in passing, inside the minimal-event allowlist, as "evaluation debug scalars the server/SDK already attaches" — which reads as "whatever the remote response happened to carry". A server SDK evaluating a flag locally therefore had no stated obligation to attach either one.PostHog/posthog-python#1149 closed that gap. A locally evaluated read now takes
idandversionfrom the local flag definition, acrossget_feature_flag(),feature_enabled(),get_feature_flag_result()and the trackedget_feature_flag_payload()path.evaluate_flags()previously set$feature_flag_idbut hardcodedversion=Noneon the belief that local definitions carry no version; they do, so the snapshot record now reads it from the definition.posthog-go still sets both properties only from
evalResult.FlagDetail(remote/flagsmetadata) inposthog.go, so its locally evaluated events omit them. This records posthog-python's behavior as the winner for that divergence.What changed
New requirement Flag definition identity on flag-called events in
feature-flag-called-tracker:$feature_flag_calledcarries$feature_flag_idand$feature_flag_versionfor a locally evaluated read as well as a remote one.versiondoes not suppress the id.No public API change, no change to the dedupe contract, and no change to the minimal-event allowlist — both properties were already on it.
Proposed, applied and archived on this branch per AGENTS.md:
openspec/changes/archive/2026-11-03-add-local-flag-called-identity/.Uncertain
openspecCLI is not installed in this environment, soopenspec validate --specs --strictwas not run; the delta was applied and archived by hand following the format of the existing archived changes.Created with PostHog Desktop
🤖 Generated with Claude Code