{"abstract":"A reader whose marker sits exactly on a message is shown under the previous 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.","contract_signature":"messages, reads, me","evaluation_group":"w2-chat_ordering_and_read_receipts-seen-by-avatars","failed_approach":"Clamping the insertion point moves readers between messages down to the next unread message. The attempted `min(bisect_left(seqs, r), len(seqs) - 1)` still disagrees with a fixture.","family":"w2-chat_ordering_and_read_receipts-seen-by-avatars-bisect-side","id":"FA-76221","implementations":{"attempt":{"sha256":"1660e05850c318e98a84f974f3901211600dffe7fe4707d162e1583fdbb0faa8","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 = min(bisect_left(seqs, r), len(seqs) - 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"},"broken":{"sha256":"0c77af11dd565563bd1205d1e7cfc4a679d0173f0900ed382da62202c2057f64","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_left(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-bisect-side","generated_at":"2026-09-29T14:49:14.226099+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.","root_cause":"The bisect side decision evaluates `bisect_left(seqs, r) - 1` where the contract requires `bisect_right(seqs, r) - 1`.","sha256":"3e331563ea3d260103daa48882e348559018bdc65287e05f17df54e7dab4c2dc","title":"Place \"seen by\" avatars under the latest read message: bisect side · case 01","variant":1,"variant_policy":"N selects a different enumerated fixture set (shifted clocks, identifiers and sizes); boundary fixtures recur across variants.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":41.994,"exit_code":1,"observations":[{"actual":[[12,["bo"]]],"check":"read exactly a message","expected":[[12,["bo"]]],"passed":true},{"actual":[[15,["bo"]]],"check":"read between messages","expected":[[12,["bo"]]],"passed":false},{"actual":[[20,["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\": [[15, [\"bo\"]]], \"expected\": [[12, [\"bo\"]]], \"passed\": false}, {\"check\": \"read before window\", \"actual\": [[20, [\"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"},"broken":{"elapsed_ms":43.901,"exit_code":1,"observations":[{"actual":[[10,["bo"]]],"check":"read exactly a message","expected":[[12,["bo"]]],"passed":false},{"actual":[[12,["bo"]]],"check":"read between messages","expected":[[12,["bo"]]],"passed":true},{"actual":[],"check":"read before window","expected":[],"passed":true},{"actual":[[1,["cy","al","bo"]]],"check":"several readers same message","expected":[[2,["cy","al","bo"]]],"passed":false},{"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\": [[10, [\"bo\"]]], \"expected\": [[12, [\"bo\"]]], \"passed\": false}, {\"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\": [[1, [\"cy\", \"al\", \"bo\"]]], \"expected\": [[2, [\"cy\", \"al\", \"bo\"]]], \"passed\": false}, {\"check\": \"self excluded\", \"actual\": [[1, [\"bo\"]]], \"expected\": [[1, [\"bo\"]]], \"passed\": true}, {\"check\": \"empty reads\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}