FAILURE MAP
← Case archive

FA-74186 / Feature flag rollout bucketing / Open access

Exposure event deduplication: An exposure exactly one window later is suppressed · case 01

Hourly exposure refresh drifts because the event at exactly one window is dropped.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

Suppression uses t - last <= window.

VERIFIED REPAIR

Suppress only when t - last < window.

Unsuccessful approach: Shrinking the window by one emits events that are still inside it.

Case contract

events are [t, user, flag, variant] processed in timestamp order (stable for ties). An exposure is emitted unless the same (user, flag, variant) was emitted less than window seconds earlier; suppressed events do not move the window. Return emitted indices in processing order.

Why this case matters

Exposure logs define who entered an experiment; duplicates and gaps both bias analysis.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events, window):
    last = {}
    out = []
    for i in sorted(range(len(events)), key=lambda j: events[j][0]):
        t, user, flag, variant = events[i]
        k = (user, flag, variant)
        if k in last and t - last[k] <= window:
            continue
        last[k] = t
        out.append(i)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('variant change emits immediately', [[[0, 'a', 'f', 'on'], [1, 'a', 'f', 'off']], 10], [0, 1]),
  ('different flags are tracked separately', [[[0, 'a', 'f', 'on'], [1, 'a', 'g', 'on']], 10], [0, 1]),
  ('suppressed events do not extend the window',
   [[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
   [0, 2]),
  ('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('exposure stream sample 1',
   [[[2, 'a', 'f', 'on'],
     [2, 'b', 'g', 'on'],
     [9, 'a', 'g', 'on'],
     [14, 'b', 'g', 'off'],
     [18, 'a', 'g', 'off'],
     [21, 'b', 'f', 'off'],
     [21, 'b', 'f', 'on'],
     [24, 'a', 'f', 'off']],
    5],
   [0, 1, 2, 3, 4, 5, 6, 7])],
 [('different flags are tracked separately', [[[0, 'a', 'f', 'on'], [1, 'a', 'g', 'on']], 10], [0, 1]),
  ('suppressed events do not extend the window',
   [[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
   [0, 2]),
  ('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('exposure stream sample 15',
   [[[12, 'b', 'f', 'off'], [21, 'b', 'f', 'off'], [1, 'a', 'f', 'on']], 10],
   [2, 0]),
  ('exposure stream sample 56',
   [[[0, 'b', 'g', 'off'],
     [1, 'a', 'g', 'on'],
     [10, 'a', 'f', 'off'],
     [13, 'b', 'f', 'off'],
     [17, 'a', 'g', 'on'],
     [21, 'a', 'g', 'on'],
     [22, 'b', 'g', 'off'],
     [23, 'b', 'f', 'off']],
    10],
   [0, 1, 2, 3, 4, 6, 7])],
 [('suppressed events do not extend the window',
   [[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
   [0, 2]),
  ('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('events are processed in time order',
   [[[12, 'a', 'f', 'on'], [0, 'a', 'f', 'on'], [5, 'b', 'f', 'on']], 10],
   [1, 2, 0]),
  ('exposure stream sample 11',
   [[[10, 'b', 'g', 'on'], [19, 'b', 'g', 'off'], [9, 'b', 'f', 'on'], [16, 'a', 'f', 'on']], 10],
   [2, 0, 3, 1]),
  ('exposure stream sample 12',
   [[[7, 'a', 'f', 'off'],
     [13, 'a', 'g', 'off'],
     [3, 'a', 'g', 'off'],
     [4, 'a', 'f', 'on'],
     [3, 'a', 'g', 'off']],
    10],
   [2, 3, 0, 1]),
  ('exposure stream sample 21',
   [[[4, 'a', 'g', 'on'],
     [5, 'a', 'g', 'on'],
     [22, 'a', 'f', 'off'],
     [4, 'a', 'g', 'on'],
     [19, 'a', 'f', 'off'],
     [8, 'a', 'g', 'on'],
     [11, 'a', 'f', 'off']],
    5],
   [0, 6, 4])],
 [('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('events are processed in time order',
   [[[12, 'a', 'f', 'on'], [0, 'a', 'f', 'on'], [5, 'b', 'f', 'on']], 10],
   [1, 2, 0]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('exposure stream sample 16',
   [[[4, 'a', 'g', 'off'],
     [21, 'a', 'g', 'off'],
     [20, 'a', 'g', 'off'],
     [23, 'b', 'g', 'on'],
     [19, 'b', 'f', 'on'],
     [22, 'b', 'f', 'on'],
     [10, 'b', 'f', 'on']],
    0],
   [0, 6, 4, 2, 1, 5, 3]),
  ('exposure stream sample 17',
   [[[6, 'a', 'g', 'on'],
     [22, 'b', 'g', 'off'],
     [22, 'b', 'f', 'off'],
     [10, 'a', 'f', 'on'],
     [9, 'b', 'f', 'off'],
     [23, 'a', 'g', 'off'],
     [9, 'b', 'f', 'off'],
     [2, 'b', 'g', 'on']],
    5],
   [7, 0, 4, 3, 1, 2, 5]),
  ('exposure stream sample 28',
   [[[8, 'b', 'f', 'off'],
     [9, 'a', 'f', 'on'],
     [14, 'b', 'g', 'on'],
     [17, 'b', 'f', 'off'],
     [22, 'a', 'g', 'on']],
    10],
   [0, 1, 2, 4])],
 [('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('events are processed in time order',
   [[[12, 'a', 'f', 'on'], [0, 'a', 'f', 'on'], [5, 'b', 'f', 'on']], 10],
   [1, 2, 0]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('users are tracked separately',
   [[[0, 'a', 'f', 'on'], [1, 'b', 'f', 'on'], [2, 'a', 'f', 'on']], 5],
   [0, 1]),
  ('exposure stream sample 21',
   [[[4, 'a', 'g', 'on'],
     [5, 'a', 'g', 'on'],
     [22, 'a', 'f', 'off'],
     [4, 'a', 'g', 'on'],
     [19, 'a', 'f', 'off'],
     [8, 'a', 'g', 'on'],
     [11, 'a', 'f', 'off']],
    5],
   [0, 6, 4]),
  ('exposure stream sample 22',
   [[[7, 'a', 'g', 'off'],
     [0, 'a', 'g', 'on'],
     [9, 'b', 'g', 'on'],
     [16, 'a', 'g', 'off'],
     [5, 'a', 'g', 'off']],
    0],
   [1, 4, 0, 2, 3]),
  ('exposure stream sample 51',
   [[[2, 'a', 'f', 'on'],
     [10, 'a', 'g', 'off'],
     [15, 'a', 'f', 'off'],
     [19, 'b', 'f', 'off'],
     [22, 'b', 'f', 'on'],
     [24, 'a', 'f', 'off']],
    10],
   [0, 1, 2, 3, 4])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
variant change emits immediately[0, 1][0, 1]Passed
different flags are tracked separately[0, 1][0, 1]Passed
suppressed events do not extend the window[0, 2][0, 2]Passed
duplicate inside a re-anchored window is suppressed[0, 1, 3][0, 1, 3]Passed
one second before the window closes is suppressed[0][0]Passed
exactly one window later emits again[0][0, 1]Failed
zero window never suppresses[0][0, 1]Failed
exposure stream sample 1[0, 1, 2, 3, 4, 5, 6, 7][0, 1, 2, 3, 4, 5, 6, 7]Passed

SHA-256 / eb8d4d8ed29f66b8f02ed5c9aaad5594a8fdb9e8b106fe2f09ede61ee37b6a96

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events, window):
    last = {}
    out = []
    for i in sorted(range(len(events)), key=lambda j: events[j][0]):
        t, user, flag, variant = events[i]
        k = (user, flag, variant)
        if k in last and t - last[k] < window - 1:
            continue
        last[k] = t
        out.append(i)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('variant change emits immediately', [[[0, 'a', 'f', 'on'], [1, 'a', 'f', 'off']], 10], [0, 1]),
  ('different flags are tracked separately', [[[0, 'a', 'f', 'on'], [1, 'a', 'g', 'on']], 10], [0, 1]),
  ('suppressed events do not extend the window',
   [[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
   [0, 2]),
  ('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('exposure stream sample 1',
   [[[2, 'a', 'f', 'on'],
     [2, 'b', 'g', 'on'],
     [9, 'a', 'g', 'on'],
     [14, 'b', 'g', 'off'],
     [18, 'a', 'g', 'off'],
     [21, 'b', 'f', 'off'],
     [21, 'b', 'f', 'on'],
     [24, 'a', 'f', 'off']],
    5],
   [0, 1, 2, 3, 4, 5, 6, 7])],
 [('different flags are tracked separately', [[[0, 'a', 'f', 'on'], [1, 'a', 'g', 'on']], 10], [0, 1]),
  ('suppressed events do not extend the window',
   [[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
   [0, 2]),
  ('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('exposure stream sample 15',
   [[[12, 'b', 'f', 'off'], [21, 'b', 'f', 'off'], [1, 'a', 'f', 'on']], 10],
   [2, 0]),
  ('exposure stream sample 56',
   [[[0, 'b', 'g', 'off'],
     [1, 'a', 'g', 'on'],
     [10, 'a', 'f', 'off'],
     [13, 'b', 'f', 'off'],
     [17, 'a', 'g', 'on'],
     [21, 'a', 'g', 'on'],
     [22, 'b', 'g', 'off'],
     [23, 'b', 'f', 'off']],
    10],
   [0, 1, 2, 3, 4, 6, 7])],
 [('suppressed events do not extend the window',
   [[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
   [0, 2]),
  ('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('events are processed in time order',
   [[[12, 'a', 'f', 'on'], [0, 'a', 'f', 'on'], [5, 'b', 'f', 'on']], 10],
   [1, 2, 0]),
  ('exposure stream sample 11',
   [[[10, 'b', 'g', 'on'], [19, 'b', 'g', 'off'], [9, 'b', 'f', 'on'], [16, 'a', 'f', 'on']], 10],
   [2, 0, 3, 1]),
  ('exposure stream sample 12',
   [[[7, 'a', 'f', 'off'],
     [13, 'a', 'g', 'off'],
     [3, 'a', 'g', 'off'],
     [4, 'a', 'f', 'on'],
     [3, 'a', 'g', 'off']],
    10],
   [2, 3, 0, 1]),
  ('exposure stream sample 21',
   [[[4, 'a', 'g', 'on'],
     [5, 'a', 'g', 'on'],
     [22, 'a', 'f', 'off'],
     [4, 'a', 'g', 'on'],
     [19, 'a', 'f', 'off'],
     [8, 'a', 'g', 'on'],
     [11, 'a', 'f', 'off']],
    5],
   [0, 6, 4])],
 [('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('events are processed in time order',
   [[[12, 'a', 'f', 'on'], [0, 'a', 'f', 'on'], [5, 'b', 'f', 'on']], 10],
   [1, 2, 0]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('exposure stream sample 16',
   [[[4, 'a', 'g', 'off'],
     [21, 'a', 'g', 'off'],
     [20, 'a', 'g', 'off'],
     [23, 'b', 'g', 'on'],
     [19, 'b', 'f', 'on'],
     [22, 'b', 'f', 'on'],
     [10, 'b', 'f', 'on']],
    0],
   [0, 6, 4, 2, 1, 5, 3]),
  ('exposure stream sample 17',
   [[[6, 'a', 'g', 'on'],
     [22, 'b', 'g', 'off'],
     [22, 'b', 'f', 'off'],
     [10, 'a', 'f', 'on'],
     [9, 'b', 'f', 'off'],
     [23, 'a', 'g', 'off'],
     [9, 'b', 'f', 'off'],
     [2, 'b', 'g', 'on']],
    5],
   [7, 0, 4, 3, 1, 2, 5]),
  ('exposure stream sample 28',
   [[[8, 'b', 'f', 'off'],
     [9, 'a', 'f', 'on'],
     [14, 'b', 'g', 'on'],
     [17, 'b', 'f', 'off'],
     [22, 'a', 'g', 'on']],
    10],
   [0, 1, 2, 4])],
 [('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('events are processed in time order',
   [[[12, 'a', 'f', 'on'], [0, 'a', 'f', 'on'], [5, 'b', 'f', 'on']], 10],
   [1, 2, 0]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('users are tracked separately',
   [[[0, 'a', 'f', 'on'], [1, 'b', 'f', 'on'], [2, 'a', 'f', 'on']], 5],
   [0, 1]),
  ('exposure stream sample 21',
   [[[4, 'a', 'g', 'on'],
     [5, 'a', 'g', 'on'],
     [22, 'a', 'f', 'off'],
     [4, 'a', 'g', 'on'],
     [19, 'a', 'f', 'off'],
     [8, 'a', 'g', 'on'],
     [11, 'a', 'f', 'off']],
    5],
   [0, 6, 4]),
  ('exposure stream sample 22',
   [[[7, 'a', 'g', 'off'],
     [0, 'a', 'g', 'on'],
     [9, 'b', 'g', 'on'],
     [16, 'a', 'g', 'off'],
     [5, 'a', 'g', 'off']],
    0],
   [1, 4, 0, 2, 3]),
  ('exposure stream sample 51',
   [[[2, 'a', 'f', 'on'],
     [10, 'a', 'g', 'off'],
     [15, 'a', 'f', 'off'],
     [19, 'b', 'f', 'off'],
     [22, 'b', 'f', 'on'],
     [24, 'a', 'f', 'off']],
    10],
   [0, 1, 2, 3, 4])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
variant change emits immediately[0, 1][0, 1]Passed
different flags are tracked separately[0, 1][0, 1]Passed
suppressed events do not extend the window[0, 2][0, 2]Passed
duplicate inside a re-anchored window is suppressed[0, 1, 3][0, 1, 3]Passed
one second before the window closes is suppressed[0, 1][0]Failed
exactly one window later emits again[0, 1][0, 1]Passed
zero window never suppresses[0, 1][0, 1]Passed
exposure stream sample 1[0, 1, 2, 3, 4, 5, 6, 7][0, 1, 2, 3, 4, 5, 6, 7]Passed

SHA-256 / 37277e068b5829a000aa7ae6bbea805c573e0cabda67994f41973ce2d20a4cac

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events, window):
    last = {}
    out = []
    for i in sorted(range(len(events)), key=lambda j: events[j][0]):
        t, user, flag, variant = events[i]
        k = (user, flag, variant)
        if k in last and t - last[k] < window:
            continue
        last[k] = t
        out.append(i)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('variant change emits immediately', [[[0, 'a', 'f', 'on'], [1, 'a', 'f', 'off']], 10], [0, 1]),
  ('different flags are tracked separately', [[[0, 'a', 'f', 'on'], [1, 'a', 'g', 'on']], 10], [0, 1]),
  ('suppressed events do not extend the window',
   [[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
   [0, 2]),
  ('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('exposure stream sample 1',
   [[[2, 'a', 'f', 'on'],
     [2, 'b', 'g', 'on'],
     [9, 'a', 'g', 'on'],
     [14, 'b', 'g', 'off'],
     [18, 'a', 'g', 'off'],
     [21, 'b', 'f', 'off'],
     [21, 'b', 'f', 'on'],
     [24, 'a', 'f', 'off']],
    5],
   [0, 1, 2, 3, 4, 5, 6, 7])],
 [('different flags are tracked separately', [[[0, 'a', 'f', 'on'], [1, 'a', 'g', 'on']], 10], [0, 1]),
  ('suppressed events do not extend the window',
   [[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
   [0, 2]),
  ('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('exposure stream sample 15',
   [[[12, 'b', 'f', 'off'], [21, 'b', 'f', 'off'], [1, 'a', 'f', 'on']], 10],
   [2, 0]),
  ('exposure stream sample 56',
   [[[0, 'b', 'g', 'off'],
     [1, 'a', 'g', 'on'],
     [10, 'a', 'f', 'off'],
     [13, 'b', 'f', 'off'],
     [17, 'a', 'g', 'on'],
     [21, 'a', 'g', 'on'],
     [22, 'b', 'g', 'off'],
     [23, 'b', 'f', 'off']],
    10],
   [0, 1, 2, 3, 4, 6, 7])],
 [('suppressed events do not extend the window',
   [[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
   [0, 2]),
  ('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('events are processed in time order',
   [[[12, 'a', 'f', 'on'], [0, 'a', 'f', 'on'], [5, 'b', 'f', 'on']], 10],
   [1, 2, 0]),
  ('exposure stream sample 11',
   [[[10, 'b', 'g', 'on'], [19, 'b', 'g', 'off'], [9, 'b', 'f', 'on'], [16, 'a', 'f', 'on']], 10],
   [2, 0, 3, 1]),
  ('exposure stream sample 12',
   [[[7, 'a', 'f', 'off'],
     [13, 'a', 'g', 'off'],
     [3, 'a', 'g', 'off'],
     [4, 'a', 'f', 'on'],
     [3, 'a', 'g', 'off']],
    10],
   [2, 3, 0, 1]),
  ('exposure stream sample 21',
   [[[4, 'a', 'g', 'on'],
     [5, 'a', 'g', 'on'],
     [22, 'a', 'f', 'off'],
     [4, 'a', 'g', 'on'],
     [19, 'a', 'f', 'off'],
     [8, 'a', 'g', 'on'],
     [11, 'a', 'f', 'off']],
    5],
   [0, 6, 4])],
 [('duplicate inside a re-anchored window is suppressed',
   [[[0, 'a', 'f', 'on'], [12, 'a', 'f', 'on'], [15, 'a', 'f', 'on'], [25, 'a', 'f', 'on']], 10],
   [0, 1, 3]),
  ('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('events are processed in time order',
   [[[12, 'a', 'f', 'on'], [0, 'a', 'f', 'on'], [5, 'b', 'f', 'on']], 10],
   [1, 2, 0]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('exposure stream sample 16',
   [[[4, 'a', 'g', 'off'],
     [21, 'a', 'g', 'off'],
     [20, 'a', 'g', 'off'],
     [23, 'b', 'g', 'on'],
     [19, 'b', 'f', 'on'],
     [22, 'b', 'f', 'on'],
     [10, 'b', 'f', 'on']],
    0],
   [0, 6, 4, 2, 1, 5, 3]),
  ('exposure stream sample 17',
   [[[6, 'a', 'g', 'on'],
     [22, 'b', 'g', 'off'],
     [22, 'b', 'f', 'off'],
     [10, 'a', 'f', 'on'],
     [9, 'b', 'f', 'off'],
     [23, 'a', 'g', 'off'],
     [9, 'b', 'f', 'off'],
     [2, 'b', 'g', 'on']],
    5],
   [7, 0, 4, 3, 1, 2, 5]),
  ('exposure stream sample 28',
   [[[8, 'b', 'f', 'off'],
     [9, 'a', 'f', 'on'],
     [14, 'b', 'g', 'on'],
     [17, 'b', 'f', 'off'],
     [22, 'a', 'g', 'on']],
    10],
   [0, 1, 2, 4])],
 [('one second before the window closes is suppressed',
   [[[0, 'b', 'g', 'off'], [9, 'b', 'g', 'off']], 10],
   [0]),
  ('exactly one window later emits again', [[[0, 'a', 'f', 'on'], [10, 'a', 'f', 'on']], 10], [0, 1]),
  ('events are processed in time order',
   [[[12, 'a', 'f', 'on'], [0, 'a', 'f', 'on'], [5, 'b', 'f', 'on']], 10],
   [1, 2, 0]),
  ('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
  ('users are tracked separately',
   [[[0, 'a', 'f', 'on'], [1, 'b', 'f', 'on'], [2, 'a', 'f', 'on']], 5],
   [0, 1]),
  ('exposure stream sample 21',
   [[[4, 'a', 'g', 'on'],
     [5, 'a', 'g', 'on'],
     [22, 'a', 'f', 'off'],
     [4, 'a', 'g', 'on'],
     [19, 'a', 'f', 'off'],
     [8, 'a', 'g', 'on'],
     [11, 'a', 'f', 'off']],
    5],
   [0, 6, 4]),
  ('exposure stream sample 22',
   [[[7, 'a', 'g', 'off'],
     [0, 'a', 'g', 'on'],
     [9, 'b', 'g', 'on'],
     [16, 'a', 'g', 'off'],
     [5, 'a', 'g', 'off']],
    0],
   [1, 4, 0, 2, 3]),
  ('exposure stream sample 51',
   [[[2, 'a', 'f', 'on'],
     [10, 'a', 'g', 'off'],
     [15, 'a', 'f', 'off'],
     [19, 'b', 'f', 'off'],
     [22, 'b', 'f', 'on'],
     [24, 'a', 'f', 'off']],
    10],
   [0, 1, 2, 3, 4])]]
for label, args, expected in fixtures[N - 1]:
    check(label, solve(*args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
variant change emits immediately[0, 1][0, 1]Passed
different flags are tracked separately[0, 1][0, 1]Passed
suppressed events do not extend the window[0, 2][0, 2]Passed
duplicate inside a re-anchored window is suppressed[0, 1, 3][0, 1, 3]Passed
one second before the window closes is suppressed[0][0]Passed
exactly one window later emits again[0, 1][0, 1]Passed
zero window never suppresses[0, 1][0, 1]Passed
exposure stream sample 1[0, 1, 2, 3, 4, 5, 6, 7][0, 1, 2, 3, 4, 5, 6, 7]Passed

SHA-256 / 846804c80e7a5c4b8357dbeafb6f9ca14fe8279a0ceaf9f18b7eeb474acd2ff6

Verification & scope

A deterministic toy flag-evaluation model with a stipulated contract; it does not reproduce any vendor SDK byte for byte. This reproducer isolates one failure mechanism. Results cover the supplied fixtures. Variants within a family share a test contract and should remain grouped when constructing evaluation splits. Related mechanisms with a shared evaluation_group must also remain together; these controlled models are not independent production incidents.

Observations recorded using Python 3.12.14 at 2026-09-29T14:48:54.394121+00:00.

Case digest / 94040bfbd4cf4cafe947b92b35e3f9445fca0af49d06f51f7421ee851237cec4