{"abstract":"A retried send is told it received the newest seq of the conversation instead of its own.","category":"Chat ordering and read receipts","checks":6,"contract":"requests are [conv, sender, nonce] in arrival order; members maps conv -> member list. A sender who is not a member gets \"forbidden\" and consumes nothing. Each conversation numbers accepted messages 1, 2, 3... A retry with the same (conv, sender, nonce) returns the originally assigned seq without consuming a new one.","contract_signature":"requests, members","evaluation_group":"w2-chat_ordering_and_read_receipts-sequence-assign","failed_approach":"Rejecting retries as duplicates leaves the client without its assigned sequence. The attempted `out.append('duplicate')` still disagrees with a fixture.","family":"w2-chat_ordering_and_read_receipts-sequence-assign-retry-returns-original","id":"FA-76276","implementations":{"attempt":{"sha256":"3beba7f665a074483d0c1d2d23073a025f66fc2b93f53661cfcdbf7d91e1ddc6","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(requests, members):\n    counters = {}\n    known = {}\n    out = []\n    for conv, sender, nonce in requests:\n        if sender not in members.get(conv, []):\n            out.append('forbidden')\n            continue\n        key = (conv, sender, nonce)\n        if key in known:\n            out.append('duplicate')\n            continue\n        counters[conv] = counters.get(conv, 0) + 1\n        known[key] = counters[conv]\n        out.append(counters[conv])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('nonce reused by another sender', ([['c', 'al', 'n1'], ['c', 'bo', 'n1']], {'c': ['al', 'bo']}), [1, 2]), ('nonce reused in another conversation', ([['d', 'al', 'z'], ['c', 'al', 'n1'], ['d', 'al', 'n1']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('two conversations interleaved', ([['c', 'al', 'a'], ['d', 'al', 'b'], ['c', 'al', 'c']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('retry returns original', ([['c', 'al', 'x'], ['c', 'al', 'y'], ['c', 'al', 'x']], {'c': ['al']}), [1, 2, 1]), ('forbidden sender', ([['c', 'eve', 'z'], ['c', 'al', 'q']], {'c': ['al']}), ['forbidden', 1]), ('burst', ([['c', 'al', 'm0'], ['c', 'al', 'm1']], {'c': ['al']}), [1, 2])], 2: [('nonce reused by another sender', ([['c', 'al', 'n1'], ['c', 'bo', 'n1']], {'c': ['al', 'bo']}), [1, 2]), ('nonce reused in another conversation', ([['d', 'al', 'z'], ['c', 'al', 'n2'], ['d', 'al', 'n2']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('two conversations interleaved', ([['c', 'al', 'a'], ['d', 'al', 'b'], ['c', 'al', 'c']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('retry returns original', ([['c', 'al', 'x'], ['c', 'al', 'y'], ['c', 'al', 'x']], {'c': ['al']}), [1, 2, 1]), ('forbidden sender', ([['c', 'eve', 'z'], ['c', 'al', 'q']], {'c': ['al']}), ['forbidden', 1]), ('burst', ([['c', 'al', 'm0'], ['c', 'al', 'm1'], ['c', 'al', 'm2']], {'c': ['al']}), [1, 2, 3])], 3: [('nonce reused by another sender', ([['c', 'al', 'n1'], ['c', 'bo', 'n1']], {'c': ['al', 'bo']}), [1, 2]), ('nonce reused in another conversation', ([['d', 'al', 'z'], ['c', 'al', 'n3'], ['d', 'al', 'n3']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('two conversations interleaved', ([['c', 'al', 'a'], ['d', 'al', 'b'], ['c', 'al', 'c']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('retry returns original', ([['c', 'al', 'x'], ['c', 'al', 'y'], ['c', 'al', 'x']], {'c': ['al']}), [1, 2, 1]), ('forbidden sender', ([['c', 'eve', 'z'], ['c', 'al', 'q']], {'c': ['al']}), ['forbidden', 1]), ('burst', ([['c', 'al', 'm0'], ['c', 'al', 'm1'], ['c', 'al', 'm2'], ['c', 'al', 'm3']], {'c': ['al']}), [1, 2, 3, 4])], 4: [('nonce reused by another sender', ([['c', 'al', 'n1'], ['c', 'bo', 'n1']], {'c': ['al', 'bo']}), [1, 2]), ('nonce reused in another conversation', ([['d', 'al', 'z'], ['c', 'al', 'n4'], ['d', 'al', 'n4']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('two conversations interleaved', ([['c', 'al', 'a'], ['d', 'al', 'b'], ['c', 'al', 'c']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('retry returns original', ([['c', 'al', 'x'], ['c', 'al', 'y'], ['c', 'al', 'x']], {'c': ['al']}), [1, 2, 1]), ('forbidden sender', ([['c', 'eve', 'z'], ['c', 'al', 'q']], {'c': ['al']}), ['forbidden', 1]), ('burst', ([['c', 'al', 'm0'], ['c', 'al', 'm1'], ['c', 'al', 'm2'], ['c', 'al', 'm3'], ['c', 'al', 'm4']], {'c': ['al']}), [1, 2, 3, 4, 5])], 5: [('nonce reused by another sender', ([['c', 'al', 'n1'], ['c', 'bo', 'n1']], {'c': ['al', 'bo']}), [1, 2]), ('nonce reused in another conversation', ([['d', 'al', 'z'], ['c', 'al', 'n5'], ['d', 'al', 'n5']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('two conversations interleaved', ([['c', 'al', 'a'], ['d', 'al', 'b'], ['c', 'al', 'c']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('retry returns original', ([['c', 'al', 'x'], ['c', 'al', 'y'], ['c', 'al', 'x']], {'c': ['al']}), [1, 2, 1]), ('forbidden sender', ([['c', 'eve', 'z'], ['c', 'al', 'q']], {'c': ['al']}), ['forbidden', 1]), ('burst', ([['c', 'al', 'm0'], ['c', 'al', 'm1'], ['c', 'al', 'm2'], ['c', 'al', 'm3'], ['c', 'al', 'm4'], ['c', 'al', 'm5']], {'c': ['al']}), [1, 2, 3, 4, 5, 6])]}\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":"b3552f4b43926e41eef43ede852138452712113f67fbcf0dd4fc6420ca7fa996","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(requests, members):\n    counters = {}\n    known = {}\n    out = []\n    for conv, sender, nonce in requests:\n        if sender not in members.get(conv, []):\n            out.append('forbidden')\n            continue\n        key = (conv, sender, nonce)\n        if key in known:\n            out.append(counters[conv])\n            continue\n        counters[conv] = counters.get(conv, 0) + 1\n        known[key] = counters[conv]\n        out.append(counters[conv])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('nonce reused by another sender', ([['c', 'al', 'n1'], ['c', 'bo', 'n1']], {'c': ['al', 'bo']}), [1, 2]), ('nonce reused in another conversation', ([['d', 'al', 'z'], ['c', 'al', 'n1'], ['d', 'al', 'n1']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('two conversations interleaved', ([['c', 'al', 'a'], ['d', 'al', 'b'], ['c', 'al', 'c']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('retry returns original', ([['c', 'al', 'x'], ['c', 'al', 'y'], ['c', 'al', 'x']], {'c': ['al']}), [1, 2, 1]), ('forbidden sender', ([['c', 'eve', 'z'], ['c', 'al', 'q']], {'c': ['al']}), ['forbidden', 1]), ('burst', ([['c', 'al', 'm0'], ['c', 'al', 'm1']], {'c': ['al']}), [1, 2])], 2: [('nonce reused by another sender', ([['c', 'al', 'n1'], ['c', 'bo', 'n1']], {'c': ['al', 'bo']}), [1, 2]), ('nonce reused in another conversation', ([['d', 'al', 'z'], ['c', 'al', 'n2'], ['d', 'al', 'n2']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('two conversations interleaved', ([['c', 'al', 'a'], ['d', 'al', 'b'], ['c', 'al', 'c']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('retry returns original', ([['c', 'al', 'x'], ['c', 'al', 'y'], ['c', 'al', 'x']], {'c': ['al']}), [1, 2, 1]), ('forbidden sender', ([['c', 'eve', 'z'], ['c', 'al', 'q']], {'c': ['al']}), ['forbidden', 1]), ('burst', ([['c', 'al', 'm0'], ['c', 'al', 'm1'], ['c', 'al', 'm2']], {'c': ['al']}), [1, 2, 3])], 3: [('nonce reused by another sender', ([['c', 'al', 'n1'], ['c', 'bo', 'n1']], {'c': ['al', 'bo']}), [1, 2]), ('nonce reused in another conversation', ([['d', 'al', 'z'], ['c', 'al', 'n3'], ['d', 'al', 'n3']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('two conversations interleaved', ([['c', 'al', 'a'], ['d', 'al', 'b'], ['c', 'al', 'c']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('retry returns original', ([['c', 'al', 'x'], ['c', 'al', 'y'], ['c', 'al', 'x']], {'c': ['al']}), [1, 2, 1]), ('forbidden sender', ([['c', 'eve', 'z'], ['c', 'al', 'q']], {'c': ['al']}), ['forbidden', 1]), ('burst', ([['c', 'al', 'm0'], ['c', 'al', 'm1'], ['c', 'al', 'm2'], ['c', 'al', 'm3']], {'c': ['al']}), [1, 2, 3, 4])], 4: [('nonce reused by another sender', ([['c', 'al', 'n1'], ['c', 'bo', 'n1']], {'c': ['al', 'bo']}), [1, 2]), ('nonce reused in another conversation', ([['d', 'al', 'z'], ['c', 'al', 'n4'], ['d', 'al', 'n4']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('two conversations interleaved', ([['c', 'al', 'a'], ['d', 'al', 'b'], ['c', 'al', 'c']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('retry returns original', ([['c', 'al', 'x'], ['c', 'al', 'y'], ['c', 'al', 'x']], {'c': ['al']}), [1, 2, 1]), ('forbidden sender', ([['c', 'eve', 'z'], ['c', 'al', 'q']], {'c': ['al']}), ['forbidden', 1]), ('burst', ([['c', 'al', 'm0'], ['c', 'al', 'm1'], ['c', 'al', 'm2'], ['c', 'al', 'm3'], ['c', 'al', 'm4']], {'c': ['al']}), [1, 2, 3, 4, 5])], 5: [('nonce reused by another sender', ([['c', 'al', 'n1'], ['c', 'bo', 'n1']], {'c': ['al', 'bo']}), [1, 2]), ('nonce reused in another conversation', ([['d', 'al', 'z'], ['c', 'al', 'n5'], ['d', 'al', 'n5']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('two conversations interleaved', ([['c', 'al', 'a'], ['d', 'al', 'b'], ['c', 'al', 'c']], {'c': ['al'], 'd': ['al']}), [1, 1, 2]), ('retry returns original', ([['c', 'al', 'x'], ['c', 'al', 'y'], ['c', 'al', 'x']], {'c': ['al']}), [1, 2, 1]), ('forbidden sender', ([['c', 'eve', 'z'], ['c', 'al', 'q']], {'c': ['al']}), ['forbidden', 1]), ('burst', ([['c', 'al', 'm0'], ['c', 'al', 'm1'], ['c', 'al', 'm2'], ['c', 'al', 'm3'], ['c', 'al', 'm4'], ['c', 'al', 'm5']], {'c': ['al']}), [1, 2, 3, 4, 5, 6])]}\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-sequence-assign-retry-returns-original","generated_at":"2026-09-29T14:49:14.811165+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Server sequencing is the backbone of chat ordering; idempotency errors create duplicates or gaps.","root_cause":"The retry returns original decision evaluates `out.append(counters[conv])` where the contract requires `out.append(known[key])`.","sha256":"fa87f62ec0f05f501711da69e07c328dca9061b37137e8fc995cd74ddc5b1a14","title":"Assign idempotent per-conversation sequence numbers: retry returns original · 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":48.284,"exit_code":1,"observations":[{"actual":[1,2],"check":"nonce reused by another sender","expected":[1,2],"passed":true},{"actual":[1,1,2],"check":"nonce reused in another conversation","expected":[1,1,2],"passed":true},{"actual":[1,1,2],"check":"two conversations interleaved","expected":[1,1,2],"passed":true},{"actual":[1,2,"duplicate"],"check":"retry returns original","expected":[1,2,1],"passed":false},{"actual":["forbidden",1],"check":"forbidden sender","expected":["forbidden",1],"passed":true},{"actual":[1,2],"check":"burst","expected":[1,2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nonce reused by another sender\", \"actual\": [1, 2], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"nonce reused in another conversation\", \"actual\": [1, 1, 2], \"expected\": [1, 1, 2], \"passed\": true}, {\"check\": \"two conversations interleaved\", \"actual\": [1, 1, 2], \"expected\": [1, 1, 2], \"passed\": true}, {\"check\": \"retry returns original\", \"actual\": [1, 2, \"duplicate\"], \"expected\": [1, 2, 1], \"passed\": false}, {\"check\": \"forbidden sender\", \"actual\": [\"forbidden\", 1], \"expected\": [\"forbidden\", 1], \"passed\": true}, {\"check\": \"burst\", \"actual\": [1, 2], \"expected\": [1, 2], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":42.914,"exit_code":1,"observations":[{"actual":[1,2],"check":"nonce reused by another sender","expected":[1,2],"passed":true},{"actual":[1,1,2],"check":"nonce reused in another conversation","expected":[1,1,2],"passed":true},{"actual":[1,1,2],"check":"two conversations interleaved","expected":[1,1,2],"passed":true},{"actual":[1,2,2],"check":"retry returns original","expected":[1,2,1],"passed":false},{"actual":["forbidden",1],"check":"forbidden sender","expected":["forbidden",1],"passed":true},{"actual":[1,2],"check":"burst","expected":[1,2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"nonce reused by another sender\", \"actual\": [1, 2], \"expected\": [1, 2], \"passed\": true}, {\"check\": \"nonce reused in another conversation\", \"actual\": [1, 1, 2], \"expected\": [1, 1, 2], \"passed\": true}, {\"check\": \"two conversations interleaved\", \"actual\": [1, 1, 2], \"expected\": [1, 1, 2], \"passed\": true}, {\"check\": \"retry returns original\", \"actual\": [1, 2, 2], \"expected\": [1, 2, 1], \"passed\": false}, {\"check\": \"forbidden sender\", \"actual\": [\"forbidden\", 1], \"expected\": [\"forbidden\", 1], \"passed\": true}, {\"check\": \"burst\", \"actual\": [1, 2], \"expected\": [1, 2], \"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."}}