broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(tree):
    known = ('7bit', '8bit', 'binary', 'quoted-printable', 'base64')
    out = []
    def walk(node, path, ceiling):
        cte = (node.get('cte') or '7bit').strip().lower()
        where = '.'.join(path)
        if cte not in known:
            out.append([where, 'unknown-encoding'])
            return
        composite = node['type'].startswith('multipart/') or node['type'] == 'message/rfc822'
        if composite and cte not in ('7bit', '8bit', 'binary'):
            out.append([where, 'composite-encoding'])
        if ceiling == '7bit' and cte in ('8bit', 'binary'):
            out.append([where, 'nested-8bit'])
        if composite:
            nxt = '7bit' if ceiling == '7bit' or cte == '7bit' else ceiling
            for i, c in enumerate(node.get('parts', []), 1):
                walk(c, path + [str(i)], nxt)
            return
        body = node.get('body', '')
        if cte == '7bit' and any(ord(ch) > 127 for ch in body):
            out.append([where, '8bit-in-7bit'])
        if cte not in ('binary', '8bit') and any(len(line) > 998 for line in body.split('\n')):
            out.append([where, 'long-line'])
    walk(tree, [], None)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('default composite with 8bit child', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'café 1'}]},), [['1', 'nested-8bit']]), ('padded mixed-case encoding', ({'type': 'text/plain', 'cte': ' Base64 ', 'body': 'aGVsbG8='},), []), ('encoded message part and status leaf', ({'type': 'multipart/mixed', 'parts': [{'type': 'message/rfc822', 'cte': 'base64', 'parts': [{'type': 'text/plain', 'body': 'x'}]}, {'type': 'message/delivery-status', 'cte': 'quoted-printable', 'body': 'Action: failed'}]},), [['1', 'composite-encoding']]), ('7bit root above 8bit container', ({'type': 'multipart/mixed', 'cte': '7bit', 'parts': [{'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ü'}]}]},), [['1', 'nested-8bit'], ['1.1', 'nested-8bit']]), ('8bit root above default container', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ok'}]}]},), [['1.1', 'nested-8bit']]), ('high characters in 7bit leaves', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'body': 'café'}, {'type': 'text/plain', 'body': 'a\x80b'}]},), [['1', '8bit-in-7bit'], ['2', '8bit-in-7bit']]), ('line length limits', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'body': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'}]},), [['2', 'long-line'], ['3', 'long-line']])], 2: [('default composite with 8bit child', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'café 2'}]},), [['1', 'nested-8bit']]), ('padded mixed-case encoding', ({'type': 'text/plain', 'cte': ' Base64 ', 'body': 'aGVsbG8=aGVsbG8='},), []), ('encoded message part and status leaf', ({'type': 'multipart/mixed', 'parts': [{'type': 'message/rfc822', 'cte': 'base64', 'parts': [{'type': 'text/plain', 'body': 'x'}]}, {'type': 'message/delivery-status', 'cte': 'quoted-printable', 'body': 'Action: failed'}]},), [['1', 'composite-encoding']]), ('7bit root above 8bit container', ({'type': 'multipart/mixed', 'cte': '7bit', 'parts': [{'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'üü'}]}]},), [['1', 'nested-8bit'], ['1.1', 'nested-8bit']]), ('8bit root above default container', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ok'}]}]},), [['1.1', 'nested-8bit']]), ('high characters in 7bit leaves', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'body': 'café'}, {'type': 'text/plain', 'body': 'a\x80ba\x80b'}]},), [['1', '8bit-in-7bit'], ['2', '8bit-in-7bit']]), ('line length limits', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'body': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'}]},), [['2', 'long-line'], ['3', 'long-line']])], 3: [('default composite with 8bit child', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'café 3'}]},), [['1', 'nested-8bit']]), ('padded mixed-case encoding', ({'type': 'text/plain', 'cte': ' Base64 ', 'body': 'aGVsbG8=aGVsbG8=aGVsbG8='},), []), ('encoded message part and status leaf', ({'type': 'multipart/mixed', 'parts': [{'type': 'message/rfc822', 'cte': 'base64', 'parts': [{'type': 'text/plain', 'body': 'x'}]}, {'type': 'message/delivery-status', 'cte': 'quoted-printable', 'body': 'Action: failed'}]},), [['1', 'composite-encoding']]), ('7bit root above 8bit container', ({'type': 'multipart/mixed', 'cte': '7bit', 'parts': [{'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'üüü'}]}]},), [['1', 'nested-8bit'], ['1.1', 'nested-8bit']]), ('8bit root above default container', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ok'}]}]},), [['1.1', 'nested-8bit']]), ('high characters in 7bit leaves', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'body': 'café'}, {'type': 'text/plain', 'body': 'a\x80ba\x80ba\x80b'}]},), [['1', '8bit-in-7bit'], ['2', '8bit-in-7bit']]), ('line length limits', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'body': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'}]},), [['2', 'long-line'], ['3', 'long-line']])], 4: [('default composite with 8bit child', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'café 4'}]},), [['1', 'nested-8bit']]), ('padded mixed-case encoding', ({'type': 'text/plain', 'cte': ' Base64 ', 'body': 'aGVsbG8=aGVsbG8=aGVsbG8=aGVsbG8='},), []), ('encoded message part and status leaf', ({'type': 'multipart/mixed', 'parts': [{'type': 'message/rfc822', 'cte': 'base64', 'parts': [{'type': 'text/plain', 'body': 'x'}]}, {'type': 'message/delivery-status', 'cte': 'quoted-printable', 'body': 'Action: failed'}]},), [['1', 'composite-encoding']]), ('7bit root above 8bit container', ({'type': 'multipart/mixed', 'cte': '7bit', 'parts': [{'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'üüüü'}]}]},), [['1', 'nested-8bit'], ['1.1', 'nested-8bit']]), ('8bit root above default container', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ok'}]}]},), [['1.1', 'nested-8bit']]), ('high characters in 7bit leaves', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'body': 'café'}, {'type': 'text/plain', 'body': 'a\x80ba\x80ba\x80ba\x80b'}]},), [['1', '8bit-in-7bit'], ['2', '8bit-in-7bit']]), ('line length limits', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'body': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'}]},), [['2', 'long-line'], ['3', 'long-line']])], 5: [('default composite with 8bit child', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'café 5'}]},), [['1', 'nested-8bit']]), ('padded mixed-case encoding', ({'type': 'text/plain', 'cte': ' Base64 ', 'body': 'aGVsbG8=aGVsbG8=aGVsbG8=aGVsbG8=aGVsbG8='},), []), ('encoded message part and status leaf', ({'type': 'multipart/mixed', 'parts': [{'type': 'message/rfc822', 'cte': 'base64', 'parts': [{'type': 'text/plain', 'body': 'x'}]}, {'type': 'message/delivery-status', 'cte': 'quoted-printable', 'body': 'Action: failed'}]},), [['1', 'composite-encoding']]), ('7bit root above 8bit container', ({'type': 'multipart/mixed', 'cte': '7bit', 'parts': [{'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'üüüüü'}]}]},), [['1', 'nested-8bit'], ['1.1', 'nested-8bit']]), ('8bit root above default container', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ok'}]}]},), [['1.1', 'nested-8bit']]), ('high characters in 7bit leaves', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'body': 'café'}, {'type': 'text/plain', 'body': 'a\x80ba\x80ba\x80ba\x80ba\x80b'}]},), [['1', '8bit-in-7bit'], ['2', '8bit-in-7bit']]), ('line length limits', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'body': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'}]},), [['2', 'long-line'], ['3', 'long-line']])]}
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)

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(tree):
    known = ('7bit', '8bit', 'binary', 'quoted-printable', 'base64')
    out = []
    def walk(node, path, ceiling):
        cte = (node.get('cte') or '7bit').strip().lower()
        where = '.'.join(path)
        if cte not in known:
            out.append([where, 'unknown-encoding'])
            return
        composite = node['type'].startswith('multipart/') or node['type'] == 'message/rfc822'
        if composite and cte not in ('7bit', '8bit', 'binary'):
            out.append([where, 'composite-encoding'])
        if ceiling == '7bit' and cte in ('8bit', 'binary'):
            out.append([where, 'nested-8bit'])
        if composite:
            nxt = '7bit' if ceiling == '7bit' or cte == '7bit' else ceiling
            for i, c in enumerate(node.get('parts', []), 1):
                walk(c, path + [str(i)], nxt)
            return
        body = node.get('body', '')
        if cte == '7bit' and any(ord(ch) > 127 for ch in body):
            out.append([where, '8bit-in-7bit'])
        if cte in ('7bit', 'quoted-printable') and any(len(line) > 998 for line in body.split('\n')):
            out.append([where, 'long-line'])
    walk(tree, [], None)
    return out
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('default composite with 8bit child', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'café 1'}]},), [['1', 'nested-8bit']]), ('padded mixed-case encoding', ({'type': 'text/plain', 'cte': ' Base64 ', 'body': 'aGVsbG8='},), []), ('encoded message part and status leaf', ({'type': 'multipart/mixed', 'parts': [{'type': 'message/rfc822', 'cte': 'base64', 'parts': [{'type': 'text/plain', 'body': 'x'}]}, {'type': 'message/delivery-status', 'cte': 'quoted-printable', 'body': 'Action: failed'}]},), [['1', 'composite-encoding']]), ('7bit root above 8bit container', ({'type': 'multipart/mixed', 'cte': '7bit', 'parts': [{'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ü'}]}]},), [['1', 'nested-8bit'], ['1.1', 'nested-8bit']]), ('8bit root above default container', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ok'}]}]},), [['1.1', 'nested-8bit']]), ('high characters in 7bit leaves', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'body': 'café'}, {'type': 'text/plain', 'body': 'a\x80b'}]},), [['1', '8bit-in-7bit'], ['2', '8bit-in-7bit']]), ('line length limits', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'body': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'}]},), [['2', 'long-line'], ['3', 'long-line']])], 2: [('default composite with 8bit child', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'café 2'}]},), [['1', 'nested-8bit']]), ('padded mixed-case encoding', ({'type': 'text/plain', 'cte': ' Base64 ', 'body': 'aGVsbG8=aGVsbG8='},), []), ('encoded message part and status leaf', ({'type': 'multipart/mixed', 'parts': [{'type': 'message/rfc822', 'cte': 'base64', 'parts': [{'type': 'text/plain', 'body': 'x'}]}, {'type': 'message/delivery-status', 'cte': 'quoted-printable', 'body': 'Action: failed'}]},), [['1', 'composite-encoding']]), ('7bit root above 8bit container', ({'type': 'multipart/mixed', 'cte': '7bit', 'parts': [{'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'üü'}]}]},), [['1', 'nested-8bit'], ['1.1', 'nested-8bit']]), ('8bit root above default container', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ok'}]}]},), [['1.1', 'nested-8bit']]), ('high characters in 7bit leaves', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'body': 'café'}, {'type': 'text/plain', 'body': 'a\x80ba\x80b'}]},), [['1', '8bit-in-7bit'], ['2', '8bit-in-7bit']]), ('line length limits', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'body': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'}]},), [['2', 'long-line'], ['3', 'long-line']])], 3: [('default composite with 8bit child', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'café 3'}]},), [['1', 'nested-8bit']]), ('padded mixed-case encoding', ({'type': 'text/plain', 'cte': ' Base64 ', 'body': 'aGVsbG8=aGVsbG8=aGVsbG8='},), []), ('encoded message part and status leaf', ({'type': 'multipart/mixed', 'parts': [{'type': 'message/rfc822', 'cte': 'base64', 'parts': [{'type': 'text/plain', 'body': 'x'}]}, {'type': 'message/delivery-status', 'cte': 'quoted-printable', 'body': 'Action: failed'}]},), [['1', 'composite-encoding']]), ('7bit root above 8bit container', ({'type': 'multipart/mixed', 'cte': '7bit', 'parts': [{'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'üüü'}]}]},), [['1', 'nested-8bit'], ['1.1', 'nested-8bit']]), ('8bit root above default container', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ok'}]}]},), [['1.1', 'nested-8bit']]), ('high characters in 7bit leaves', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'body': 'café'}, {'type': 'text/plain', 'body': 'a\x80ba\x80ba\x80b'}]},), [['1', '8bit-in-7bit'], ['2', '8bit-in-7bit']]), ('line length limits', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'body': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'}]},), [['2', 'long-line'], ['3', 'long-line']])], 4: [('default composite with 8bit child', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'café 4'}]},), [['1', 'nested-8bit']]), ('padded mixed-case encoding', ({'type': 'text/plain', 'cte': ' Base64 ', 'body': 'aGVsbG8=aGVsbG8=aGVsbG8=aGVsbG8='},), []), ('encoded message part and status leaf', ({'type': 'multipart/mixed', 'parts': [{'type': 'message/rfc822', 'cte': 'base64', 'parts': [{'type': 'text/plain', 'body': 'x'}]}, {'type': 'message/delivery-status', 'cte': 'quoted-printable', 'body': 'Action: failed'}]},), [['1', 'composite-encoding']]), ('7bit root above 8bit container', ({'type': 'multipart/mixed', 'cte': '7bit', 'parts': [{'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'üüüü'}]}]},), [['1', 'nested-8bit'], ['1.1', 'nested-8bit']]), ('8bit root above default container', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ok'}]}]},), [['1.1', 'nested-8bit']]), ('high characters in 7bit leaves', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'body': 'café'}, {'type': 'text/plain', 'body': 'a\x80ba\x80ba\x80ba\x80b'}]},), [['1', '8bit-in-7bit'], ['2', '8bit-in-7bit']]), ('line length limits', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'body': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'}]},), [['2', 'long-line'], ['3', 'long-line']])], 5: [('default composite with 8bit child', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'café 5'}]},), [['1', 'nested-8bit']]), ('padded mixed-case encoding', ({'type': 'text/plain', 'cte': ' Base64 ', 'body': 'aGVsbG8=aGVsbG8=aGVsbG8=aGVsbG8=aGVsbG8='},), []), ('encoded message part and status leaf', ({'type': 'multipart/mixed', 'parts': [{'type': 'message/rfc822', 'cte': 'base64', 'parts': [{'type': 'text/plain', 'body': 'x'}]}, {'type': 'message/delivery-status', 'cte': 'quoted-printable', 'body': 'Action: failed'}]},), [['1', 'composite-encoding']]), ('7bit root above 8bit container', ({'type': 'multipart/mixed', 'cte': '7bit', 'parts': [{'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'üüüüü'}]}]},), [['1', 'nested-8bit'], ['1.1', 'nested-8bit']]), ('8bit root above default container', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'cte': '8bit', 'body': 'ok'}]}]},), [['1.1', 'nested-8bit']]), ('high characters in 7bit leaves', ({'type': 'multipart/mixed', 'cte': '8bit', 'parts': [{'type': 'text/plain', 'body': 'café'}, {'type': 'text/plain', 'body': 'a\x80ba\x80ba\x80ba\x80ba\x80b'}]},), [['1', '8bit-in-7bit'], ['2', '8bit-in-7bit']]), ('line length limits', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'body': 'aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa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zzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzzz'}]},), [['2', 'long-line'], ['3', 'long-line']])]}
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)

