FA-74011 / Feature flag rollout bucketing / Open access
Scheduled rollout ramp: Active step is reported by sorted position · case 01
Dashboards highlight the wrong schedule row as the active step.
ROOT CAUSE
The reported index is the position in the time-sorted order rather than the original list index.
THE FAILURE
The reported index is the position in the time-sorted order rather than the original list index.
Unsuccessful approach: Looking the step up with list.index returns the first equal entry when steps repeat.
Case contract
steps is a possibly unsorted list of [epoch second, percent or None]. Order steps by time, breaking ties by list position (later entries apply later). Every step with time <= now is active in that order; a None percent is a hold that keeps the previous value; numeric percents are clamped to [0, 100]. Before the first step the percentage is 0. Return [percent, original list index of the last active step or -1].
Why this case matters
Scheduled ramps move production traffic unattended, so the percentage at any instant must be exact.
1 / The failure
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(steps, now):
order = sorted(range(len(steps)), key=lambda i: (steps[i][0], i))
current = 0
active = -1
for pos, i in enumerate(order):
at, pct = steps[i]
if at > now:
break
active = pos
if pct is not None:
current = min(max(pct, 0), 100)
return [current, active]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('step scheduled exactly now is active', [[[0, 5], [60, 25]], 60], [25, 1]),
('unsorted schedule is ordered by time', [[[60, 50], [0, 10], [30, 25]], 45], [25, 2]),
('later entry wins a timestamp tie', [[[0, 5], [30, 50], [30, 20]], 40], [20, 2]),
('hold step keeps previous percentage', [[[0, 25], [30, None]], 40], [25, 1]),
('explicit rollback to zero percent', [[[0, 25], [30, 0]], 40], [0, 1]),
('active index refers to original position', [[[20, 30], [10, 10]], 15], [10, 1]),
('duplicate identical steps report the later entry', [[[10, 10], [10, 10]], 15], [10, 1]),
('ramp schedule sample 1', [[[45, 0], [45, 5], [20, None], [45, 25], [60, -10], [45, None]], 45], [25, 5])],
[('unsorted schedule is ordered by time', [[[60, 50], [0, 10], [30, 25]], 45], [25, 2]),
('later entry wins a timestamp tie', [[[0, 5], [30, 50], [30, 20]], 40], [20, 2]),
('hold step keeps previous percentage', [[[0, 25], [30, None]], 40], [25, 1]),
('explicit rollback to zero percent', [[[0, 25], [30, 0]], 40], [0, 1]),
('over-hundred percent is clamped', [[[0, 150]], 10], [100, 0]),
('active index refers to original position', [[[20, 30], [10, 10]], 15], [10, 1]),
('duplicate identical steps report the later entry', [[[10, 10], [10, 10]], 15], [10, 1]),
('ramp schedule sample 24', [[[60, 100], [20, None], [20, None], [60, -10], [20, 100]], 45], [100, 4])],
[('later entry wins a timestamp tie', [[[0, 5], [30, 50], [30, 20]], 40], [20, 2]),
('hold step keeps previous percentage', [[[0, 25], [30, None]], 40], [25, 1]),
('explicit rollback to zero percent', [[[0, 25], [30, 0]], 40], [0, 1]),
('over-hundred percent is clamped', [[[0, 150]], 10], [100, 0]),
('negative percent is clamped to zero', [[[0, 10], [5, -20]], 10], [0, 1]),
('duplicate identical steps report the later entry', [[[10, 10], [10, 10]], 15], [10, 1]),
('ramp schedule sample 11', [[[0, 5]], -5], [0, -1]),
('ramp schedule sample 48', [[[0, -10], [60, None], [20, -10]], 60], [0, 1])],
[('hold step keeps previous percentage', [[[0, 25], [30, None]], 40], [25, 1]),
('explicit rollback to zero percent', [[[0, 25], [30, 0]], 40], [0, 1]),
('over-hundred percent is clamped', [[[0, 150]], 10], [100, 0]),
('negative percent is clamped to zero', [[[0, 10], [5, -20]], 10], [0, 1]),
('before first step is zero', [[[10, 50]], 5], [0, -1]),
('duplicate identical steps report the later entry', [[[10, 10], [10, 10]], 15], [10, 1]),
('ramp schedule sample 12', [[[0, 120], [10, 25], [0, 0]], 10], [25, 1]),
('ramp schedule sample 16', [[[60, 120]], 60], [100, 0])],
[('explicit rollback to zero percent', [[[0, 25], [30, 0]], 40], [0, 1]),
('over-hundred percent is clamped', [[[0, 150]], 10], [100, 0]),
('negative percent is clamped to zero', [[[0, 10], [5, -20]], 10], [0, 1]),
('before first step is zero', [[[10, 50]], 5], [0, -1]),
('active index refers to original position', [[[20, 30], [10, 10]], 15], [10, 1]),
('duplicate identical steps report the later entry', [[[10, 10], [10, 10]], 15], [10, 1]),
('ramp schedule sample 21', [[], 0], [0, -1]),
('ramp schedule sample 37', [[[60, -10], [10, None], [60, 0]], 25], [0, 1])]]
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 |
|---|---|---|---|
| step scheduled exactly now is active | [25, 1] | [25, 1] | Passed |
| unsorted schedule is ordered by time | [25, 1] | [25, 2] | Failed |
| later entry wins a timestamp tie | [20, 2] | [20, 2] | Passed |
| hold step keeps previous percentage | [25, 1] | [25, 1] | Passed |
| explicit rollback to zero percent | [0, 1] | [0, 1] | Passed |
| active index refers to original position | [10, 0] | [10, 1] | Failed |
| duplicate identical steps report the later entry | [10, 1] | [10, 1] | Passed |
| ramp schedule sample 1 | [25, 4] | [25, 5] | Failed |
SHA-256 / ceb7f02bcc5a813bfc1b3384029c0f40852ddd52ecdc4e7a77ee11cb05329cc9
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
N = 1
observations = []
def solve(steps, now):
order = sorted(range(len(steps)), key=lambda i: (steps[i][0], i))
current = 0
active = -1
for i in order:
at, pct = steps[i]
if at > now:
break
active = steps.index(steps[i])
if pct is not None:
current = min(max(pct, 0), 100)
return [current, active]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[('step scheduled exactly now is active', [[[0, 5], [60, 25]], 60], [25, 1]),
('unsorted schedule is ordered by time', [[[60, 50], [0, 10], [30, 25]], 45], [25, 2]),
('later entry wins a timestamp tie', [[[0, 5], [30, 50], [30, 20]], 40], [20, 2]),
('hold step keeps previous percentage', [[[0, 25], [30, None]], 40], [25, 1]),
('explicit rollback to zero percent', [[[0, 25], [30, 0]], 40], [0, 1]),
('active index refers to original position', [[[20, 30], [10, 10]], 15], [10, 1]),
('duplicate identical steps report the later entry', [[[10, 10], [10, 10]], 15], [10, 1]),
('ramp schedule sample 1', [[[45, 0], [45, 5], [20, None], [45, 25], [60, -10], [45, None]], 45], [25, 5])],
[('unsorted schedule is ordered by time', [[[60, 50], [0, 10], [30, 25]], 45], [25, 2]),
('later entry wins a timestamp tie', [[[0, 5], [30, 50], [30, 20]], 40], [20, 2]),
('hold step keeps previous percentage', [[[0, 25], [30, None]], 40], [25, 1]),
('explicit rollback to zero percent', [[[0, 25], [30, 0]], 40], [0, 1]),
('over-hundred percent is clamped', [[[0, 150]], 10], [100, 0]),
('active index refers to original position', [[[20, 30], [10, 10]], 15], [10, 1]),
('duplicate identical steps report the later entry', [[[10, 10], [10, 10]], 15], [10, 1]),
('ramp schedule sample 24', [[[60, 100], [20, None], [20, None], [60, -10], [20, 100]], 45], [100, 4])],
[('later entry wins a timestamp tie', [[[0, 5], [30, 50], [30, 20]], 40], [20, 2]),
('hold step keeps previous percentage', [[[0, 25], [30, None]], 40], [25, 1]),
('explicit rollback to zero percent', [[[0, 25], [30, 0]], 40], [0, 1]),
('over-hundred percent is clamped', [[[0, 150]], 10], [100, 0]),
('negative percent is clamped to zero', [[[0, 10], [5, -20]], 10], [0, 1]),
('duplicate identical steps report the later entry', [[[10, 10], [10, 10]], 15], [10, 1]),
('ramp schedule sample 11', [[[0, 5]], -5], [0, -1]),
('ramp schedule sample 48', [[[0, -10], [60, None], [20, -10]], 60], [0, 1])],
[('hold step keeps previous percentage', [[[0, 25], [30, None]], 40], [25, 1]),
('explicit rollback to zero percent', [[[0, 25], [30, 0]], 40], [0, 1]),
('over-hundred percent is clamped', [[[0, 150]], 10], [100, 0]),
('negative percent is clamped to zero', [[[0, 10], [5, -20]], 10], [0, 1]),
('before first step is zero', [[[10, 50]], 5], [0, -1]),
('duplicate identical steps report the later entry', [[[10, 10], [10, 10]], 15], [10, 1]),
('ramp schedule sample 12', [[[0, 120], [10, 25], [0, 0]], 10], [25, 1]),
('ramp schedule sample 16', [[[60, 120]], 60], [100, 0])],
[('explicit rollback to zero percent', [[[0, 25], [30, 0]], 40], [0, 1]),
('over-hundred percent is clamped', [[[0, 150]], 10], [100, 0]),
('negative percent is clamped to zero', [[[0, 10], [5, -20]], 10], [0, 1]),
('before first step is zero', [[[10, 50]], 5], [0, -1]),
('active index refers to original position', [[[20, 30], [10, 10]], 15], [10, 1]),
('duplicate identical steps report the later entry', [[[10, 10], [10, 10]], 15], [10, 1]),
('ramp schedule sample 21', [[], 0], [0, -1]),
('ramp schedule sample 37', [[[60, -10], [10, None], [60, 0]], 25], [0, 1])]]
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 |
|---|---|---|---|
| step scheduled exactly now is active | [25, 1] | [25, 1] | Passed |
| unsorted schedule is ordered by time | [25, 2] | [25, 2] | Passed |
| later entry wins a timestamp tie | [20, 2] | [20, 2] | Passed |
| hold step keeps previous percentage | [25, 1] | [25, 1] | Passed |
| explicit rollback to zero percent | [0, 1] | [0, 1] | Passed |
| active index refers to original position | [10, 1] | [10, 1] | Passed |
| duplicate identical steps report the later entry | [10, 0] | [10, 1] | Failed |
| ramp schedule sample 1 | [25, 5] | [25, 5] | Passed |
SHA-256 / fba762d2d4d6803ac78f8792bea4f83938b61c6378fcaa442e16b889c48dde6d
HELD IN THE MEMBER ARCHIVE
The verified repair and its recorded checks are member-only.
This mechanism has 8 recorded checks per implementation. The open-access tier publishes the failure and the unsuccessful fix; the repaired source that passes every check, and the observations that prove it, are available to members.
Every case sharing this mechanism uses the same contract and the same repair, so this one record is held back for all of them.
Member access is invitation-based. Sign in with your invited account to inspect the repair.
Sign in to the archive ↗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:52.681307+00:00.
Case digest / 05d2c1c2c06777a67f9e0bf0b7adca72f770f0cfcd5b2ee84a42e650e743b440