FA-11176 / Streaming segment lifecycle / Open access
End of stream waits for queued appends · case 01
The stream ends before all declared media segments have been appended.
ROOT CAUSE
The stream ends before all declared media segments have been appended.
VERIFIED REPAIR
Preserve the media contract: Transition a stream to ended only after terminal manifest is known and both pending and active appends are exhausted.
Unsuccessful approach: An idle live stream is incorrectly finalized despite no terminal manifest.
Case contract
Transition a stream to ended only after terminal manifest is known and both pending and active appends are exhausted.
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(manifest_ended, queue, inflight):
return "ended" if manifest_ended else "open"
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(True, ['a'], None)),'open')
check('fixture 2',solve(*(True, [], 'a')),'open')
check('fixture 3',solve(*(True, [], None)),'ended')
check('fixture 4',solve(*(False, [], None)),'open')
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 | ended | open | Failed |
| fixture 2 | ended | open | Failed |
| fixture 3 | ended | ended | Passed |
| fixture 4 | open | open | Passed |
SHA-256 / 67ef97131f378980cc8c63fddca2d3ae194c78cf7b259fa359ec8efc956d7c5f
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(manifest_ended, queue, inflight):
return "ended" if not queue and inflight is None else "open"
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(True, ['a'], None)),'open')
check('fixture 2',solve(*(True, [], 'a')),'open')
check('fixture 3',solve(*(True, [], None)),'ended')
check('fixture 4',solve(*(False, [], None)),'open')
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 | open | open | Passed |
| fixture 2 | open | open | Passed |
| fixture 3 | ended | ended | Passed |
| fixture 4 | ended | open | Failed |
SHA-256 / 5afba882e241dccf1330e71eff3ad6f1bb12a1dff90556c31d9bd562fa1251bc
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(manifest_ended, queue, inflight):
return "ended" if manifest_ended and not queue and inflight is None else "open"
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*(True, ['a'], None)),'open')
check('fixture 2',solve(*(True, [], 'a')),'open')
check('fixture 3',solve(*(True, [], None)),'ended')
check('fixture 4',solve(*(False, [], None)),'open')
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 | open | open | Passed |
| fixture 2 | open | open | Passed |
| fixture 3 | ended | ended | Passed |
| fixture 4 | open | open | Passed |
SHA-256 / a69e4a3e8b856824925e7c7f7b837249919a5e2bf2f234a850b5a095d3abda0b
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.604934+00:00.
Case digest / a03f8ef7a512b2dc482e53be8cf45c41e2409d5cb7283a9546c8a788d8532946