Skip to content

[no-ticket] Flag reinvented feature-flag exposure tracking in review - #48

Draft
bockets wants to merge 1 commit into
mainfrom
flag-existing-analytics-tracking-helper
Draft

[no-ticket] Flag reinvented feature-flag exposure tracking in review#48
bockets wants to merge 1 commit into
mainfrom
flag-existing-analytics-tracking-helper

Conversation

@bockets

@bockets bockets commented Sep 2, 2026

Copy link
Copy Markdown
Member

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_features array, with no per-component code. A recent PR added a useTrackSegmentEvent call to two components to record the same thing this mechanism already covers.

  • New shared rule file: prompts/_shared/analytics-tracking-rules.md
  • Wired into codex-first-pass.md, claude-synthesize.md, and claude-synthesize-thesis-first.md as a new step, after the rename-compatibility check
  • Scoped to exposure-only tracking of a flag's on/off state — genuine interaction events (clicks, submissions) and properties tied to specific content are explicitly out of scope

Verified scripts/resolve-prompts.sh resolves the new {{@path}} marker with no leftover markers in either arm's prompt.

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.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant