[no-ticket] Flag reinvented feature-flag exposure tracking in review - #48
Draft
bockets wants to merge 1 commit into
Draft
[no-ticket] Flag reinvented feature-flag exposure tracking in review#48bockets wants to merge 1 commit into
bockets wants to merge 1 commit into
Conversation
The frontend already tracks a feature flag's exposure in Segment/Amplitude generically via ENABLED_FEATURES_TO_TRACK in frontend/utils/analytics.ts — registering a flag there identifies it as a user trait and includes it in the page event's enabled_features array, with no per-component code. A recent PR instead added a bespoke useTrackSegmentEvent call per component to record the same signal (whether a reader saw something gated by the flag), which the existing mechanism already covers. Add a shared rule instructing both the Codex first-pass and Claude synthesize prompts to flag new exposure-only tracking of a flag's on/off state and suggest the existing registry instead, while leaving genuine interaction events and content-specific properties out of scope.
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.
no-ticket
What
Adds a shared review rule: when a diff adds a new Segment/Amplitude event whose sole purpose is recording that a reader saw something gated by a feature flag, check whether adding that flag to
ENABLED_FEATURES_TO_TRACK(frontend/utils/analytics.ts) would capture the same signal before treating the bespoke event as necessary.That list already drives generic flag-exposure tracking — registering a flag/path constraint there identifies it as a Segment/Amplitude user trait and includes it in the page event's
enabled_featuresarray, with no per-component code. A recent PR added auseTrackSegmentEventcall to two components to record the same thing this mechanism already covers.prompts/_shared/analytics-tracking-rules.mdcodex-first-pass.md,claude-synthesize.md, andclaude-synthesize-thesis-first.mdas a new step, after the rename-compatibility checkVerified
scripts/resolve-prompts.shresolves the new{{@path}}marker with no leftover markers in either arm's prompt.