FA-74176 / Feature flag rollout bucketing / Open access
Exposure event deduplication: Variant is missing from the dedupe key · case 01
A user re-bucketed to another variant within the window has no exposure logged for the new variant.
ROOT CAUSE
The dedupe key is (user, flag), ignoring the variant.
VERIFIED REPAIR
Deduplicate on (user, flag, variant).
Unsuccessful approach: Keying on (user, variant) merges exposures of different flags.
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)
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])],
[('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]),
('exposure stream sample 23',
[[[1, 'a', 'g', 'on'],
[6, 'a', 'g', 'on'],
[9, 'b', 'f', 'on'],
[12, 'a', 'f', 'on'],
[13, 'a', 'f', 'off'],
[16, 'a', 'g', 'off'],
[20, 'b', 'f', 'off']],
10],
[0, 2, 3, 4, 5, 6]),
('exposure stream sample 30',
[[[1, 'a', 'f', 'off'],
[5, 'a', 'g', 'on'],
[13, 'a', 'f', 'off'],
[7, 'a', 'f', 'on'],
[20, 'a', 'f', 'on']],
5],
[0, 1, 3, 2, 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 44',
[[[2, 'b', 'f', 'on'],
[5, 'b', 'g', 'off'],
[7, 'b', 'g', 'on'],
[10, 'a', 'g', 'off'],
[10, 'a', 'g', 'on']],
10],
[0, 1, 2, 3, 4]),
('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])],
[('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 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 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 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])],
[('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 24',
[[[13, 'b', 'g', 'on'],
[22, 'a', 'g', 'off'],
[7, 'a', 'f', 'on'],
[8, 'b', 'f', 'off'],
[5, 'a', 'f', 'off'],
[17, 'b', 'f', 'off'],
[5, 'a', 'g', 'off'],
[9, 'a', 'g', 'on']],
5],
[4, 6, 2, 3, 7, 0, 5, 1]),
('exposure stream sample 40',
[[[5, 'b', 'g', 'on'],
[22, 'a', 'g', 'on'],
[20, 'b', 'g', 'off'],
[1, 'b', 'g', 'off'],
[22, 'a', 'f', 'off'],
[9, 'b', 'f', 'on'],
[15, 'a', 'f', 'on'],
[5, 'b', 'f', 'off']],
10],
[3, 0, 7, 5, 6, 2, 1, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variant change emits immediately | [0] | [0, 1] | Failed |
| 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, 7] | [0, 1, 2, 3, 4, 5, 6, 7] | Failed |
| 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 / c69684ebea119550c6f45cfd39455697000dfd0e35709825bf962aaf55e6e070
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, 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])],
[('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]),
('exposure stream sample 23',
[[[1, 'a', 'g', 'on'],
[6, 'a', 'g', 'on'],
[9, 'b', 'f', 'on'],
[12, 'a', 'f', 'on'],
[13, 'a', 'f', 'off'],
[16, 'a', 'g', 'off'],
[20, 'b', 'f', 'off']],
10],
[0, 2, 3, 4, 5, 6]),
('exposure stream sample 30',
[[[1, 'a', 'f', 'off'],
[5, 'a', 'g', 'on'],
[13, 'a', 'f', 'off'],
[7, 'a', 'f', 'on'],
[20, 'a', 'f', 'on']],
5],
[0, 1, 3, 2, 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 44',
[[[2, 'b', 'f', 'on'],
[5, 'b', 'g', 'off'],
[7, 'b', 'g', 'on'],
[10, 'a', 'g', 'off'],
[10, 'a', 'g', 'on']],
10],
[0, 1, 2, 3, 4]),
('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])],
[('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 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 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 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])],
[('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 24',
[[[13, 'b', 'g', 'on'],
[22, 'a', 'g', 'off'],
[7, 'a', 'f', 'on'],
[8, 'b', 'f', 'off'],
[5, 'a', 'f', 'off'],
[17, 'b', 'f', 'off'],
[5, 'a', 'g', 'off'],
[9, 'a', 'g', 'on']],
5],
[4, 6, 2, 3, 7, 0, 5, 1]),
('exposure stream sample 40',
[[[5, 'b', 'g', 'on'],
[22, 'a', 'g', 'on'],
[20, 'b', 'g', 'off'],
[1, 'b', 'g', 'off'],
[22, 'a', 'f', 'off'],
[9, 'b', 'f', 'on'],
[15, 'a', 'f', 'on'],
[5, 'b', 'f', 'off']],
10],
[3, 0, 7, 5, 6, 2, 1, 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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| variant change emits immediately | [0, 1] | [0, 1] | Passed |
| different flags are tracked separately | [0] | [0, 1] | Failed |
| 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 / 6b1f131f1efcdd60bf9a082d9f1bfffa528af916c8a12f03ec407c4a80267b40
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])],
[('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]),
('exposure stream sample 23',
[[[1, 'a', 'g', 'on'],
[6, 'a', 'g', 'on'],
[9, 'b', 'f', 'on'],
[12, 'a', 'f', 'on'],
[13, 'a', 'f', 'off'],
[16, 'a', 'g', 'off'],
[20, 'b', 'f', 'off']],
10],
[0, 2, 3, 4, 5, 6]),
('exposure stream sample 30',
[[[1, 'a', 'f', 'off'],
[5, 'a', 'g', 'on'],
[13, 'a', 'f', 'off'],
[7, 'a', 'f', 'on'],
[20, 'a', 'f', 'on']],
5],
[0, 1, 3, 2, 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 44',
[[[2, 'b', 'f', 'on'],
[5, 'b', 'g', 'off'],
[7, 'b', 'g', 'on'],
[10, 'a', 'g', 'off'],
[10, 'a', 'g', 'on']],
10],
[0, 1, 2, 3, 4]),
('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])],
[('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 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 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 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])],
[('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 24',
[[[13, 'b', 'g', 'on'],
[22, 'a', 'g', 'off'],
[7, 'a', 'f', 'on'],
[8, 'b', 'f', 'off'],
[5, 'a', 'f', 'off'],
[17, 'b', 'f', 'off'],
[5, 'a', 'g', 'off'],
[9, 'a', 'g', 'on']],
5],
[4, 6, 2, 3, 7, 0, 5, 1]),
('exposure stream sample 40',
[[[5, 'b', 'g', 'on'],
[22, 'a', 'g', 'on'],
[20, 'b', 'g', 'off'],
[1, 'b', 'g', 'off'],
[22, 'a', 'f', 'off'],
[9, 'b', 'f', 'on'],
[15, 'a', 'f', 'on'],
[5, 'b', 'f', 'off']],
10],
[3, 0, 7, 5, 6, 2, 1, 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 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 / ae70fee24af5e8dbd1df7ed963b6dd70e007a363e8f0958d5fc16e8c0e70afd1
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.256300+00:00.
Case digest / dabfb48b443f9247f447e293168cb107ee3f63ee89ceffcddfd7097b8ae24821