FAILURE MAP
← Case archive

FA-11151 / Streaming segment lifecycle / Open access

Partial segment replacement · case 01

A retried part is appended as a duplicate part rather than updating its stored payload.

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

ROOT CAUSE

A retried part is appended as a duplicate part rather than updating its stored payload.

VERIFIED REPAIR

Preserve the media contract: Parts are sorted unique [part index,payload]. Replace one completed part or insert a new part, preserving sorted unique indexes.

Unsuccessful approach: Removing the previous partial segment without inserting its replacement loses the data.

Case contract

Parts are sorted unique [part index,payload]. Replace one completed part or insert a new part, preserving sorted unique indexes.

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(parts, index, payload):
    return list(parts)+[[index,payload]]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[0, 'a'], [1, 'old']], 1, 'new')),[[0, 'a'], [1, 'new']])
check('fixture 2',solve(*([[1, 'b']], 0, 'a')),[[0, 'a'], [1, 'b']])
check('fixture 3',solve(*([], 0, 'a')),[[0, 'a']])
check('fixture 4',solve(*([[0, 'a']], 0, 'a')),[[0, 'a']])
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[[0, 'a'], [1, 'old'], [1, 'new']][[0, 'a'], [1, 'new']]Failed
fixture 2[[1, 'b'], [0, 'a']][[0, 'a'], [1, 'b']]Failed
fixture 3[[0, 'a']][[0, 'a']]Passed
fixture 4[[0, 'a'], [0, 'a']][[0, 'a']]Failed

SHA-256 / 7aca01ffb4cc5ae346b35d127d164c55202b3e59723668771125a48bd8043a31

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(parts, index, payload):
    return [[i,data] for i,data in parts if i!=index]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[0, 'a'], [1, 'old']], 1, 'new')),[[0, 'a'], [1, 'new']])
check('fixture 2',solve(*([[1, 'b']], 0, 'a')),[[0, 'a'], [1, 'b']])
check('fixture 3',solve(*([], 0, 'a')),[[0, 'a']])
check('fixture 4',solve(*([[0, 'a']], 0, 'a')),[[0, 'a']])
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[[0, 'a']][[0, 'a'], [1, 'new']]Failed
fixture 2[[1, 'b']][[0, 'a'], [1, 'b']]Failed
fixture 3[][[0, 'a']]Failed
fixture 4[][[0, 'a']]Failed

SHA-256 / 5a84e42b7dd2bdbe75e1796f5de0a1e3b0e15395d03cb6acd7acddbd069a9b2e

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json
import math
N = 1
observations = []
def solve(parts, index, payload):
    return [[i,(payload if i==index else data)] for i,data in parts] if any(i==index for i,data in parts) else sorted(list(parts)+[[index,payload]])
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
check('fixture 1',solve(*([[0, 'a'], [1, 'old']], 1, 'new')),[[0, 'a'], [1, 'new']])
check('fixture 2',solve(*([[1, 'b']], 0, 'a')),[[0, 'a'], [1, 'b']])
check('fixture 3',solve(*([], 0, 'a')),[[0, 'a']])
check('fixture 4',solve(*([[0, 'a']], 0, 'a')),[[0, 'a']])
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[[0, 'a'], [1, 'new']][[0, 'a'], [1, 'new']]Passed
fixture 2[[0, 'a'], [1, 'b']][[0, 'a'], [1, 'b']]Passed
fixture 3[[0, 'a']][[0, 'a']]Passed
fixture 4[[0, 'a']][[0, 'a']]Passed

SHA-256 / 6e0c3188824d1a9f20a760b219f36bc02951d8c6377e4d5beb4d2b8c753e31c8

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

Case digest / f74a55745c3eb155d4b3dfd3684d0a680ba9e3cd7b7fb865c27446a21f096e96