FA-11106 / Streaming segment lifecycle / Open access
Manifest merge by sequence · case 01
Appending a refreshed manifest duplicates overlapping sequence numbers.
ROOT CAUSE
Appending a refreshed manifest duplicates overlapping sequence numbers.
VERIFIED REPAIR
Preserve the media contract: Merge unique-per-input [integer media-sequence,payload] records by sequence; incoming revisions win, output is sequence ordered.
Unsuccessful approach: Keeping the prior payload loses revised metadata from the fresh manifest.
Case contract
Merge unique-per-input [integer media-sequence,payload] records by sequence; incoming revisions win, output is sequence ordered.
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(old, incoming):
return list(old)+list(incoming)
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[10, 'a'], [11, 'old']], [[11, 'new'], [12, 'c']])),[[10, 'a'], [11, 'new'], [12, 'c']])
check('fixture 2',solve(*([], [[2, 'x']])),[[2, 'x']])
check('fixture 3',solve(*([[1, 'x']], [])),[[1, 'x']])
check('fixture 4',solve(*([[2, 'b']], [[1, 'a']])),[[1, 'a'], [2, 'b']])
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 | [[10, 'a'], [11, 'old'], [11, 'new'], [12, 'c']] | [[10, 'a'], [11, 'new'], [12, 'c']] | Failed |
| fixture 2 | [[2, 'x']] | [[2, 'x']] | Passed |
| fixture 3 | [[1, 'x']] | [[1, 'x']] | Passed |
| fixture 4 | [[2, 'b'], [1, 'a']] | [[1, 'a'], [2, 'b']] | Failed |
SHA-256 / f125aa0fa484f9c008062e3d98bf653d58dd29f2c8ad2e786836177381e6c7e6
2 / The unsuccessful fix
Exit 1"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(old, incoming):
return [[k,v] for k,v in sorted(dict(list(incoming)+list(old)).items())]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[10, 'a'], [11, 'old']], [[11, 'new'], [12, 'c']])),[[10, 'a'], [11, 'new'], [12, 'c']])
check('fixture 2',solve(*([], [[2, 'x']])),[[2, 'x']])
check('fixture 3',solve(*([[1, 'x']], [])),[[1, 'x']])
check('fixture 4',solve(*([[2, 'b']], [[1, 'a']])),[[1, 'a'], [2, 'b']])
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 | [[10, 'a'], [11, 'old'], [12, 'c']] | [[10, 'a'], [11, 'new'], [12, 'c']] | Failed |
| fixture 2 | [[2, 'x']] | [[2, 'x']] | Passed |
| fixture 3 | [[1, 'x']] | [[1, 'x']] | Passed |
| fixture 4 | [[1, 'a'], [2, 'b']] | [[1, 'a'], [2, 'b']] | Passed |
SHA-256 / 0a0e3257ba6cc48d8c860e844328424addeafb8bb7268faed7ab974b58bd80ac
3 / The verified repair
Exit 0"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(old, incoming):
return [[k,v] for k,v in sorted(dict(list(old)+list(incoming)).items())]
def check(label, actual, expected):
observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[10, 'a'], [11, 'old']], [[11, 'new'], [12, 'c']])),[[10, 'a'], [11, 'new'], [12, 'c']])
check('fixture 2',solve(*([], [[2, 'x']])),[[2, 'x']])
check('fixture 3',solve(*([[1, 'x']], [])),[[1, 'x']])
check('fixture 4',solve(*([[2, 'b']], [[1, 'a']])),[[1, 'a'], [2, 'b']])
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 | [[10, 'a'], [11, 'new'], [12, 'c']] | [[10, 'a'], [11, 'new'], [12, 'c']] | Passed |
| fixture 2 | [[2, 'x']] | [[2, 'x']] | Passed |
| fixture 3 | [[1, 'x']] | [[1, 'x']] | Passed |
| fixture 4 | [[1, 'a'], [2, 'b']] | [[1, 'a'], [2, 'b']] | Passed |
SHA-256 / ee655ed0bebe2aba7b0d3adb755e4a925ff603bc13ab6623938d3ef9d9b19865
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.995182+00:00.
Case digest / 0c2ae292e9baa5268c874b738847bb891eea2051ee1b05e50a0c53d677e8e722