{"abstract":"Collapses repeated playback occurrences in the remaining history and produces an incorrect media-control or presentation result.","category":"Media playlist lifecycle","checks":6,"contract":"Previous restarts the current item at zero when position_ms is at least threshold; otherwise it pops the most recently played history occurrence and prepends current to forward history. With no past item, restart current. Inputs have nonnegative positions and positive threshold; duplicate history occurrences are meaningful.","evaluation_group":"xplay-previous-track-history","failed_approach":"The alternative still fails because it visits the oldest history entry instead of the most recent.","family":"xplay-previous-track-history-past-occurrences-deduplicated","id":"FA-11326","implementations":{"attempt":{"sha256":"8a2d0da38368d902b4cdda403629fded632dbafb4094cb9759434edb667d5a31","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(current, position_ms, threshold, history, future):\n    back=list(history); forward=list(future)\n    if position_ms >= threshold:\n        return [current,0,back,forward]\n    if not back: return [current,0,back,forward]\n    previous=back.pop(0)\n    if current is not None: forward.insert(0,current)\n    return [previous,0,back,forward]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])\ncheck('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])\ncheck('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])\ncheck('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])\ncheck('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])\ncheck('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])\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":"05eede6dbadf752543d89ccfd5d83ebb72662f99d7f5a4f2fd1a63e1bf2896ea","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(current, position_ms, threshold, history, future):\n    back=list(history); forward=list(future)\n    if position_ms >= threshold:\n        return [current,0,back,forward]\n    if not back: return [current,0,back,forward]\n    previous=back.pop()\n    if current is not None: forward.insert(0,current)\n    return [previous,0,list(dict.fromkeys(back)),forward]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])\ncheck('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])\ncheck('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])\ncheck('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])\ncheck('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])\ncheck('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])\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":"9e77392382e214e4dbf5348c16cf086c9897be742885fcc3e91e1524107b25b5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(current, position_ms, threshold, history, future):\n    back=list(history); forward=list(future)\n    if position_ms >= threshold:\n        return [current,0,back,forward]\n    if not back: return [current,0,back,forward]\n    previous=back.pop()\n    if current is not None: forward.insert(0,current)\n    return [previous,0,back,forward]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('recent history selected', solve('c', 0, 3000, ['a', 'b'], []), ['b', 0, ['a'], ['c']])\ncheck('restart at exact threshold', solve('c', 3000, 3000, ['a', 'b'], ['d']), ['c', 0, ['a', 'b'], ['d']])\ncheck('forward stack preserves order', solve('c', 100, 3000, ['a', 'b'], ['d', 'e']), ['b', 0, ['a'], ['c', 'd', 'e']])\ncheck('duplicate past retained', solve('c', 0, 3000, ['a', 'a', 'b'], []), ['b', 0, ['a', 'a'], ['c']])\ncheck('no past restarts', solve('a', 0, 3000, [], ['b']), ['a', 0, [], ['b']])\ncheck('absent current not inserted', solve(None, 0, 3000, ['a'], ['b']), ['a', 0, [], ['b']])\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":"xplay-previous-track-history-past-occurrences-deduplicated","generated_at":"2026-09-29T14:38:46.873809+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A deterministic in-memory media application model with explicit playlist, timeline or synchronization semantics. Does not implement codecs, transport protocols, rendering hardware or concurrent playback.","repair":"Previous restarts the current item at zero when position_ms is at least threshold; otherwise it pops the most recently played history occurrence and prepends current to forward history. With no past item, restart current. Inputs have nonnegative positions and positive threshold; duplicate history occurrences are meaningful.","root_cause":"Collapses repeated playback occurrences in the remaining history. The fixture suite isolates this decision from network delivery and codec details.","sha256":"a28dbd87440cc601f335710ceae073cd06c72d66267d4accd2f24f3442f1bccc","title":"Previous track history: Collapses repeated playback occurrences in the remaining history · case 01","variant":1,"variant_policy":"Numbered cases repeat the same authored boundary fixtures as reproducibility runs, not independent input variants.","verification":{"attempt":{"elapsed_ms":38.554,"exit_code":1,"observations":[{"actual":["a",0,["b"],["c"]],"check":"recent history selected","expected":["b",0,["a"],["c"]],"passed":false},{"actual":["c",0,["a","b"],["d"]],"check":"restart at exact threshold","expected":["c",0,["a","b"],["d"]],"passed":true},{"actual":["a",0,["b"],["c","d","e"]],"check":"forward stack preserves order","expected":["b",0,["a"],["c","d","e"]],"passed":false},{"actual":["a",0,["a","b"],["c"]],"check":"duplicate past retained","expected":["b",0,["a","a"],["c"]],"passed":false},{"actual":["a",0,[],["b"]],"check":"no past restarts","expected":["a",0,[],["b"]],"passed":true},{"actual":["a",0,[],["b"]],"check":"absent current not inserted","expected":["a",0,[],["b"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"recent history selected\", \"actual\": [\"a\", 0, [\"b\"], [\"c\"]], \"expected\": [\"b\", 0, [\"a\"], [\"c\"]], \"passed\": false}, {\"check\": \"restart at exact threshold\", \"actual\": [\"c\", 0, [\"a\", \"b\"], [\"d\"]], \"expected\": [\"c\", 0, [\"a\", \"b\"], [\"d\"]], \"passed\": true}, {\"check\": \"forward stack preserves order\", \"actual\": [\"a\", 0, [\"b\"], [\"c\", \"d\", \"e\"]], \"expected\": [\"b\", 0, [\"a\"], [\"c\", \"d\", \"e\"]], \"passed\": false}, {\"check\": \"duplicate past retained\", \"actual\": [\"a\", 0, [\"a\", \"b\"], [\"c\"]], \"expected\": [\"b\", 0, [\"a\", \"a\"], [\"c\"]], \"passed\": false}, {\"check\": \"no past restarts\", \"actual\": [\"a\", 0, [], [\"b\"]], \"expected\": [\"a\", 0, [], [\"b\"]], \"passed\": true}, {\"check\": \"absent current not inserted\", \"actual\": [\"a\", 0, [], [\"b\"]], \"expected\": [\"a\", 0, [], [\"b\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.671,"exit_code":1,"observations":[{"actual":["b",0,["a"],["c"]],"check":"recent history selected","expected":["b",0,["a"],["c"]],"passed":true},{"actual":["c",0,["a","b"],["d"]],"check":"restart at exact threshold","expected":["c",0,["a","b"],["d"]],"passed":true},{"actual":["b",0,["a"],["c","d","e"]],"check":"forward stack preserves order","expected":["b",0,["a"],["c","d","e"]],"passed":true},{"actual":["b",0,["a"],["c"]],"check":"duplicate past retained","expected":["b",0,["a","a"],["c"]],"passed":false},{"actual":["a",0,[],["b"]],"check":"no past restarts","expected":["a",0,[],["b"]],"passed":true},{"actual":["a",0,[],["b"]],"check":"absent current not inserted","expected":["a",0,[],["b"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"recent history selected\", \"actual\": [\"b\", 0, [\"a\"], [\"c\"]], \"expected\": [\"b\", 0, [\"a\"], [\"c\"]], \"passed\": true}, {\"check\": \"restart at exact threshold\", \"actual\": [\"c\", 0, [\"a\", \"b\"], [\"d\"]], \"expected\": [\"c\", 0, [\"a\", \"b\"], [\"d\"]], \"passed\": true}, {\"check\": \"forward stack preserves order\", \"actual\": [\"b\", 0, [\"a\"], [\"c\", \"d\", \"e\"]], \"expected\": [\"b\", 0, [\"a\"], [\"c\", \"d\", \"e\"]], \"passed\": true}, {\"check\": \"duplicate past retained\", \"actual\": [\"b\", 0, [\"a\"], [\"c\"]], \"expected\": [\"b\", 0, [\"a\", \"a\"], [\"c\"]], \"passed\": false}, {\"check\": \"no past restarts\", \"actual\": [\"a\", 0, [], [\"b\"]], \"expected\": [\"a\", 0, [], [\"b\"]], \"passed\": true}, {\"check\": \"absent current not inserted\", \"actual\": [\"a\", 0, [], [\"b\"]], \"expected\": [\"a\", 0, [], [\"b\"]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.366,"exit_code":0,"observations":[{"actual":["b",0,["a"],["c"]],"check":"recent history selected","expected":["b",0,["a"],["c"]],"passed":true},{"actual":["c",0,["a","b"],["d"]],"check":"restart at exact threshold","expected":["c",0,["a","b"],["d"]],"passed":true},{"actual":["b",0,["a"],["c","d","e"]],"check":"forward stack preserves order","expected":["b",0,["a"],["c","d","e"]],"passed":true},{"actual":["b",0,["a","a"],["c"]],"check":"duplicate past retained","expected":["b",0,["a","a"],["c"]],"passed":true},{"actual":["a",0,[],["b"]],"check":"no past restarts","expected":["a",0,[],["b"]],"passed":true},{"actual":["a",0,[],["b"]],"check":"absent current not inserted","expected":["a",0,[],["b"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"recent history selected\", \"actual\": [\"b\", 0, [\"a\"], [\"c\"]], \"expected\": [\"b\", 0, [\"a\"], [\"c\"]], \"passed\": true}, {\"check\": \"restart at exact threshold\", \"actual\": [\"c\", 0, [\"a\", \"b\"], [\"d\"]], \"expected\": [\"c\", 0, [\"a\", \"b\"], [\"d\"]], \"passed\": true}, {\"check\": \"forward stack preserves order\", \"actual\": [\"b\", 0, [\"a\"], [\"c\", \"d\", \"e\"]], \"expected\": [\"b\", 0, [\"a\"], [\"c\", \"d\", \"e\"]], \"passed\": true}, {\"check\": \"duplicate past retained\", \"actual\": [\"b\", 0, [\"a\", \"a\"], [\"c\"]], \"expected\": [\"b\", 0, [\"a\", \"a\"], [\"c\"]], \"passed\": true}, {\"check\": \"no past restarts\", \"actual\": [\"a\", 0, [], [\"b\"]], \"expected\": [\"a\", 0, [], [\"b\"]], \"passed\": true}, {\"check\": \"absent current not inserted\", \"actual\": [\"a\", 0, [], [\"b\"]], \"expected\": [\"a\", 0, [], [\"b\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}