FAILURE MAP
← Case archive

FA-11056 / Media playlist state / Open access

Play next insertion order · case 01

Play-next items are inserted before the playing item.

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

ROOT CAUSE

Play-next items are inserted before the playing item.

VERIFIED REPAIR

Preserve the media contract: Insert a batch immediately after the current valid entry, retaining batch order and the playing entry.

Unsuccessful approach: Repeated stack-style insertion reverses the requested batch order.

Case contract

Insert a batch immediately after the current valid entry, retaining batch order and the playing entry.

Why this case matters

A deterministic local media controller stage; metadata and downloaded data are supplied explicitly. No external player, service or codec is required.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(entries, current, added):
    return entries[:current]+list(added)+entries[current:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b'], 0, ['x', 'y'])),['a', 'x', 'y', 'b'])
check('fixture 2',solve(*(['a'], 0, ['x'])),['a', 'x'])
check('fixture 3',solve(*(['a', 'b'], 1, [])),['a', 'b'])
check('fixture 4',solve(*(['a', 'b', 'c'], 1, ['x', 'y'])),['a', 'b', 'x', 'y', 'c'])
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
fixture 1['x', 'y', 'a', 'b']['a', 'x', 'y', 'b']Failed
fixture 2['x', 'a']['a', 'x']Failed
fixture 3['a', 'b']['a', 'b']Passed
fixture 4['a', 'x', 'y', 'b', 'c']['a', 'b', 'x', 'y', 'c']Failed

SHA-256 / c70c6b2d36700dfe1cf8443d1ba9f6b9ef64ef5cff0f58ef012bf97d4e5cdf81

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(entries, current, added):
    return entries[:current+1]+list(reversed(added))+entries[current+1:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b'], 0, ['x', 'y'])),['a', 'x', 'y', 'b'])
check('fixture 2',solve(*(['a'], 0, ['x'])),['a', 'x'])
check('fixture 3',solve(*(['a', 'b'], 1, [])),['a', 'b'])
check('fixture 4',solve(*(['a', 'b', 'c'], 1, ['x', 'y'])),['a', 'b', 'x', 'y', 'c'])
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
fixture 1['a', 'y', 'x', 'b']['a', 'x', 'y', 'b']Failed
fixture 2['a', 'x']['a', 'x']Passed
fixture 3['a', 'b']['a', 'b']Passed
fixture 4['a', 'b', 'y', 'x', 'c']['a', 'b', 'x', 'y', 'c']Failed

SHA-256 / 50b3e22b0369846b7e6f2356beaeb7f08ae73fabfe807a0cf3ec00ef5c2bcd46

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(entries, current, added):
    return entries[:current+1]+list(added)+entries[current+1:]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b'], 0, ['x', 'y'])),['a', 'x', 'y', 'b'])
check('fixture 2',solve(*(['a'], 0, ['x'])),['a', 'x'])
check('fixture 3',solve(*(['a', 'b'], 1, [])),['a', 'b'])
check('fixture 4',solve(*(['a', 'b', 'c'], 1, ['x', 'y'])),['a', 'b', 'x', 'y', 'c'])
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
fixture 1['a', 'x', 'y', 'b']['a', 'x', 'y', 'b']Passed
fixture 2['a', 'x']['a', 'x']Passed
fixture 3['a', 'b']['a', 'b']Passed
fixture 4['a', 'b', 'x', 'y', 'c']['a', 'b', 'x', 'y', 'c']Passed

SHA-256 / cfff96de1eb93f50160ffff07f7771b190ce5d1168e4fcf4226318df53c66e4a

Verification & scope

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:38:44.589761+00:00.

Case digest / 5c3499e8b06e591308878147f1bb8912cde420119c57afe9c532b3ce00ea3562