Skip to content

feat: Split summary counters and suppress individual events for override-affected evaluations - #452

Draft
kinyoklion wants to merge 1 commit into
rlamb/overrides-ruby-store-overlayfrom
rlamb/overrides-ruby-events
Draft

kinyoklion wants to merge 1 commit into
rlamb/overrides-ruby-store-overlayfrom
rlamb/overrides-ruby-events

Conversation

@kinyoklion

@kinyoklion kinyoklion commented Sep 25, 2026 •

Copy link
Copy Markdown
Member

Summary

This PR is stacked on #451 because it uses the override store and the marking that PR wires into the client.

This change carries the override-affected marking from evaluation into analytics events, as the OVERRIDE specification requires. Event handling keys on the marking scalar that the client hands to the event processor, not on the evaluation reason.

EvalEvent and record_eval_event gain an override_affected flag. The client sets it from the evaluation result for the evaluated flag, from each prerequisite record's own marking for prerequisite evaluations, and from the flag's own marker when an evaluation raises. An unknown flag is never marked.

The event dispatcher produces no individual feature event and no debug event for a marked evaluation, whatever the flag's configuration requests. Marked evaluations appear in summary events only. The summarizer keys counters by version, variation, and the marker, so override-affected and other evaluations of the same flag, variation, and version accumulate into separate counters. The summary event writes overrideAffected: true on the marked counters only, following the existing unknown marker. Event ingestion must accept that property on summary counters before release.

all_flags_state presents an override-affected flag with trackEvents false, trackReason false, and no debugEventsUntilDate, so a consumer bootstrapped from the state sends no individual events for it. The flag, its value, its version, and its reason stay in the state.

The specification vectors now also check the summary marker the client hands to the event processor for each evaluation.

Verification: processor specs (no feature event, no debug event, marked counter, counter split, unmarked counters unchanged, marked prerequisite record), summarizer spec (split by marker), client specs (record arguments for direct, segment, prerequisite, unknown, and error cases; all-flags tracking fields including experiment tracking and details-only-for-tracked), and end-to-end payload specs through the real event processor (index plus marked summary only for an overridden flag, individual events for an unaffected prerequisite inside a marked evaluation, ordinary events when nothing is overridden). Full suite and RuboCop are clean. Each new spec was checked against a deliberate defect in the code it covers.

The existing FDv1 and FDv2 file data sources keep their current behavior. This series does not change them; the override feature is additive.

SDK-3249


Note

Overview
Adds override_affected to evaluation analytics so OVERRIDE-marked evaluations are counted in summary events separately and never emitted as individual feature or debug events.

EvalEvent / record_eval_event take the new flag; the client sets it from evaluation results (including per-prerequisite marking). The dispatcher skips full and debug events when it is true but still updates summaries. The summarizer buckets counters by version, variation, and the marker; serialized summaries set overrideAffected: true only on marked buckets. all_flags_state clears trackEvents, trackReason, and debugEventsUntilDate for override-affected flags so bootstrapped clients do not send individual events for them.

Specs cover the processor, summarizer, client recording, end-to-end payloads, and vector summaryOverrideAffected expectations.

Reviewed by Cursor Bugbot for commit 356fee9. Bugbot is set up for automated code reviews on this repo. Configure here.

@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-store-overlay branch from e2df553 to e4d05bb Compare September 25, 2026 22:51
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-events branch from 89f544e to be39b66 Compare September 25, 2026 22:51
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-store-overlay branch from e4d05bb to 09915cc Compare September 28, 2026 20:36
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-events branch from be39b66 to 6ff51f4 Compare September 28, 2026 20:36
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-store-overlay branch from 09915cc to 4f4c242 Compare October 1, 2026 23:43
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-events branch from 6ff51f4 to e0dd518 Compare October 1, 2026 23:44
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-store-overlay branch from 4f4c242 to 54278dc Compare October 3, 2026 00:46
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-events branch from e0dd518 to 356fee9 Compare October 3, 2026 00:46
@kinyoklion

Copy link
Copy Markdown
Member Author

bugbot review

@cursor cursor Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Bugbot reviewed your changes and found no new issues!

Comment @cursor review or bugbot run to trigger another review on this PR

Reviewed by Cursor Bugbot for commit 356fee9. Configure here.

@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-store-overlay branch from 54278dc to 0dee958 Compare October 3, 2026 01:54
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-events branch from 356fee9 to de05ef4 Compare October 3, 2026 01:54
…ide-affected evaluations

Carries the override-affected marking from evaluation into analytics
events, as the OVERRIDE specification requires.

- `EvalEvent` and `record_eval_event` carry an `override_affected` flag.
  The client sets it from the evaluation result for the evaluated flag,
  from each prerequisite record's own marking for prerequisite
  evaluations, and from the flag's own marker when an evaluation raises.
  An unknown flag is never marked.
- The event dispatcher produces no individual feature event and no debug
  event for a marked evaluation, whatever the flag's configuration
  requests. Marked evaluations appear in summary events only.
- The summarizer keys counters by version, variation, and the marker, so
  override-affected and other evaluations of the same flag, variation, and
  version accumulate into separate counters. The summary event writes
  `overrideAffected: true` on the marked counters only, like the existing
  `unknown` marker.
- `all_flags_state` presents an override-affected flag with `trackEvents`
  false, `trackReason` false, and no `debugEventsUntilDate`. The flag, its
  value, its version, and its reason stay in the state.

The specification vectors now also check the summary marker the client
hands to the event processor for each evaluation.

Flag overrides are currently experimental and subject to change.
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-store-overlay branch from 0dee958 to 18341e8 Compare October 8, 2026 16:54
@kinyoklion
kinyoklion force-pushed the rlamb/overrides-ruby-events branch from de05ef4 to aae4984 Compare October 8, 2026 16:54

This branch has not been deployed

No deployments
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