FAILURE MAP
← Case archive

FA-11041 / Media playlist state / Open access

Remove playing selects successor · case 01

Deleting the last or only playing item retains an out-of-range selection.

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

ROOT CAUSE

Deleting the last or only playing item retains an out-of-range selection.

THE FAILURE

Deleting the last or only playing item retains an out-of-range selection.

Unsuccessful approach: Always selecting the predecessor skips a valid successor and loses selection when deleting the first item.

Case contract

Remove the valid playing index. Select its old successor when present, otherwise its predecessor; empty result has None selection.

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):
    return [entries[:current]+entries[current+1:],current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b', 'c'], 1)),[['a', 'c'], 1])
check('fixture 2',solve(*(['a', 'b', 'c'], 2)),[['a', 'b'], 1])
check('fixture 3',solve(*(['a'], 0)),[[], None])
check('fixture 4',solve(*(['a', 'b'], 0)),[['b'], 0])
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', 'c'], 1][['a', 'c'], 1]Passed
fixture 2[['a', 'b'], 2][['a', 'b'], 1]Failed
fixture 3[[], 0][[], None]Failed
fixture 4[['b'], 0][['b'], 0]Passed

SHA-256 / f496d6f08609b18f034f05fab4df3360946d87f945ffa4084c88b2d493dae6da

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):
    return [entries[:current]+entries[current+1:],current-1 if current else None]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b', 'c'], 1)),[['a', 'c'], 1])
check('fixture 2',solve(*(['a', 'b', 'c'], 2)),[['a', 'b'], 1])
check('fixture 3',solve(*(['a'], 0)),[[], None])
check('fixture 4',solve(*(['a', 'b'], 0)),[['b'], 0])
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', 'c'], 0][['a', 'c'], 1]Failed
fixture 2[['a', 'b'], 1][['a', 'b'], 1]Passed
fixture 3[[], None][[], None]Passed
fixture 4[['b'], None][['b'], 0]Failed

SHA-256 / d170c9d93cc90a05109ddc6e0795d113dbfaa457eedd481870d397a1d9c806b2

HELD IN THE MEMBER ARCHIVE

The verified repair and its recorded checks are member-only.

This mechanism has 4 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

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

Case digest / 9e4f6da949135452906ca0a0230dd482767bd4165632150b952c948a3359bd1b