FA-74181 / Feature flag rollout bucketing / Open access
Exposure event deduplication: Suppressed exposures slide the window · case 01
A frequently active user is exposed once and then never again.
ROOT CAUSE
The last-seen time is updated before the suppression check, so every duplicate restarts the window.
VERIFIED REPAIR
Update the window anchor only when an exposure is emitted.
Unsuccessful approach: Anchoring to the very first emission makes every event after one window emit.
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)
prev = last.get(k)
last[k] = t
if prev is not None and t - prev < window:
continue
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]),
('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]),
('exposure stream sample 2',
[[[21, 'a', 'f', 'off'],
[8, 'a', 'g', 'off'],
[3, 'a', 'f', 'off'],
[9, 'b', 'f', 'on'],
[21, 'a', 'g', 'on'],
[24, 'b', 'g', 'off'],
[20, 'b', 'f', 'on']],
0],
[2, 1, 3, 6, 0, 4, 5]),
('exposure stream sample 3',
[[[2, 'b', 'f', 'on'], [6, 'b', 'f', 'on'], [21, 'b', 'f', 'off'], [24, 'a', 'g', 'on']], 10],
[0, 2, 3])],
[('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]),
('exposure stream sample 6',
[[[0, 'a', 'f', 'on'],
[4, 'a', 'f', 'off'],
[5, 'b', 'f', 'off'],
[16, 'a', 'f', 'off'],
[22, 'b', 'f', 'on']],
5],
[0, 1, 2, 3, 4]),
('exposure stream sample 7',
[[[1, 'a', 'f', 'on'],
[3, 'a', 'g', 'off'],
[8, 'b', 'g', 'off'],
[9, 'a', 'f', 'off'],
[11, 'b', 'f', 'on'],
[19, 'a', 'g', 'off'],
[22, 'b', 'f', 'off'],
[24, 'b', 'f', 'on']],
5],
[0, 1, 2, 3, 4, 5, 6, 7]),
('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])],
[('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 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]),
('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
('exposure stream sample 14',
[[[8, 'a', 'g', 'on'],
[10, 'a', 'g', 'off'],
[17, 'b', 'g', 'off'],
[23, 'a', 'g', 'on'],
[24, 'a', 'g', 'on']],
10],
[0, 1, 2, 3]),
('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])],
[('suppressed events do not extend the window',
[[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
[0, 2]),
('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 32',
[[[0, 'b', 'f', 'off'],
[0, 'b', 'g', 'on'],
[1, 'a', 'f', 'on'],
[6, 'b', 'f', 'off'],
[14, 'a', 'g', 'on'],
[18, 'b', 'g', 'on'],
[21, 'b', 'g', 'on'],
[23, 'a', 'f', 'on']],
5],
[0, 1, 2, 3, 4, 5, 7])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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] | [0, 2] | Failed |
| 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 |
| exposure stream sample 1 | [0, 1, 2, 3, 4, 5, 6, 7] | [0, 1, 2, 3, 4, 5, 6, 7] | Passed |
| exposure stream sample 2 | [2, 1, 3, 6, 0, 4, 5] | [2, 1, 3, 6, 0, 4, 5] | Passed |
| exposure stream sample 3 | [0, 2, 3] | [0, 2, 3] | Passed |
SHA-256 / 84f9802d2ea7fc77132a7cee2bbb40e48bb3348f1af93669b0fdea4380968d14
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:
continue
last.setdefault(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]),
('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]),
('exposure stream sample 2',
[[[21, 'a', 'f', 'off'],
[8, 'a', 'g', 'off'],
[3, 'a', 'f', 'off'],
[9, 'b', 'f', 'on'],
[21, 'a', 'g', 'on'],
[24, 'b', 'g', 'off'],
[20, 'b', 'f', 'on']],
0],
[2, 1, 3, 6, 0, 4, 5]),
('exposure stream sample 3',
[[[2, 'b', 'f', 'on'], [6, 'b', 'f', 'on'], [21, 'b', 'f', 'off'], [24, 'a', 'g', 'on']], 10],
[0, 2, 3])],
[('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]),
('exposure stream sample 6',
[[[0, 'a', 'f', 'on'],
[4, 'a', 'f', 'off'],
[5, 'b', 'f', 'off'],
[16, 'a', 'f', 'off'],
[22, 'b', 'f', 'on']],
5],
[0, 1, 2, 3, 4]),
('exposure stream sample 7',
[[[1, 'a', 'f', 'on'],
[3, 'a', 'g', 'off'],
[8, 'b', 'g', 'off'],
[9, 'a', 'f', 'off'],
[11, 'b', 'f', 'on'],
[19, 'a', 'g', 'off'],
[22, 'b', 'f', 'off'],
[24, 'b', 'f', 'on']],
5],
[0, 1, 2, 3, 4, 5, 6, 7]),
('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])],
[('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 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]),
('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
('exposure stream sample 14',
[[[8, 'a', 'g', 'on'],
[10, 'a', 'g', 'off'],
[17, 'b', 'g', 'off'],
[23, 'a', 'g', 'on'],
[24, 'a', 'g', 'on']],
10],
[0, 1, 2, 3]),
('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])],
[('suppressed events do not extend the window',
[[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
[0, 2]),
('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 32',
[[[0, 'b', 'f', 'off'],
[0, 'b', 'g', 'on'],
[1, 'a', 'f', 'on'],
[6, 'b', 'f', 'off'],
[14, 'a', 'g', 'on'],
[18, 'b', 'g', 'on'],
[21, 'b', 'g', 'on'],
[23, 'a', 'f', 'on']],
5],
[0, 1, 2, 3, 4, 5, 7])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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, 2, 3] | [0, 1, 3] | Failed |
| one second before the window closes is suppressed | [0] | [0] | Passed |
| exposure stream sample 1 | [0, 1, 2, 3, 4, 5, 6, 7] | [0, 1, 2, 3, 4, 5, 6, 7] | Passed |
| exposure stream sample 2 | [2, 1, 3, 6, 0, 4, 5] | [2, 1, 3, 6, 0, 4, 5] | Passed |
| exposure stream sample 3 | [0, 2, 3] | [0, 2, 3] | Passed |
SHA-256 / 73f3f45f17bc73352f89300319c6ab85b4b1dd495fe0bc97165b8beb1cdfa75f
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]),
('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]),
('exposure stream sample 2',
[[[21, 'a', 'f', 'off'],
[8, 'a', 'g', 'off'],
[3, 'a', 'f', 'off'],
[9, 'b', 'f', 'on'],
[21, 'a', 'g', 'on'],
[24, 'b', 'g', 'off'],
[20, 'b', 'f', 'on']],
0],
[2, 1, 3, 6, 0, 4, 5]),
('exposure stream sample 3',
[[[2, 'b', 'f', 'on'], [6, 'b', 'f', 'on'], [21, 'b', 'f', 'off'], [24, 'a', 'g', 'on']], 10],
[0, 2, 3])],
[('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]),
('exposure stream sample 6',
[[[0, 'a', 'f', 'on'],
[4, 'a', 'f', 'off'],
[5, 'b', 'f', 'off'],
[16, 'a', 'f', 'off'],
[22, 'b', 'f', 'on']],
5],
[0, 1, 2, 3, 4]),
('exposure stream sample 7',
[[[1, 'a', 'f', 'on'],
[3, 'a', 'g', 'off'],
[8, 'b', 'g', 'off'],
[9, 'a', 'f', 'off'],
[11, 'b', 'f', 'on'],
[19, 'a', 'g', 'off'],
[22, 'b', 'f', 'off'],
[24, 'b', 'f', 'on']],
5],
[0, 1, 2, 3, 4, 5, 6, 7]),
('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])],
[('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 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]),
('zero window never suppresses', [[[0, 'a', 'f', 'on'], [0, 'a', 'f', 'on']], 0], [0, 1]),
('exposure stream sample 14',
[[[8, 'a', 'g', 'on'],
[10, 'a', 'g', 'off'],
[17, 'b', 'g', 'off'],
[23, 'a', 'g', 'on'],
[24, 'a', 'g', 'on']],
10],
[0, 1, 2, 3]),
('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])],
[('suppressed events do not extend the window',
[[[0, 'a', 'f', 'on'], [8, 'a', 'f', 'on'], [12, 'a', 'f', 'on']], 10],
[0, 2]),
('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 32',
[[[0, 'b', 'f', 'off'],
[0, 'b', 'g', 'on'],
[1, 'a', 'f', 'on'],
[6, 'b', 'f', 'off'],
[14, 'a', 'g', 'on'],
[18, 'b', 'g', 'on'],
[21, 'b', 'g', 'on'],
[23, 'a', 'f', 'on']],
5],
[0, 1, 2, 3, 4, 5, 7])]]
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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| 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 |
| exposure stream sample 1 | [0, 1, 2, 3, 4, 5, 6, 7] | [0, 1, 2, 3, 4, 5, 6, 7] | Passed |
| exposure stream sample 2 | [2, 1, 3, 6, 0, 4, 5] | [2, 1, 3, 6, 0, 4, 5] | Passed |
| exposure stream sample 3 | [0, 2, 3] | [0, 2, 3] | Passed |
SHA-256 / 06a75ea0046fae8516c5b6b6c309a6eb468c63ce520b7283e6e0342c97ad0f7b
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.389642+00:00.
Case digest / ef8790a42d9b981530d70c83ba6b284e91d4d29fa2a778b5db62db52655ea64a