FAILURE MAP
← Case archive

FA-11251 / Media timeline seeking / Open access

Chapter selection latest start · case 01

The first matching chapter remains selected throughout later chapters.

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

ROOT CAUSE

The first matching chapter remains selected throughout later chapters.

VERIFIED REPAIR

Preserve the media contract: Chapters are sorted unique start times. Select the latest chapter starting at or before playback time; no earlier chapter yields None.

Unsuccessful approach: Strict comparison keeps the preceding chapter at an exact chapter boundary.

Case contract

Chapters are sorted unique start times. Select the latest chapter starting at or before playback time; no earlier chapter yields None.

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(chapters, time):
    return next((name for start,name in chapters if start<=time),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[0, 'a'], [10, 'b'], [20, 'c']], 15)),'b')
check('fixture 2',solve(*([[0, 'a'], [10, 'b']], 10)),'b')
check('fixture 3',solve(*([[5, 'a']], 2)),None)
check('fixture 4',solve(*([], 0)),None)
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 1abFailed
fixture 2abFailed
fixture 3NoneNonePassed
fixture 4NoneNonePassed

SHA-256 / 7a8e700257720c4e04345751a2788fd5095c692db8f8079af42343fc31ee41bd

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(chapters, time):
    return next((name for start,name in reversed(chapters) if start<time),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[0, 'a'], [10, 'b'], [20, 'c']], 15)),'b')
check('fixture 2',solve(*([[0, 'a'], [10, 'b']], 10)),'b')
check('fixture 3',solve(*([[5, 'a']], 2)),None)
check('fixture 4',solve(*([], 0)),None)
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 1bbPassed
fixture 2abFailed
fixture 3NoneNonePassed
fixture 4NoneNonePassed

SHA-256 / 7e7611733229edc095e68a0324b7828579fbadd1bf362bd1b7346bedeb99b568

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(chapters, time):
    return next((name for start,name in reversed(chapters) if start<=time),None)
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[0, 'a'], [10, 'b'], [20, 'c']], 15)),'b')
check('fixture 2',solve(*([[0, 'a'], [10, 'b']], 10)),'b')
check('fixture 3',solve(*([[5, 'a']], 2)),None)
check('fixture 4',solve(*([], 0)),None)
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 1bbPassed
fixture 2bbPassed
fixture 3NoneNonePassed
fixture 4NoneNonePassed

SHA-256 / 540d6713052a0c851c7ae893e8e7baaee3077a206d65dbb9195ae5d4bf4530cc

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

Case digest / fec8bccf7ec55518dea897278f81ccd1e7e1a04b9dd857d02a8226072a2a1429