{"abstract":"Messages relayed by a lagging edge node with an earlier wall-clock stamp jump ahead of messages the server sequenced first.","category":"Chat ordering and read receipts","checks":7,"contract":"confirmed holds server messages {id, seq, ts, optional nonce}; the server seq is the only authority for order and a redelivered copy (same seq, possibly another gateway ts) is shown once (first copy kept). pending holds local unsent messages {nonce, created}; a pending message whose nonce was echoed back by any confirmed message is dropped. Result: confirmed ids in seq order, then local:<nonce> for the remaining pending sends ordered by (created, nonce).","evaluation_group":"w2-chat_ordering_and_read_receipts-timeline-merge","failed_approach":"Tie-breaking on the sequence only helps equal timestamps; skewed timestamps still override the authoritative sequence. The attempted `key=lambda m: (m['ts'], m['seq'])` still disagrees with a fixture.","family":"w2-chat_ordering_and_read_receipts-timeline-merge-server-order-key","id":"FA-75841","implementations":{"attempt":{"sha256":"76c2c29c9f3ae082fd023eccc7bff43c136e31946a06439b394d68d32bb54a80","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(confirmed, pending):\n    seen = set()\n    rows = []\n    for m in sorted(confirmed, key=lambda m: (m['ts'], m['seq'])):\n        key = m['seq']\n        if key in seen:\n            continue\n        seen.add(key)\n        rows.append(m)\n    echoed = {m['nonce'] for m in rows if m.get('nonce')}\n    tail = sorted((p for p in pending if p['nonce'] not in echoed), key=lambda p: (p['created'], p['nonce']))\n    return [m['id'] for m in rows] + ['local:' + p['nonce'] for p in tail]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 1050}, {'id': 'm1', 'seq': 1, 'ts': 1090}, {'id': 'm3', 'seq': 3, 'ts': 1095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 1000}, {'id': 'a', 'seq': 5, 'ts': 2501}, {'id': 'b', 'seq': 6, 'ts': 3600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 1, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 6}], [{'nonce': 'n1', 'created': -4}, {'nonce': 'n2', 'created': 8}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 2100}, {'nonce': 'aa', 'created': 2900}, {'nonce': 'mm', 'created': 2200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c1', 'seq': 1, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c1', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b1', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b1'])], 2: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 2050}, {'id': 'm1', 'seq': 1, 'ts': 2090}, {'id': 'm3', 'seq': 3, 'ts': 2095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 2000}, {'id': 'a', 'seq': 5, 'ts': 3502}, {'id': 'b', 'seq': 6, 'ts': 4600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 2, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 7}], [{'nonce': 'n1', 'created': -3}, {'nonce': 'n2', 'created': 9}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 3100}, {'nonce': 'aa', 'created': 3900}, {'nonce': 'mm', 'created': 3200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c2', 'seq': 2, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c2', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b2', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b2'])], 3: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 3050}, {'id': 'm1', 'seq': 1, 'ts': 3090}, {'id': 'm3', 'seq': 3, 'ts': 3095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 3000}, {'id': 'a', 'seq': 5, 'ts': 4503}, {'id': 'b', 'seq': 6, 'ts': 5600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 3, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 8}], [{'nonce': 'n1', 'created': -2}, {'nonce': 'n2', 'created': 10}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 4100}, {'nonce': 'aa', 'created': 4900}, {'nonce': 'mm', 'created': 4200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c3', 'seq': 3, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c3', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b3', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b3'])], 4: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 4050}, {'id': 'm1', 'seq': 1, 'ts': 4090}, {'id': 'm3', 'seq': 3, 'ts': 4095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 4000}, {'id': 'a', 'seq': 5, 'ts': 5504}, {'id': 'b', 'seq': 6, 'ts': 6600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 4, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 9}], [{'nonce': 'n1', 'created': -1}, {'nonce': 'n2', 'created': 11}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 5100}, {'nonce': 'aa', 'created': 5900}, {'nonce': 'mm', 'created': 5200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c4', 'seq': 4, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c4', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b4', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b4'])], 5: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 5050}, {'id': 'm1', 'seq': 1, 'ts': 5090}, {'id': 'm3', 'seq': 3, 'ts': 5095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 5000}, {'id': 'a', 'seq': 5, 'ts': 6505}, {'id': 'b', 'seq': 6, 'ts': 7600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 5, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 10}], [{'nonce': 'n1', 'created': 0}, {'nonce': 'n2', 'created': 12}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 6100}, {'nonce': 'aa', 'created': 6900}, {'nonce': 'mm', 'created': 6200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c5', 'seq': 5, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c5', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b5', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b5'])]}\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":"94b189052c536e73b47161dae3b1a3e15e358f1f7a747f8ed7e38760df02b37a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(confirmed, pending):\n    seen = set()\n    rows = []\n    for m in sorted(confirmed, key=lambda m: m['ts']):\n        key = m['seq']\n        if key in seen:\n            continue\n        seen.add(key)\n        rows.append(m)\n    echoed = {m['nonce'] for m in rows if m.get('nonce')}\n    tail = sorted((p for p in pending if p['nonce'] not in echoed), key=lambda p: (p['created'], p['nonce']))\n    return [m['id'] for m in rows] + ['local:' + p['nonce'] for p in tail]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 1050}, {'id': 'm1', 'seq': 1, 'ts': 1090}, {'id': 'm3', 'seq': 3, 'ts': 1095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 1000}, {'id': 'a', 'seq': 5, 'ts': 2501}, {'id': 'b', 'seq': 6, 'ts': 3600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 1, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 6}], [{'nonce': 'n1', 'created': -4}, {'nonce': 'n2', 'created': 8}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 2100}, {'nonce': 'aa', 'created': 2900}, {'nonce': 'mm', 'created': 2200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c1', 'seq': 1, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c1', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b1', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b1'])], 2: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 2050}, {'id': 'm1', 'seq': 1, 'ts': 2090}, {'id': 'm3', 'seq': 3, 'ts': 2095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 2000}, {'id': 'a', 'seq': 5, 'ts': 3502}, {'id': 'b', 'seq': 6, 'ts': 4600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 2, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 7}], [{'nonce': 'n1', 'created': -3}, {'nonce': 'n2', 'created': 9}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 3100}, {'nonce': 'aa', 'created': 3900}, {'nonce': 'mm', 'created': 3200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c2', 'seq': 2, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c2', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b2', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b2'])], 3: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 3050}, {'id': 'm1', 'seq': 1, 'ts': 3090}, {'id': 'm3', 'seq': 3, 'ts': 3095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 3000}, {'id': 'a', 'seq': 5, 'ts': 4503}, {'id': 'b', 'seq': 6, 'ts': 5600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 3, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 8}], [{'nonce': 'n1', 'created': -2}, {'nonce': 'n2', 'created': 10}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 4100}, {'nonce': 'aa', 'created': 4900}, {'nonce': 'mm', 'created': 4200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c3', 'seq': 3, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c3', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b3', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b3'])], 4: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 4050}, {'id': 'm1', 'seq': 1, 'ts': 4090}, {'id': 'm3', 'seq': 3, 'ts': 4095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 4000}, {'id': 'a', 'seq': 5, 'ts': 5504}, {'id': 'b', 'seq': 6, 'ts': 6600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 4, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 9}], [{'nonce': 'n1', 'created': -1}, {'nonce': 'n2', 'created': 11}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 5100}, {'nonce': 'aa', 'created': 5900}, {'nonce': 'mm', 'created': 5200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c4', 'seq': 4, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c4', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b4', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b4'])], 5: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 5050}, {'id': 'm1', 'seq': 1, 'ts': 5090}, {'id': 'm3', 'seq': 3, 'ts': 5095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 5000}, {'id': 'a', 'seq': 5, 'ts': 6505}, {'id': 'b', 'seq': 6, 'ts': 7600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 5, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 10}], [{'nonce': 'n1', 'created': 0}, {'nonce': 'n2', 'created': 12}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 6100}, {'nonce': 'aa', 'created': 6900}, {'nonce': 'mm', 'created': 6200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c5', 'seq': 5, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c5', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b5', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b5'])]}\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":"d651b00fbfb869e50b73cd522cbf91b22092e872cbc5d8983f07290312d640ab","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(confirmed, pending):\n    seen = set()\n    rows = []\n    for m in sorted(confirmed, key=lambda m: m['seq']):\n        key = m['seq']\n        if key in seen:\n            continue\n        seen.add(key)\n        rows.append(m)\n    echoed = {m['nonce'] for m in rows if m.get('nonce')}\n    tail = sorted((p for p in pending if p['nonce'] not in echoed), key=lambda p: (p['created'], p['nonce']))\n    return [m['id'] for m in rows] + ['local:' + p['nonce'] for p in tail]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 1050}, {'id': 'm1', 'seq': 1, 'ts': 1090}, {'id': 'm3', 'seq': 3, 'ts': 1095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 1000}, {'id': 'a', 'seq': 5, 'ts': 2501}, {'id': 'b', 'seq': 6, 'ts': 3600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 1, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 6}], [{'nonce': 'n1', 'created': -4}, {'nonce': 'n2', 'created': 8}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 2100}, {'nonce': 'aa', 'created': 2900}, {'nonce': 'mm', 'created': 2200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c1', 'seq': 1, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c1', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b1', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b1'])], 2: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 2050}, {'id': 'm1', 'seq': 1, 'ts': 2090}, {'id': 'm3', 'seq': 3, 'ts': 2095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 2000}, {'id': 'a', 'seq': 5, 'ts': 3502}, {'id': 'b', 'seq': 6, 'ts': 4600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 2, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 7}], [{'nonce': 'n1', 'created': -3}, {'nonce': 'n2', 'created': 9}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 3100}, {'nonce': 'aa', 'created': 3900}, {'nonce': 'mm', 'created': 3200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c2', 'seq': 2, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c2', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b2', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b2'])], 3: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 3050}, {'id': 'm1', 'seq': 1, 'ts': 3090}, {'id': 'm3', 'seq': 3, 'ts': 3095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 3000}, {'id': 'a', 'seq': 5, 'ts': 4503}, {'id': 'b', 'seq': 6, 'ts': 5600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 3, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 8}], [{'nonce': 'n1', 'created': -2}, {'nonce': 'n2', 'created': 10}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 4100}, {'nonce': 'aa', 'created': 4900}, {'nonce': 'mm', 'created': 4200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c3', 'seq': 3, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c3', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b3', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b3'])], 4: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 4050}, {'id': 'm1', 'seq': 1, 'ts': 4090}, {'id': 'm3', 'seq': 3, 'ts': 4095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 4000}, {'id': 'a', 'seq': 5, 'ts': 5504}, {'id': 'b', 'seq': 6, 'ts': 6600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 4, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 9}], [{'nonce': 'n1', 'created': -1}, {'nonce': 'n2', 'created': 11}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 5100}, {'nonce': 'aa', 'created': 5900}, {'nonce': 'mm', 'created': 5200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c4', 'seq': 4, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c4', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b4', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b4'])], 5: [('skewed edge timestamps', ([{'id': 'm2', 'seq': 2, 'ts': 5050}, {'id': 'm1', 'seq': 1, 'ts': 5090}, {'id': 'm3', 'seq': 3, 'ts': 5095}], []), ['m1', 'm2', 'm3']), ('redelivery through another gateway', ([{'id': 'a', 'seq': 5, 'ts': 5000}, {'id': 'a', 'seq': 5, 'ts': 6505}, {'id': 'b', 'seq': 6, 'ts': 7600}], []), ['a', 'b']), ('echo of an older send', ([{'id': 'x', 'seq': 1, 'ts': 5, 'nonce': 'n1'}, {'id': 'y', 'seq': 2, 'ts': 10}], [{'nonce': 'n1', 'created': 0}, {'nonce': 'n2', 'created': 12}]), ['x', 'y', 'local:n2']), ('pending within one second', ([], [{'nonce': 'zz', 'created': 6100}, {'nonce': 'aa', 'created': 6900}, {'nonce': 'mm', 'created': 6200}]), ['local:zz', 'local:mm', 'local:aa']), ('confirmed then pending', ([{'id': 'c5', 'seq': 5, 'ts': 10}], [{'nonce': 'p', 'created': 3}]), ['c5', 'local:p']), ('empty conversation', ([], []), []), ('equal creation times', ([{'id': 'k', 'seq': 9, 'ts': 1, 'nonce': 'q'}], [{'nonce': 'b5', 'created': 7}, {'nonce': 'a', 'created': 7}]), ['k', 'local:a', 'local:b5'])]}\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-timeline-merge-server-order-key","generated_at":"2026-09-29T14:49:10.585010+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Chat clients render optimistic local sends next to server-ordered history; ordering or echo mistakes show duplicated or jumping bubbles.","repair":"Use `key=lambda m: m['seq']` for the server order key decision and keep every other rule of the model unchanged.","root_cause":"The server order key decision evaluates `key=lambda m: m['ts']` where the contract requires `key=lambda m: m['seq']`.","sha256":"fcaee24da0ef43452c92e88cb89f2155dcf9248795a3bf93271921f2c5fab8b6","title":"Merge server-sequenced messages with local pending sends: server order key · 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":38.302,"exit_code":1,"observations":[{"actual":["m2","m1","m3"],"check":"skewed edge timestamps","expected":["m1","m2","m3"],"passed":false},{"actual":["a","b"],"check":"redelivery through another gateway","expected":["a","b"],"passed":true},{"actual":["x","y","local:n2"],"check":"echo of an older send","expected":["x","y","local:n2"],"passed":true},{"actual":["local:zz","local:mm","local:aa"],"check":"pending within one second","expected":["local:zz","local:mm","local:aa"],"passed":true},{"actual":["c1","local:p"],"check":"confirmed then pending","expected":["c1","local:p"],"passed":true},{"actual":[],"check":"empty conversation","expected":[],"passed":true},{"actual":["k","local:a","local:b1"],"check":"equal creation times","expected":["k","local:a","local:b1"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"skewed edge timestamps\", \"actual\": [\"m2\", \"m1\", \"m3\"], \"expected\": [\"m1\", \"m2\", \"m3\"], \"passed\": false}, {\"check\": \"redelivery through another gateway\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"echo of an older send\", \"actual\": [\"x\", \"y\", \"local:n2\"], \"expected\": [\"x\", \"y\", \"local:n2\"], \"passed\": true}, {\"check\": \"pending within one second\", \"actual\": [\"local:zz\", \"local:mm\", \"local:aa\"], \"expected\": [\"local:zz\", \"local:mm\", \"local:aa\"], \"passed\": true}, {\"check\": \"confirmed then pending\", \"actual\": [\"c1\", \"local:p\"], \"expected\": [\"c1\", \"local:p\"], \"passed\": true}, {\"check\": \"empty conversation\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"equal creation times\", \"actual\": [\"k\", \"local:a\", \"local:b1\"], \"expected\": [\"k\", \"local:a\", \"local:b1\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.26,"exit_code":1,"observations":[{"actual":["m2","m1","m3"],"check":"skewed edge timestamps","expected":["m1","m2","m3"],"passed":false},{"actual":["a","b"],"check":"redelivery through another gateway","expected":["a","b"],"passed":true},{"actual":["x","y","local:n2"],"check":"echo of an older send","expected":["x","y","local:n2"],"passed":true},{"actual":["local:zz","local:mm","local:aa"],"check":"pending within one second","expected":["local:zz","local:mm","local:aa"],"passed":true},{"actual":["c1","local:p"],"check":"confirmed then pending","expected":["c1","local:p"],"passed":true},{"actual":[],"check":"empty conversation","expected":[],"passed":true},{"actual":["k","local:a","local:b1"],"check":"equal creation times","expected":["k","local:a","local:b1"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"skewed edge timestamps\", \"actual\": [\"m2\", \"m1\", \"m3\"], \"expected\": [\"m1\", \"m2\", \"m3\"], \"passed\": false}, {\"check\": \"redelivery through another gateway\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"echo of an older send\", \"actual\": [\"x\", \"y\", \"local:n2\"], \"expected\": [\"x\", \"y\", \"local:n2\"], \"passed\": true}, {\"check\": \"pending within one second\", \"actual\": [\"local:zz\", \"local:mm\", \"local:aa\"], \"expected\": [\"local:zz\", \"local:mm\", \"local:aa\"], \"passed\": true}, {\"check\": \"confirmed then pending\", \"actual\": [\"c1\", \"local:p\"], \"expected\": [\"c1\", \"local:p\"], \"passed\": true}, {\"check\": \"empty conversation\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"equal creation times\", \"actual\": [\"k\", \"local:a\", \"local:b1\"], \"expected\": [\"k\", \"local:a\", \"local:b1\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.374,"exit_code":0,"observations":[{"actual":["m1","m2","m3"],"check":"skewed edge timestamps","expected":["m1","m2","m3"],"passed":true},{"actual":["a","b"],"check":"redelivery through another gateway","expected":["a","b"],"passed":true},{"actual":["x","y","local:n2"],"check":"echo of an older send","expected":["x","y","local:n2"],"passed":true},{"actual":["local:zz","local:mm","local:aa"],"check":"pending within one second","expected":["local:zz","local:mm","local:aa"],"passed":true},{"actual":["c1","local:p"],"check":"confirmed then pending","expected":["c1","local:p"],"passed":true},{"actual":[],"check":"empty conversation","expected":[],"passed":true},{"actual":["k","local:a","local:b1"],"check":"equal creation times","expected":["k","local:a","local:b1"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"skewed edge timestamps\", \"actual\": [\"m1\", \"m2\", \"m3\"], \"expected\": [\"m1\", \"m2\", \"m3\"], \"passed\": true}, {\"check\": \"redelivery through another gateway\", \"actual\": [\"a\", \"b\"], \"expected\": [\"a\", \"b\"], \"passed\": true}, {\"check\": \"echo of an older send\", \"actual\": [\"x\", \"y\", \"local:n2\"], \"expected\": [\"x\", \"y\", \"local:n2\"], \"passed\": true}, {\"check\": \"pending within one second\", \"actual\": [\"local:zz\", \"local:mm\", \"local:aa\"], \"expected\": [\"local:zz\", \"local:mm\", \"local:aa\"], \"passed\": true}, {\"check\": \"confirmed then pending\", \"actual\": [\"c1\", \"local:p\"], \"expected\": [\"c1\", \"local:p\"], \"passed\": true}, {\"check\": \"empty conversation\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"equal creation times\", \"actual\": [\"k\", \"local:a\", \"local:b1\"], \"expected\": [\"k\", \"local:a\", \"local:b1\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}