FA-11181 / Streaming segment lifecycle / Open access
Segment selection by time interval · case 01
Inclusive segment ends select the previous segment at a shared boundary.
ROOT CAUSE
Inclusive segment ends select the previous segment at a shared boundary.
VERIFIED REPAIR
Preserve the media contract: Select segment ID containing a presentation time using nonoverlapping sorted half-open intervals; gaps and final endpoint return None.
Unsuccessful approach: Making both boundaries strict loses the exact start of every segment.
Case contract
Select segment ID containing a presentation time using nonoverlapping sorted half-open intervals; gaps and final endpoint return 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(segments, time):
return next((identity for identity,start,end in segments if start<=time<=end),None)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([['a', 0, 5], ['b', 5, 10]], 5)),'b')
check('fixture 2',solve(*([['a', 0, 5]], 0)),'a')
check('fixture 3',solve(*([['a', 0, 5]], 5)),None)
check('fixture 4',solve(*([], 2)),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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | a | b | Failed |
| fixture 2 | a | a | Passed |
| fixture 3 | a | None | Failed |
| fixture 4 | None | None | Passed |
SHA-256 / fb446979bcf6df38012d3bdc2574b818febf87de78fff741d420dc0cd1bbb8f6
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(segments, time):
return next((identity for identity,start,end in segments if start<time<end),None)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([['a', 0, 5], ['b', 5, 10]], 5)),'b')
check('fixture 2',solve(*([['a', 0, 5]], 0)),'a')
check('fixture 3',solve(*([['a', 0, 5]], 5)),None)
check('fixture 4',solve(*([], 2)),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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | None | b | Failed |
| fixture 2 | None | a | Failed |
| fixture 3 | None | None | Passed |
| fixture 4 | None | None | Passed |
SHA-256 / de7d1bc64ae3a23ccf241ca29747321328be622d72ff8bdcc644e1461b9568dd
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(segments, time):
return next((identity for identity,start,end in segments if start<=time<end),None)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([['a', 0, 5], ['b', 5, 10]], 5)),'b')
check('fixture 2',solve(*([['a', 0, 5]], 0)),'a')
check('fixture 3',solve(*([['a', 0, 5]], 5)),None)
check('fixture 4',solve(*([], 2)),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 fixture | Actual | Expected | Outcome |
|---|---|---|---|
| fixture 1 | b | b | Passed |
| fixture 2 | a | a | Passed |
| fixture 3 | None | None | Passed |
| fixture 4 | None | None | Passed |
SHA-256 / 7e7c947ba2c777687ac9cec670c3a0a8e3d654d945afffdf9b4a2a57064125b2
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:45.605213+00:00.
Case digest / cc0667a7b5ef723ecc49c0c16011b13269e72aa3160deb64580b6d27a497642c