FAILURE MAP
← Case archive

FA-11036 / Media playlist state / Open access

Remove before adjusts selection · case 01

Removing an earlier entry leaves the current index one position too large.

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

ROOT CAUSE

Removing an earlier entry leaves the current index one position too large.

VERIFIED REPAIR

Preserve the media contract: Remove a valid entry other than current from a list of at least two entries, preserving selection of the same playing entry.

Unsuccessful approach: Decrementing on later removals switches to the previous entry.

Case contract

Remove a valid entry other than current from a list of at least two entries, preserving selection of the same 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, removed):
    return [[x for i,x in enumerate(entries) if i!=removed],current]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b', 'c'], 2, 0)),[['b', 'c'], 1])
check('fixture 2',solve(*(['a', 'b', 'c'], 0, 2)),[['a', 'b'], 0])
check('fixture 3',solve(*(['a', 'b', 'c', 'd'], 1, 3)),[['a', 'b', 'c'], 1])
check('fixture 4',solve(*(['a', 'b'], 1, 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[['b', 'c'], 2][['b', 'c'], 1]Failed
fixture 2[['a', 'b'], 0][['a', 'b'], 0]Passed
fixture 3[['a', 'b', 'c'], 1][['a', 'b', 'c'], 1]Passed
fixture 4[['b'], 1][['b'], 0]Failed

SHA-256 / 5f3e63d60cb5609f9f6bcd7b6caea1e4e0fc8d1af4b4a533cbacb15667c9a972

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, removed):
    return [[x for i,x in enumerate(entries) if i!=removed],max(0,current-1)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b', 'c'], 2, 0)),[['b', 'c'], 1])
check('fixture 2',solve(*(['a', 'b', 'c'], 0, 2)),[['a', 'b'], 0])
check('fixture 3',solve(*(['a', 'b', 'c', 'd'], 1, 3)),[['a', 'b', 'c'], 1])
check('fixture 4',solve(*(['a', 'b'], 1, 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[['b', 'c'], 1][['b', 'c'], 1]Passed
fixture 2[['a', 'b'], 0][['a', 'b'], 0]Passed
fixture 3[['a', 'b', 'c'], 0][['a', 'b', 'c'], 1]Failed
fixture 4[['b'], 0][['b'], 0]Passed

SHA-256 / 4a12790c090e30cca79bb76888eff0855dcd1d473ab772542bcb27a5e60379ca

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, removed):
    return [[x for i,x in enumerate(entries) if i!=removed],current-(removed<current)]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(['a', 'b', 'c'], 2, 0)),[['b', 'c'], 1])
check('fixture 2',solve(*(['a', 'b', 'c'], 0, 2)),[['a', 'b'], 0])
check('fixture 3',solve(*(['a', 'b', 'c', 'd'], 1, 3)),[['a', 'b', 'c'], 1])
check('fixture 4',solve(*(['a', 'b'], 1, 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[['b', 'c'], 1][['b', 'c'], 1]Passed
fixture 2[['a', 'b'], 0][['a', 'b'], 0]Passed
fixture 3[['a', 'b', 'c'], 1][['a', 'b', 'c'], 1]Passed
fixture 4[['b'], 0][['b'], 0]Passed

SHA-256 / 53577ab3006c4e6cadb5d94b80b873942f99a6392170236d9f6f28b59dc85f78

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

Case digest / 1401241a7bf9341e95ea4f2bc82106f53b57e30842ab024e7d5c07274a802dfc