{"abstract":"A retried part is appended as a duplicate part rather than updating its stored payload.","category":"Streaming segment lifecycle","checks":4,"contract":"Parts are sorted unique [part index,payload]. Replace one completed part or insert a new part, preserving sorted unique indexes.","evaluation_group":"xmed-partial-segment-replacement","failed_approach":"Removing the previous partial segment without inserting its replacement loses the data.","family":"xmed-partial-segment-replacement","id":"FA-11151","implementations":{"attempt":{"sha256":"5a84e42b7dd2bdbe75e1796f5de0a1e3b0e15395d03cb6acd7acddbd069a9b2e","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(parts, index, payload):\n    return [[i,data] for i,data in parts if i!=index]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1',solve(*([[0, 'a'], [1, 'old']], 1, 'new')),[[0, 'a'], [1, 'new']])\ncheck('fixture 2',solve(*([[1, 'b']], 0, 'a')),[[0, 'a'], [1, 'b']])\ncheck('fixture 3',solve(*([], 0, 'a')),[[0, 'a']])\ncheck('fixture 4',solve(*([[0, 'a']], 0, 'a')),[[0, 'a']])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"broken":{"sha256":"7aca01ffb4cc5ae346b35d127d164c55202b3e59723668771125a48bd8043a31","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(parts, index, payload):\n    return list(parts)+[[index,payload]]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1',solve(*([[0, 'a'], [1, 'old']], 1, 'new')),[[0, 'a'], [1, 'new']])\ncheck('fixture 2',solve(*([[1, 'b']], 0, 'a')),[[0, 'a'], [1, 'b']])\ncheck('fixture 3',solve(*([], 0, 'a')),[[0, 'a']])\ncheck('fixture 4',solve(*([[0, 'a']], 0, 'a')),[[0, 'a']])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"},"fixed":{"sha256":"6e0c3188824d1a9f20a760b219f36bc02951d8c6377e4d5beb4d2b8c753e31c8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport math\nN = 1\nobservations = []\ndef solve(parts, index, payload):\n    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]])\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('fixture 1',solve(*([[0, 'a'], [1, 'old']], 1, 'new')),[[0, 'a'], [1, 'new']])\ncheck('fixture 2',solve(*([[1, 'b']], 0, 'a')),[[0, 'a'], [1, 'b']])\ncheck('fixture 3',solve(*([], 0, 'a')),[[0, 'a']])\ncheck('fixture 4',solve(*([[0, 'a']], 0, 'a')),[[0, 'a']])\nprint(json.dumps({\"observations\": observations, \"passed\": all(x[\"passed\"] for x in observations)}, ensure_ascii=False))\nraise SystemExit(0 if all(x[\"passed\"] for x in observations) else 1)\n"}},"limitations":" 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.","method":"Deterministic executable model with adversarial boundary fixtures.","provenance":{"created_by":"Failure Map","dependencies":"Python standard library","family":"xmed-partial-segment-replacement","generated_at":"2026-09-29T14:38:45.441306+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic local media controller stage; metadata and downloaded data are supplied explicitly. No external player, service or codec is required.","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.","root_cause":"A retried part is appended as a duplicate part rather than updating its stored payload.","sha256":"f74a55745c3eb155d4b3dfd3684d0a680ba9e3cd7b7fb865c27446a21f096e96","title":"Partial segment replacement · case 01","variant":1,"variant_policy":"The five numbered cases rerun the same authored boundary fixtures; they are reproducibility runs, not independent input variants.","verification":{"attempt":{"elapsed_ms":38.777,"exit_code":1,"observations":[{"actual":[[0,"a"]],"check":"fixture 1","expected":[[0,"a"],[1,"new"]],"passed":false},{"actual":[[1,"b"]],"check":"fixture 2","expected":[[0,"a"],[1,"b"]],"passed":false},{"actual":[],"check":"fixture 3","expected":[[0,"a"]],"passed":false},{"actual":[],"check":"fixture 4","expected":[[0,"a"]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [[0, \"a\"]], \"expected\": [[0, \"a\"], [1, \"new\"]], \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": [[1, \"b\"]], \"expected\": [[0, \"a\"], [1, \"b\"]], \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": [], \"expected\": [[0, \"a\"]], \"passed\": false}, {\"check\": \"fixture 4\", \"actual\": [], \"expected\": [[0, \"a\"]], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.497,"exit_code":1,"observations":[{"actual":[[0,"a"],[1,"old"],[1,"new"]],"check":"fixture 1","expected":[[0,"a"],[1,"new"]],"passed":false},{"actual":[[1,"b"],[0,"a"]],"check":"fixture 2","expected":[[0,"a"],[1,"b"]],"passed":false},{"actual":[[0,"a"]],"check":"fixture 3","expected":[[0,"a"]],"passed":true},{"actual":[[0,"a"],[0,"a"]],"check":"fixture 4","expected":[[0,"a"]],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [[0, \"a\"], [1, \"old\"], [1, \"new\"]], \"expected\": [[0, \"a\"], [1, \"new\"]], \"passed\": false}, {\"check\": \"fixture 2\", \"actual\": [[1, \"b\"], [0, \"a\"]], \"expected\": [[0, \"a\"], [1, \"b\"]], \"passed\": false}, {\"check\": \"fixture 3\", \"actual\": [[0, \"a\"]], \"expected\": [[0, \"a\"]], \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": [[0, \"a\"], [0, \"a\"]], \"expected\": [[0, \"a\"]], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.313,"exit_code":0,"observations":[{"actual":[[0,"a"],[1,"new"]],"check":"fixture 1","expected":[[0,"a"],[1,"new"]],"passed":true},{"actual":[[0,"a"],[1,"b"]],"check":"fixture 2","expected":[[0,"a"],[1,"b"]],"passed":true},{"actual":[[0,"a"]],"check":"fixture 3","expected":[[0,"a"]],"passed":true},{"actual":[[0,"a"]],"check":"fixture 4","expected":[[0,"a"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"fixture 1\", \"actual\": [[0, \"a\"], [1, \"new\"]], \"expected\": [[0, \"a\"], [1, \"new\"]], \"passed\": true}, {\"check\": \"fixture 2\", \"actual\": [[0, \"a\"], [1, \"b\"]], \"expected\": [[0, \"a\"], [1, \"b\"]], \"passed\": true}, {\"check\": \"fixture 3\", \"actual\": [[0, \"a\"]], \"expected\": [[0, \"a\"]], \"passed\": true}, {\"check\": \"fixture 4\", \"actual\": [[0, \"a\"]], \"expected\": [[0, \"a\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}