prompt:
Over-long lines in 8bit parts are accepted as if the part were binary.

Nodes have type, optional cte (default 7bit, case-insensitive, surrounding spaces ignored) and parts or body. Findings [path, reason] use dotted child positions ("" for the root): unknown-encoding (not 7bit/8bit/binary/quoted-printable/base64; the subtree is not inspected), composite-encoding (multipart/* or message/rfc822 using anything but 7bit, 8bit or binary), nested-8bit (an 8bit or binary entity below an ancestor composite that is 7bit), 8bit-in-7bit (a 7bit leaf body containing a character above 127) and long-line (a non-binary leaf with a line over 998 characters).

split: open-access


broken_source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events, max_depth):
    stack = []
    skip = 0
    leaves = 0
    depth = 0
    errors = []
    for ev in events:
        kind = ev[0]
        if skip:
            if kind == 'open':
                skip += 1
            elif kind == 'close':
                skip -= 1
            continue
        if kind == 'open':
            if stack:
                stack[-1] += 1
            if len(stack) > max_depth:
                errors.append('too-deep')
                skip = 1
                continue
            stack.append(0)
            depth = max(depth, len(stack))
        elif kind == 'leaf':
            leaves += 1
            if stack:
                stack[-1] += 1
        elif not stack:
            errors.append('stray-close')
        elif stack.pop() == 0:
            errors.append('empty-multipart')
    if stack:
        errors.append('unclosed')
    return {'leaves': leaves, 'depth': depth, 'errors': errors}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('three levels with limit two', ([['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close'], ['leaf', 'image/png', 0], ['close']], 2), {'depth': 2, 'errors': ['too-deep'], 'leaves': 1}), ('deep skipped subtree', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['leaf', 'text/plain', 2], ['close'], ['leaf', 'text/plain', 4], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 1}), ('skipped child keeps parent non-empty', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 0}), ('unterminated root', ([['open', 'multipart/mixed'], ['leaf', 'text/plain', 0]], 3), {'depth': 1, 'errors': ['unclosed'], 'leaves': 1}), ('deepest branch first', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['open', 'multipart/related'], ['leaf', 'text/html', 1], ['close'], ['close']], 5), {'depth': 3, 'errors': [], 'leaves': 2}), ('stray close', ([['leaf', 'text/plain', 1], ['close']], 2), {'depth': 0, 'errors': ['stray-close'], 'leaves': 1}), ('empty multipart', ([['open', 'multipart/mixed'], ['close']], 2), {'depth': 1, 'errors': ['empty-multipart'], 'leaves': 0})], 2: [('three levels with limit two', ([['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close'], ['leaf', 'image/png', 0], ['leaf', 'image/png', 1], ['close']], 2), {'depth': 2, 'errors': ['too-deep'], 'leaves': 2}), ('deep skipped subtree', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['leaf', 'text/plain', 2], ['close'], ['leaf', 'text/plain', 5], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 1}), ('skipped child keeps parent non-empty', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 2], ['close'], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 0}), ('unterminated root', ([['open', 'multipart/mixed'], ['leaf', 'text/plain', 0], ['leaf', 'text/plain', 1]], 3), {'depth': 1, 'errors': ['unclosed'], 'leaves': 2}), ('deepest branch first', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['open', 'multipart/related'], ['leaf', 'text/html', 2], ['close'], ['close']], 5), {'depth': 3, 'errors': [], 'leaves': 2}), ('stray close', ([['leaf', 'text/plain', 2], ['close']], 2), {'depth': 0, 'errors': ['stray-close'], 'leaves': 1}), ('empty multipart', ([['open', 'multipart/mixed'], ['close']], 2), {'depth': 1, 'errors': ['empty-multipart'], 'leaves': 0})], 3: [('three levels with limit two', ([['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close'], ['leaf', 'image/png', 0], ['leaf', 'image/png', 1], ['leaf', 'image/png', 2], ['close']], 2), {'depth': 2, 'errors': ['too-deep'], 'leaves': 3}), ('deep skipped subtree', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['leaf', 'text/plain', 2], ['close'], ['leaf', 'text/plain', 6], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 1}), ('skipped child keeps parent non-empty', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 3], ['close'], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 0}), ('unterminated root', ([['open', 'multipart/mixed'], ['leaf', 'text/plain', 0], ['leaf', 'text/plain', 1], ['leaf', 'text/plain', 2]], 3), {'depth': 1, 'errors': ['unclosed'], 'leaves': 3}), ('deepest branch first', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['open', 'multipart/related'], ['leaf', 'text/html', 3], ['close'], ['close']], 5), {'depth': 3, 'errors': [], 'leaves': 2}), ('stray close', ([['leaf', 'text/plain', 3], ['close']], 2), {'depth': 0, 'errors': ['stray-close'], 'leaves': 1}), ('empty multipart', ([['open', 'multipart/mixed'], ['close']], 2), {'depth': 1, 'errors': ['empty-multipart'], 'leaves': 0})], 4: [('three levels with limit two', ([['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close'], ['leaf', 'image/png', 0], ['leaf', 'image/png', 1], ['leaf', 'image/png', 2], ['leaf', 'image/png', 3], ['close']], 2), {'depth': 2, 'errors': ['too-deep'], 'leaves': 4}), ('deep skipped subtree', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['leaf', 'text/plain', 2], ['close'], ['leaf', 'text/plain', 7], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 1}), ('skipped child keeps parent non-empty', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 4], ['close'], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 0}), ('unterminated root', ([['open', 'multipart/mixed'], ['leaf', 'text/plain', 0], ['leaf', 'text/plain', 1], ['leaf', 'text/plain', 2], ['leaf', 'text/plain', 3]], 3), {'depth': 1, 'errors': ['unclosed'], 'leaves': 4}), ('deepest branch first', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['open', 'multipart/related'], ['leaf', 'text/html', 4], ['close'], ['close']], 5), {'depth': 3, 'errors': [], 'leaves': 2}), ('stray close', ([['leaf', 'text/plain', 4], ['close']], 2), {'depth': 0, 'errors': ['stray-close'], 'leaves': 1}), ('empty multipart', ([['open', 'multipart/mixed'], ['close']], 2), {'depth': 1, 'errors': ['empty-multipart'], 'leaves': 0})], 5: [('three levels with limit two', ([['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close'], ['leaf', 'image/png', 0], ['leaf', 'image/png', 1], ['leaf', 'image/png', 2], ['leaf', 'image/png', 3], ['leaf', 'image/png', 4], ['close']], 2), {'depth': 2, 'errors': ['too-deep'], 'leaves': 5}), ('deep skipped subtree', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['leaf', 'text/plain', 2], ['close'], ['leaf', 'text/plain', 8], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 1}), ('skipped child keeps parent non-empty', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 5], ['close'], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 0}), ('unterminated root', ([['open', 'multipart/mixed'], ['leaf', 'text/plain', 0], ['leaf', 'text/plain', 1], ['leaf', 'text/plain', 2], ['leaf', 'text/plain', 3], ['leaf', 'text/plain', 4]], 3), {'depth': 1, 'errors': ['unclosed'], 'leaves': 5}), ('deepest branch first', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close']], 5), {'depth': 3, 'errors': [], 'leaves': 2}), ('stray close', ([['leaf', 'text/plain', 5], ['close']], 2), {'depth': 0, 'errors': ['stray-close'], 'leaves': 1}), ('empty multipart', ([['open', 'multipart/mixed'], ['close']], 2), {'depth': 1, 'errors': ['empty-multipart'], 'leaves': 0})]}
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)

meaning: Fixture-count band, not measured model difficulty

deps: stdlib

source:
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(events, max_depth):
    stack = []
    skip = 0
    leaves = 0
    depth = 0
    errors = []
    for ev in events:
        kind = ev[0]
        if skip:
            if kind == 'open':
                skip += 1
            elif kind == 'close':
                skip -= 1
            continue
        if kind == 'open':
            if stack:
                stack[-1] += 1
            if len(stack) + 1 >= max_depth:
                errors.append('too-deep')
                skip = 1
                continue
            stack.append(0)
            depth = max(depth, len(stack))
        elif kind == 'leaf':
            leaves += 1
            if stack:
                stack[-1] += 1
        elif not stack:
            errors.append('stray-close')
        elif stack.pop() == 0:
            errors.append('empty-multipart')
    if stack:
        errors.append('unclosed')
    return {'leaves': leaves, 'depth': depth, 'errors': errors}
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
_CASES = {1: [('three levels with limit two', ([['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close'], ['leaf', 'image/png', 0], ['close']], 2), {'depth': 2, 'errors': ['too-deep'], 'leaves': 1}), ('deep skipped subtree', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['leaf', 'text/plain', 2], ['close'], ['leaf', 'text/plain', 4], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 1}), ('skipped child keeps parent non-empty', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 0}), ('unterminated root', ([['open', 'multipart/mixed'], ['leaf', 'text/plain', 0]], 3), {'depth': 1, 'errors': ['unclosed'], 'leaves': 1}), ('deepest branch first', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['open', 'multipart/related'], ['leaf', 'text/html', 1], ['close'], ['close']], 5), {'depth': 3, 'errors': [], 'leaves': 2}), ('stray close', ([['leaf', 'text/plain', 1], ['close']], 2), {'depth': 0, 'errors': ['stray-close'], 'leaves': 1}), ('empty multipart', ([['open', 'multipart/mixed'], ['close']], 2), {'depth': 1, 'errors': ['empty-multipart'], 'leaves': 0})], 2: [('three levels with limit two', ([['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close'], ['leaf', 'image/png', 0], ['leaf', 'image/png', 1], ['close']], 2), {'depth': 2, 'errors': ['too-deep'], 'leaves': 2}), ('deep skipped subtree', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['leaf', 'text/plain', 2], ['close'], ['leaf', 'text/plain', 5], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 1}), ('skipped child keeps parent non-empty', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 2], ['close'], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 0}), ('unterminated root', ([['open', 'multipart/mixed'], ['leaf', 'text/plain', 0], ['leaf', 'text/plain', 1]], 3), {'depth': 1, 'errors': ['unclosed'], 'leaves': 2}), ('deepest branch first', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['open', 'multipart/related'], ['leaf', 'text/html', 2], ['close'], ['close']], 5), {'depth': 3, 'errors': [], 'leaves': 2}), ('stray close', ([['leaf', 'text/plain', 2], ['close']], 2), {'depth': 0, 'errors': ['stray-close'], 'leaves': 1}), ('empty multipart', ([['open', 'multipart/mixed'], ['close']], 2), {'depth': 1, 'errors': ['empty-multipart'], 'leaves': 0})], 3: [('three levels with limit two', ([['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close'], ['leaf', 'image/png', 0], ['leaf', 'image/png', 1], ['leaf', 'image/png', 2], ['close']], 2), {'depth': 2, 'errors': ['too-deep'], 'leaves': 3}), ('deep skipped subtree', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['leaf', 'text/plain', 2], ['close'], ['leaf', 'text/plain', 6], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 1}), ('skipped child keeps parent non-empty', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 3], ['close'], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 0}), ('unterminated root', ([['open', 'multipart/mixed'], ['leaf', 'text/plain', 0], ['leaf', 'text/plain', 1], ['leaf', 'text/plain', 2]], 3), {'depth': 1, 'errors': ['unclosed'], 'leaves': 3}), ('deepest branch first', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['open', 'multipart/related'], ['leaf', 'text/html', 3], ['close'], ['close']], 5), {'depth': 3, 'errors': [], 'leaves': 2}), ('stray close', ([['leaf', 'text/plain', 3], ['close']], 2), {'depth': 0, 'errors': ['stray-close'], 'leaves': 1}), ('empty multipart', ([['open', 'multipart/mixed'], ['close']], 2), {'depth': 1, 'errors': ['empty-multipart'], 'leaves': 0})], 4: [('three levels with limit two', ([['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close'], ['leaf', 'image/png', 0], ['leaf', 'image/png', 1], ['leaf', 'image/png', 2], ['leaf', 'image/png', 3], ['close']], 2), {'depth': 2, 'errors': ['too-deep'], 'leaves': 4}), ('deep skipped subtree', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['leaf', 'text/plain', 2], ['close'], ['leaf', 'text/plain', 7], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 1}), ('skipped child keeps parent non-empty', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 4], ['close'], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 0}), ('unterminated root', ([['open', 'multipart/mixed'], ['leaf', 'text/plain', 0], ['leaf', 'text/plain', 1], ['leaf', 'text/plain', 2], ['leaf', 'text/plain', 3]], 3), {'depth': 1, 'errors': ['unclosed'], 'leaves': 4}), ('deepest branch first', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['open', 'multipart/related'], ['leaf', 'text/html', 4], ['close'], ['close']], 5), {'depth': 3, 'errors': [], 'leaves': 2}), ('stray close', ([['leaf', 'text/plain', 4], ['close']], 2), {'depth': 0, 'errors': ['stray-close'], 'leaves': 1}), ('empty multipart', ([['open', 'multipart/mixed'], ['close']], 2), {'depth': 1, 'errors': ['empty-multipart'], 'leaves': 0})], 5: [('three levels with limit two', ([['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close'], ['leaf', 'image/png', 0], ['leaf', 'image/png', 1], ['leaf', 'image/png', 2], ['leaf', 'image/png', 3], ['leaf', 'image/png', 4], ['close']], 2), {'depth': 2, 'errors': ['too-deep'], 'leaves': 5}), ('deep skipped subtree', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['leaf', 'text/plain', 2], ['close'], ['leaf', 'text/plain', 8], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 1}), ('skipped child keeps parent non-empty', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['leaf', 'text/plain', 5], ['close'], ['close']], 1), {'depth': 1, 'errors': ['too-deep'], 'leaves': 0}), ('unterminated root', ([['open', 'multipart/mixed'], ['leaf', 'text/plain', 0], ['leaf', 'text/plain', 1], ['leaf', 'text/plain', 2], ['leaf', 'text/plain', 3], ['leaf', 'text/plain', 4]], 3), {'depth': 1, 'errors': ['unclosed'], 'leaves': 5}), ('deepest branch first', ([['open', 'multipart/mixed'], ['open', 'multipart/mixed'], ['open', 'multipart/alternative'], ['leaf', 'text/plain', 1], ['close'], ['close'], ['open', 'multipart/related'], ['leaf', 'text/html', 5], ['close'], ['close']], 5), {'depth': 3, 'errors': [], 'leaves': 2}), ('stray close', ([['leaf', 'text/plain', 5], ['close']], 2), {'depth': 0, 'errors': ['stray-close'], 'leaves': 1}), ('empty multipart', ([['open', 'multipart/mixed'], ['close']], 2), {'depth': 1, 'errors': ['empty-multipart'], 'leaves': 0})]}
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)

prompt:
One more nesting level than configured is accepted.

events are ["open", type] (multipart start), ["leaf", type, size] and ["close"]. The root multipart has depth 1. An open that would exceed max_depth records "too-deep" and its whole subtree (including nested opens) is skipped, but it still counts as a child of its parent. A multipart closing with no children records "empty-multipart", a close with nothing open records "stray-close", and containers left open record "unclosed". Result {leaves, depth (maximum reached), errors}.

split: open-access