{"abstract":"Fragments that repeat the same total are reported as conflicting.","category":"Email MIME structure","checks":7,"contract":"fragments {id, number, total (optional), body}. Per id: the first fragment with a given number wins; totals seen on fragments must all agree (otherwise \"conflict\"); without any total the message is \"incomplete\"; it is \"complete\" when every number 1..total is present, and its text joins those numbers in order (other numbers are ignored). Result rows [id, status, text or None] sorted by id.","evaluation_group":"w2-email_mime_structure-partial-reassembly","failed_approach":"Comparing only the first and last totals misses a disagreeing total in the middle. The attempted `if len(g['totals']) > 1 and g['totals'][0] != g['totals'][-1]:` still disagrees with a fixture.","family":"w2-email_mime_structure-partial-reassembly-total-agreement","id":"FA-76726","implementations":{"attempt":{"sha256":"eb8aa79dc995b608c3c41483ec18b09eff2808af0b828b9524bd2dcee7784f0f","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(fragments):\n    groups = {}\n    for f in fragments:\n        g = groups.setdefault(f['id'], {'totals': [], 'parts': {}})\n        if f.get('total') is not None:\n            g['totals'].append(f['total'])\n        g['parts'].setdefault(f['number'], f['body'])\n    out = []\n    for pid in sorted(groups):\n        g = groups[pid]\n        if len(g['totals']) > 1 and g['totals'][0] != g['totals'][-1]:\n            out.append([pid, 'conflict', None])\n            continue\n        if not g['totals']:\n            out.append([pid, 'incomplete', None])\n            continue\n        total = g['totals'][0]\n        if all(n in g['parts'] for n in range(1, total + 1)):\n            out.append([pid, 'complete', ''.join(g['parts'].get(n, '') for n in range(1, total + 1))])\n        else:\n            out.append([pid, 'incomplete', None])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD1'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD1']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b1'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '11'}],), [['r', 'complete', '1123']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z1'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one1'}],), [['t', 'complete', 'one1two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z1'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w1', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w1', 'complete', 'solo']])], 2: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD2'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD2']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b2'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '12'}],), [['r', 'complete', '1223']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z2'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one2'}],), [['t', 'complete', 'one2two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z2'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w2', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w2', 'complete', 'solo']])], 3: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD3'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD3']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b3'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '13'}],), [['r', 'complete', '1323']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z3'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one3'}],), [['t', 'complete', 'one3two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z3'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w3', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w3', 'complete', 'solo']])], 4: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD4'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD4']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b4'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '14'}],), [['r', 'complete', '1423']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z4'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one4'}],), [['t', 'complete', 'one4two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z4'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w4', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w4', 'complete', 'solo']])], 5: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD5'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD5']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b5'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '15'}],), [['r', 'complete', '1523']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z5'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one5'}],), [['t', 'complete', 'one5two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z5'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w5', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w5', 'complete', 'solo']])]}\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":"62efc5ec79ff25c45c33eafeeac6079d4bc163e10fb8f5cb688d8e39aec61243","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(fragments):\n    groups = {}\n    for f in fragments:\n        g = groups.setdefault(f['id'], {'totals': [], 'parts': {}})\n        if f.get('total') is not None:\n            g['totals'].append(f['total'])\n        g['parts'].setdefault(f['number'], f['body'])\n    out = []\n    for pid in sorted(groups):\n        g = groups[pid]\n        if len(g['totals']) > 1:\n            out.append([pid, 'conflict', None])\n            continue\n        if not g['totals']:\n            out.append([pid, 'incomplete', None])\n            continue\n        total = g['totals'][0]\n        if all(n in g['parts'] for n in range(1, total + 1)):\n            out.append([pid, 'complete', ''.join(g['parts'].get(n, '') for n in range(1, total + 1))])\n        else:\n            out.append([pid, 'incomplete', None])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD1'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD1']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b1'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '11'}],), [['r', 'complete', '1123']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z1'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one1'}],), [['t', 'complete', 'one1two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z1'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w1', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w1', 'complete', 'solo']])], 2: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD2'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD2']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b2'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '12'}],), [['r', 'complete', '1223']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z2'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one2'}],), [['t', 'complete', 'one2two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z2'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w2', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w2', 'complete', 'solo']])], 3: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD3'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD3']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b3'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '13'}],), [['r', 'complete', '1323']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z3'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one3'}],), [['t', 'complete', 'one3two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z3'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w3', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w3', 'complete', 'solo']])], 4: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD4'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD4']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b4'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '14'}],), [['r', 'complete', '1423']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z4'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one4'}],), [['t', 'complete', 'one4two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z4'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w4', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w4', 'complete', 'solo']])], 5: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD5'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD5']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b5'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '15'}],), [['r', 'complete', '1523']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z5'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one5'}],), [['t', 'complete', 'one5two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z5'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w5', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w5', 'complete', 'solo']])]}\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":"7ea7a0afdb84a1976ced4efc4f145ddcb3910927e9390038d35d5315978eaa37","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(fragments):\n    groups = {}\n    for f in fragments:\n        g = groups.setdefault(f['id'], {'totals': [], 'parts': {}})\n        if f.get('total') is not None:\n            g['totals'].append(f['total'])\n        g['parts'].setdefault(f['number'], f['body'])\n    out = []\n    for pid in sorted(groups):\n        g = groups[pid]\n        if len(set(g['totals'])) > 1:\n            out.append([pid, 'conflict', None])\n            continue\n        if not g['totals']:\n            out.append([pid, 'incomplete', None])\n            continue\n        total = g['totals'][0]\n        if all(n in g['parts'] for n in range(1, total + 1)):\n            out.append([pid, 'complete', ''.join(g['parts'].get(n, '') for n in range(1, total + 1))])\n        else:\n            out.append([pid, 'incomplete', None])\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD1'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD1']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b1'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '11'}],), [['r', 'complete', '1123']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z1'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one1'}],), [['t', 'complete', 'one1two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z1'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w1', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w1', 'complete', 'solo']])], 2: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD2'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD2']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b2'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '12'}],), [['r', 'complete', '1223']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z2'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one2'}],), [['t', 'complete', 'one2two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z2'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w2', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w2', 'complete', 'solo']])], 3: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD3'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD3']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b3'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '13'}],), [['r', 'complete', '1323']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z3'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one3'}],), [['t', 'complete', 'one3two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z3'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w3', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w3', 'complete', 'solo']])], 4: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD4'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD4']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b4'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '14'}],), [['r', 'complete', '1423']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z4'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one4'}],), [['t', 'complete', 'one4two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z4'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w4', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w4', 'complete', 'solo']])], 5: [('retransmitted fragment', ([{'id': 'p', 'number': 1, 'body': 'AB'}, {'id': 'p', 'number': 2, 'total': 2, 'body': 'CD5'}, {'id': 'p', 'number': 1, 'body': 'XX'}],), [['p', 'complete', 'ABCD5']]), ('no total yet', ([{'id': 'q', 'number': 1, 'body': 'a'}, {'id': 'q', 'number': 2, 'body': 'b5'}],), [['q', 'incomplete', None]]), ('repeated equal totals', ([{'id': 'r', 'number': 2, 'total': 3, 'body': '2'}, {'id': 'r', 'number': 3, 'total': 3, 'body': '3'}, {'id': 'r', 'number': 1, 'body': '15'}],), [['r', 'complete', '1523']]), ('disagreeing totals', ([{'id': 's', 'number': 1, 'total': 3, 'body': 'x'}, {'id': 's', 'number': 2, 'total': 4, 'body': 'y'}, {'id': 's', 'number': 3, 'total': 3, 'body': 'z5'}],), [['s', 'conflict', None]]), ('out of order with stray number', ([{'id': 't', 'number': 2, 'total': 2, 'body': 'two'}, {'id': 't', 'number': 3, 'body': 'junk'}, {'id': 't', 'number': 1, 'body': 'one5'}],), [['t', 'complete', 'one5two']]), ('missing middle with stray', ([{'id': 'u', 'number': 1, 'total': 2, 'body': 'a'}, {'id': 'u', 'number': 5, 'body': 'z5'}],), [['u', 'incomplete', None]]), ('two messages', ([{'id': 'w5', 'number': 1, 'total': 1, 'body': 'solo'}, {'id': 'v', 'number': 1, 'total': 2, 'body': 'half'}],), [['v', 'incomplete', None], ['w5', 'complete', 'solo']])]}\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 model over pre-parsed MIME dictionaries; not a conforming MIME parser, generator or mail client. 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-email_mime_structure-partial-reassembly-total-agreement","generated_at":"2026-09-29T14:49:19.054392+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Large messages split with message/partial must be reassembled exactly once and in order.","repair":"Use `if len(set(g['totals'])) > 1:` for the total agreement decision and keep every other rule of the model unchanged.","root_cause":"The total agreement decision evaluates `if len(g['totals']) > 1:` where the contract requires `if len(set(g['totals'])) > 1:`.","sha256":"dfe24109f10ae94f531c7700f1392f1cd442fd6a29ea5b76c7012c0902724f74","title":"Reassemble message/partial fragments: total agreement · case 01","variant":1,"variant_policy":"N selects a different enumerated fixture set (renamed identifiers, part counts and sizes); boundary fixtures recur across variants.","verification":{"attempt":{"elapsed_ms":38.819,"exit_code":1,"observations":[{"actual":[["p","complete","ABCD1"]],"check":"retransmitted fragment","expected":[["p","complete","ABCD1"]],"passed":true},{"actual":[["q","incomplete",null]],"check":"no total yet","expected":[["q","incomplete",null]],"passed":true},{"actual":[["r","complete","1123"]],"check":"repeated equal totals","expected":[["r","complete","1123"]],"passed":true},{"actual":[["s","complete","xyz1"]],"check":"disagreeing totals","expected":[["s","conflict",null]],"passed":false},{"actual":[["t","complete","one1two"]],"check":"out of order with stray number","expected":[["t","complete","one1two"]],"passed":true},{"actual":[["u","incomplete",null]],"check":"missing middle with stray","expected":[["u","incomplete",null]],"passed":true},{"actual":[["v","incomplete",null],["w1","complete","solo"]],"check":"two messages","expected":[["v","incomplete",null],["w1","complete","solo"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"retransmitted fragment\", \"actual\": [[\"p\", \"complete\", \"ABCD1\"]], \"expected\": [[\"p\", \"complete\", \"ABCD1\"]], \"passed\": true}, {\"check\": \"no total yet\", \"actual\": [[\"q\", \"incomplete\", null]], \"expected\": [[\"q\", \"incomplete\", null]], \"passed\": true}, {\"check\": \"repeated equal totals\", \"actual\": [[\"r\", \"complete\", \"1123\"]], \"expected\": [[\"r\", \"complete\", \"1123\"]], \"passed\": true}, {\"check\": \"disagreeing totals\", \"actual\": [[\"s\", \"complete\", \"xyz1\"]], \"expected\": [[\"s\", \"conflict\", null]], \"passed\": false}, {\"check\": \"out of order with stray number\", \"actual\": [[\"t\", \"complete\", \"one1two\"]], \"expected\": [[\"t\", \"complete\", \"one1two\"]], \"passed\": true}, {\"check\": \"missing middle with stray\", \"actual\": [[\"u\", \"incomplete\", null]], \"expected\": [[\"u\", \"incomplete\", null]], \"passed\": true}, {\"check\": \"two messages\", \"actual\": [[\"v\", \"incomplete\", null], [\"w1\", \"complete\", \"solo\"]], \"expected\": [[\"v\", \"incomplete\", null], [\"w1\", \"complete\", \"solo\"]], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.023,"exit_code":1,"observations":[{"actual":[["p","complete","ABCD1"]],"check":"retransmitted fragment","expected":[["p","complete","ABCD1"]],"passed":true},{"actual":[["q","incomplete",null]],"check":"no total yet","expected":[["q","incomplete",null]],"passed":true},{"actual":[["r","conflict",null]],"check":"repeated equal totals","expected":[["r","complete","1123"]],"passed":false},{"actual":[["s","conflict",null]],"check":"disagreeing totals","expected":[["s","conflict",null]],"passed":true},{"actual":[["t","complete","one1two"]],"check":"out of order with stray number","expected":[["t","complete","one1two"]],"passed":true},{"actual":[["u","incomplete",null]],"check":"missing middle with stray","expected":[["u","incomplete",null]],"passed":true},{"actual":[["v","incomplete",null],["w1","complete","solo"]],"check":"two messages","expected":[["v","incomplete",null],["w1","complete","solo"]],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"retransmitted fragment\", \"actual\": [[\"p\", \"complete\", \"ABCD1\"]], \"expected\": [[\"p\", \"complete\", \"ABCD1\"]], \"passed\": true}, {\"check\": \"no total yet\", \"actual\": [[\"q\", \"incomplete\", null]], \"expected\": [[\"q\", \"incomplete\", null]], \"passed\": true}, {\"check\": \"repeated equal totals\", \"actual\": [[\"r\", \"conflict\", null]], \"expected\": [[\"r\", \"complete\", \"1123\"]], \"passed\": false}, {\"check\": \"disagreeing totals\", \"actual\": [[\"s\", \"conflict\", null]], \"expected\": [[\"s\", \"conflict\", null]], \"passed\": true}, {\"check\": \"out of order with stray number\", \"actual\": [[\"t\", \"complete\", \"one1two\"]], \"expected\": [[\"t\", \"complete\", \"one1two\"]], \"passed\": true}, {\"check\": \"missing middle with stray\", \"actual\": [[\"u\", \"incomplete\", null]], \"expected\": [[\"u\", \"incomplete\", null]], \"passed\": true}, {\"check\": \"two messages\", \"actual\": [[\"v\", \"incomplete\", null], [\"w1\", \"complete\", \"solo\"]], \"expected\": [[\"v\", \"incomplete\", null], [\"w1\", \"complete\", \"solo\"]], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":39.854,"exit_code":0,"observations":[{"actual":[["p","complete","ABCD1"]],"check":"retransmitted fragment","expected":[["p","complete","ABCD1"]],"passed":true},{"actual":[["q","incomplete",null]],"check":"no total yet","expected":[["q","incomplete",null]],"passed":true},{"actual":[["r","complete","1123"]],"check":"repeated equal totals","expected":[["r","complete","1123"]],"passed":true},{"actual":[["s","conflict",null]],"check":"disagreeing totals","expected":[["s","conflict",null]],"passed":true},{"actual":[["t","complete","one1two"]],"check":"out of order with stray number","expected":[["t","complete","one1two"]],"passed":true},{"actual":[["u","incomplete",null]],"check":"missing middle with stray","expected":[["u","incomplete",null]],"passed":true},{"actual":[["v","incomplete",null],["w1","complete","solo"]],"check":"two messages","expected":[["v","incomplete",null],["w1","complete","solo"]],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"retransmitted fragment\", \"actual\": [[\"p\", \"complete\", \"ABCD1\"]], \"expected\": [[\"p\", \"complete\", \"ABCD1\"]], \"passed\": true}, {\"check\": \"no total yet\", \"actual\": [[\"q\", \"incomplete\", null]], \"expected\": [[\"q\", \"incomplete\", null]], \"passed\": true}, {\"check\": \"repeated equal totals\", \"actual\": [[\"r\", \"complete\", \"1123\"]], \"expected\": [[\"r\", \"complete\", \"1123\"]], \"passed\": true}, {\"check\": \"disagreeing totals\", \"actual\": [[\"s\", \"conflict\", null]], \"expected\": [[\"s\", \"conflict\", null]], \"passed\": true}, {\"check\": \"out of order with stray number\", \"actual\": [[\"t\", \"complete\", \"one1two\"]], \"expected\": [[\"t\", \"complete\", \"one1two\"]], \"passed\": true}, {\"check\": \"missing middle with stray\", \"actual\": [[\"u\", \"incomplete\", null]], \"expected\": [[\"u\", \"incomplete\", null]], \"passed\": true}, {\"check\": \"two messages\", \"actual\": [[\"v\", \"incomplete\", null], [\"w1\", \"complete\", \"solo\"]], \"expected\": [[\"v\", \"incomplete\", null], [\"w1\", \"complete\", \"solo\"]], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}