{"abstract":"A reader who has not reached the loaded window is shown under the newest message.","category":"Chat ordering and read receipts","checks":6,"contract":"messages are ascending [seq, author] of the visible window. reads maps user -> [read_seq, read_at]. Each user other than me gets an avatar under the latest visible message with seq <= read_seq; users whose read_seq is before the first visible message get none. Avatars under one message are ordered by read_at descending, then user id. Result: [[seq, [users...]]...] by seq.","evaluation_group":"w2-chat_ordering_and_read_receipts-seen-by-avatars","failed_approach":"Comparing against the first visible sequence minus one misses readers just below the window. The attempted `if r < seqs[0] - 1:` still disagrees with a fixture.","family":"w2-chat_ordering_and_read_receipts-seen-by-avatars-before-window","id":"FA-76226","implementations":{"attempt":{"sha256":"0c67186f289c2c7179f2ec6066dc91390515ac6c0b13a6173a50368c7a0e1e1b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom bisect import bisect_left, bisect_right\nN = 1\nobservations = []\ndef solve(messages, reads, me):\n    seqs = [s for s, _ in messages]\n    slots = {}\n    for user, (r, at) in reads.items():\n        if user == me:\n            continue\n        i = bisect_right(seqs, r) - 1\n        if r < seqs[0] - 1:\n            continue\n        slots.setdefault(seqs[i], []).append((at, user))\n    return [[s, [u for _, u in sorted(v, key=lambda x: (-x[0], x[1]))]] for s, v in sorted(slots.items())]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [14, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [6, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 31], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [2, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 2: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [13, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [7, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 32], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [3, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 3: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [14, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [8, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 33], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [4, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 4: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [13, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [9, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 34], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [5, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 5: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [14, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [10, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 35], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [6, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])]}\nfor _label, _args, _expected in _CASES[N]:\n    check(_label, solve(*_args), _expected)\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":"382d29f3e3e5b2f15fe1ad1e66b009b50941a579ce8c98280d788f2a678f080a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom bisect import bisect_left, bisect_right\nN = 1\nobservations = []\ndef solve(messages, reads, me):\n    seqs = [s for s, _ in messages]\n    slots = {}\n    for user, (r, at) in reads.items():\n        if user == me:\n            continue\n        i = bisect_right(seqs, r) - 1\n        if r < 0:\n            continue\n        slots.setdefault(seqs[i], []).append((at, user))\n    return [[s, [u for _, u in sorted(v, key=lambda x: (-x[0], x[1]))]] for s, v in sorted(slots.items())]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [14, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [6, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 31], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [2, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 2: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [13, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [7, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 32], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [3, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 3: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [14, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [8, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 33], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [4, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 4: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [13, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [9, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 34], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [5, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 5: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [14, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [10, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 35], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [6, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])]}\nfor _label, _args, _expected in _CASES[N]:\n    check(_label, solve(*_args), _expected)\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":"0a9e50f6a08b7bd57cfb531fc984525365af6c41254c2eb1e656748f76315c13","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nfrom bisect import bisect_left, bisect_right\nN = 1\nobservations = []\ndef solve(messages, reads, me):\n    seqs = [s for s, _ in messages]\n    slots = {}\n    for user, (r, at) in reads.items():\n        if user == me:\n            continue\n        i = bisect_right(seqs, r) - 1\n        if i < 0:\n            continue\n        slots.setdefault(seqs[i], []).append((at, user))\n    return [[s, [u for _, u in sorted(v, key=lambda x: (-x[0], x[1]))]] for s, v in sorted(slots.items())]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [14, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [6, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 31], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [2, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 2: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [13, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [7, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 32], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [3, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 3: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [14, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [8, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 33], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [4, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 4: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [13, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [9, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 34], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [5, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])], 5: [('read exactly a message', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [12, 5]}, 'me'), [[12, ['bo']]]), ('read between messages', ([[10, 'a'], [12, 'b'], [15, 'c']], {'bo': [14, 5]}, 'me'), [[12, ['bo']]]), ('read before window', ([[20, 'a'], [22, 'b']], {'bo': [19, 1], 'cy': [10, 1]}, 'me'), []), ('several readers same message', ([[1, 'a'], [2, 'b']], {'bo': [2, 10], 'cy': [2, 35], 'al': [2, 10]}, 'me'), [[2, ['cy', 'al', 'bo']]]), ('self excluded', ([[1, 'a']], {'me': [1, 1], 'bo': [6, 2]}, 'me'), [[1, ['bo']]]), ('empty reads', ([[1, 'a']], {}, 'me'), [])]}\nfor _label, _args, _expected in _CASES[N]:\n    check(_label, solve(*_args), _expected)\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":"Stipulated offline chat model; not a complete messaging protocol, client or server implementation. 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":"w2-chat_ordering_and_read_receipts-seen-by-avatars-before-window","generated_at":"2026-09-29T14:49:14.227170+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"\"Seen by\" rows show how far each participant has read; misplacement misreports who saw what.","repair":"Use `if i < 0:` for the before window decision and keep every other rule of the model unchanged.","root_cause":"The before window decision evaluates `if r < 0:` where the contract requires `if i < 0:`.","sha256":"9120500e9f0aeab1c14797971b19b71e7e003fab2c52a646ff0eb76ee3da3a9b","title":"Place \"seen by\" avatars under the latest read message: before window · case 01","variant":1,"variant_policy":"N selects a different enumerated fixture set (shifted clocks, identifiers and sizes); boundary fixtures recur across variants.","verification":{"attempt":{"elapsed_ms":43.677,"exit_code":1,"observations":[{"actual":[[12,["bo"]]],"check":"read exactly a message","expected":[[12,["bo"]]],"passed":true},{"actual":[[12,["bo"]]],"check":"read between messages","expected":[[12,["bo"]]],"passed":true},{"actual":[[22,["bo"]]],"check":"read before window","expected":[],"passed":false},{"actual":[[2,["cy","al","bo"]]],"check":"several readers same message","expected":[[2,["cy","al","bo"]]],"passed":true},{"actual":[[1,["bo"]]],"check":"self excluded","expected":[[1,["bo"]]],"passed":true},{"actual":[],"check":"empty reads","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"read exactly a message\", \"actual\": [[12, [\"bo\"]]], \"expected\": [[12, [\"bo\"]]], \"passed\": true}, {\"check\": \"read between messages\", \"actual\": [[12, [\"bo\"]]], \"expected\": [[12, [\"bo\"]]], \"passed\": true}, {\"check\": \"read before window\", \"actual\": [[22, [\"bo\"]]], \"expected\": [], \"passed\": false}, {\"check\": \"several readers same message\", \"actual\": [[2, [\"cy\", \"al\", \"bo\"]]], \"expected\": [[2, [\"cy\", \"al\", \"bo\"]]], \"passed\": true}, {\"check\": \"self excluded\", \"actual\": [[1, [\"bo\"]]], \"expected\": [[1, [\"bo\"]]], \"passed\": true}, {\"check\": \"empty reads\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.259,"exit_code":1,"observations":[{"actual":[[12,["bo"]]],"check":"read exactly a message","expected":[[12,["bo"]]],"passed":true},{"actual":[[12,["bo"]]],"check":"read between messages","expected":[[12,["bo"]]],"passed":true},{"actual":[[22,["bo","cy"]]],"check":"read before window","expected":[],"passed":false},{"actual":[[2,["cy","al","bo"]]],"check":"several readers same message","expected":[[2,["cy","al","bo"]]],"passed":true},{"actual":[[1,["bo"]]],"check":"self excluded","expected":[[1,["bo"]]],"passed":true},{"actual":[],"check":"empty reads","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"read exactly a message\", \"actual\": [[12, [\"bo\"]]], \"expected\": [[12, [\"bo\"]]], \"passed\": true}, {\"check\": \"read between messages\", \"actual\": [[12, [\"bo\"]]], \"expected\": [[12, [\"bo\"]]], \"passed\": true}, {\"check\": \"read before window\", \"actual\": [[22, [\"bo\", \"cy\"]]], \"expected\": [], \"passed\": false}, {\"check\": \"several readers same message\", \"actual\": [[2, [\"cy\", \"al\", \"bo\"]]], \"expected\": [[2, [\"cy\", \"al\", \"bo\"]]], \"passed\": true}, {\"check\": \"self excluded\", \"actual\": [[1, [\"bo\"]]], \"expected\": [[1, [\"bo\"]]], \"passed\": true}, {\"check\": \"empty reads\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":44.413,"exit_code":0,"observations":[{"actual":[[12,["bo"]]],"check":"read exactly a message","expected":[[12,["bo"]]],"passed":true},{"actual":[[12,["bo"]]],"check":"read between messages","expected":[[12,["bo"]]],"passed":true},{"actual":[],"check":"read before window","expected":[],"passed":true},{"actual":[[2,["cy","al","bo"]]],"check":"several readers same message","expected":[[2,["cy","al","bo"]]],"passed":true},{"actual":[[1,["bo"]]],"check":"self excluded","expected":[[1,["bo"]]],"passed":true},{"actual":[],"check":"empty reads","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"read exactly a message\", \"actual\": [[12, [\"bo\"]]], \"expected\": [[12, [\"bo\"]]], \"passed\": true}, {\"check\": \"read between messages\", \"actual\": [[12, [\"bo\"]]], \"expected\": [[12, [\"bo\"]]], \"passed\": true}, {\"check\": \"read before window\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"several readers same message\", \"actual\": [[2, [\"cy\", \"al\", \"bo\"]]], \"expected\": [[2, [\"cy\", \"al\", \"bo\"]]], \"passed\": true}, {\"check\": \"self excluded\", \"actual\": [[1, [\"bo\"]]], \"expected\": [[1, [\"bo\"]]], \"passed\": true}, {\"check\": \"empty reads\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}