FAILURE MAP
← Case archive

FA-76726 / Email MIME structure / Open access

Reassemble message/partial fragments: total agreement · case 01

Fragments that repeat the same total are reported as conflicting.

Verified by executionVariant 1 · 7 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The total agreement decision evaluates `if len(g['totals']) > 1:` where the contract requires `if len(set(g['totals'])) > 1:`.

VERIFIED REPAIR

Use `if len(set(g['totals'])) > 1:` for the total agreement decision and keep every other rule of the model unchanged.

Unsuccessful 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.

Case 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.

Why this case matters

Large messages split with message/partial must be reassembled exactly once and in order.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(fragments):
    groups = {}
    for f in fragments:
        g = groups.setdefault(f['id'], {'totals': [], 'parts': {}})
        if f.get('total') is not None:
            g['totals'].append(f['total'])
        g['parts'].setdefault(f['number'], f['body'])
    out = []
    for pid in sorted(groups):
        g = groups[pid]
        if len(g['totals']) > 1:
            out.append([pid, 'conflict', None])
            continue
        if not g['totals']:
            out.append([pid, 'incomplete', None])
            continue
        total = g['totals'][0]
        if all(n in g['parts'] for n in range(1, total + 1)):
            out.append([pid, 'complete', ''.join(g['parts'].get(n, '') for n in range(1, total + 1))])
        else:
            out.append([pid, 'incomplete', None])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_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']])]}
for _label, _args, _expected in _CASES[N]:
    check(_label, solve(*_args), _expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
retransmitted fragment[['p', 'complete', 'ABCD1']][['p', 'complete', 'ABCD1']]Passed
no total yet[['q', 'incomplete', None]][['q', 'incomplete', None]]Passed
repeated equal totals[['r', 'conflict', None]][['r', 'complete', '1123']]Failed
disagreeing totals[['s', 'conflict', None]][['s', 'conflict', None]]Passed
out of order with stray number[['t', 'complete', 'one1two']][['t', 'complete', 'one1two']]Passed
missing middle with stray[['u', 'incomplete', None]][['u', 'incomplete', None]]Passed
two messages[['v', 'incomplete', None], ['w1', 'complete', 'solo']][['v', 'incomplete', None], ['w1', 'complete', 'solo']]Passed

SHA-256 / 62efc5ec79ff25c45c33eafeeac6079d4bc163e10fb8f5cb688d8e39aec61243

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(fragments):
    groups = {}
    for f in fragments:
        g = groups.setdefault(f['id'], {'totals': [], 'parts': {}})
        if f.get('total') is not None:
            g['totals'].append(f['total'])
        g['parts'].setdefault(f['number'], f['body'])
    out = []
    for pid in sorted(groups):
        g = groups[pid]
        if len(g['totals']) > 1 and g['totals'][0] != g['totals'][-1]:
            out.append([pid, 'conflict', None])
            continue
        if not g['totals']:
            out.append([pid, 'incomplete', None])
            continue
        total = g['totals'][0]
        if all(n in g['parts'] for n in range(1, total + 1)):
            out.append([pid, 'complete', ''.join(g['parts'].get(n, '') for n in range(1, total + 1))])
        else:
            out.append([pid, 'incomplete', None])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_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']])]}
for _label, _args, _expected in _CASES[N]:
    check(_label, solve(*_args), _expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
retransmitted fragment[['p', 'complete', 'ABCD1']][['p', 'complete', 'ABCD1']]Passed
no total yet[['q', 'incomplete', None]][['q', 'incomplete', None]]Passed
repeated equal totals[['r', 'complete', '1123']][['r', 'complete', '1123']]Passed
disagreeing totals[['s', 'complete', 'xyz1']][['s', 'conflict', None]]Failed
out of order with stray number[['t', 'complete', 'one1two']][['t', 'complete', 'one1two']]Passed
missing middle with stray[['u', 'incomplete', None]][['u', 'incomplete', None]]Passed
two messages[['v', 'incomplete', None], ['w1', 'complete', 'solo']][['v', 'incomplete', None], ['w1', 'complete', 'solo']]Passed

SHA-256 / eb8aa79dc995b608c3c41483ec18b09eff2808af0b828b9524bd2dcee7784f0f

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(fragments):
    groups = {}
    for f in fragments:
        g = groups.setdefault(f['id'], {'totals': [], 'parts': {}})
        if f.get('total') is not None:
            g['totals'].append(f['total'])
        g['parts'].setdefault(f['number'], f['body'])
    out = []
    for pid in sorted(groups):
        g = groups[pid]
        if len(set(g['totals'])) > 1:
            out.append([pid, 'conflict', None])
            continue
        if not g['totals']:
            out.append([pid, 'incomplete', None])
            continue
        total = g['totals'][0]
        if all(n in g['parts'] for n in range(1, total + 1)):
            out.append([pid, 'complete', ''.join(g['parts'].get(n, '') for n in range(1, total + 1))])
        else:
            out.append([pid, 'incomplete', None])
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_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']])]}
for _label, _args, _expected in _CASES[N]:
    check(_label, solve(*_args), _expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
retransmitted fragment[['p', 'complete', 'ABCD1']][['p', 'complete', 'ABCD1']]Passed
no total yet[['q', 'incomplete', None]][['q', 'incomplete', None]]Passed
repeated equal totals[['r', 'complete', '1123']][['r', 'complete', '1123']]Passed
disagreeing totals[['s', 'conflict', None]][['s', 'conflict', None]]Passed
out of order with stray number[['t', 'complete', 'one1two']][['t', 'complete', 'one1two']]Passed
missing middle with stray[['u', 'incomplete', None]][['u', 'incomplete', None]]Passed
two messages[['v', 'incomplete', None], ['w1', 'complete', 'solo']][['v', 'incomplete', None], ['w1', 'complete', 'solo']]Passed

SHA-256 / 7ea7a0afdb84a1976ced4efc4f145ddcb3910927e9390038d35d5315978eaa37

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:49:19.054392+00:00.

Case digest / dfe24109f10ae94f531c7700f1392f1cd442fd6a29ea5b76c7012c0902724f74