{"abstract":"An HTML-only last alternative produces an empty display although a text alternative exists.","category":"Email MIME structure","checks":6,"contract":"Returns the text/plain strings to display in order. Types compare case-insensitively. multipart/alternative yields the result of its last child that yields any text; other multiparts concatenate their children. Entities with an attachment disposition yield nothing. A message/rfc822 without attachment disposition yields its body; text/plain yields its text; everything else yields nothing.","evaluation_group":"w2-email_mime_structure-display-text","failed_approach":"An empty list is not None, so the empty HTML result is still accepted. The attempted `if got is not None:` still disagrees with a fixture.","family":"w2-email_mime_structure-display-text-alternative-empty-skip","id":"FA-76641","implementations":{"attempt":{"sha256":"c92a2d045aafe5ccaf76ea8daec4bf965cafc80e9d6d083ec99750b9d7c00dff","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tree):\n    def walk(n):\n        t = n['type'].lower()\n        disp = (n.get('disp') or 'inline').lower()\n        if t == 'multipart/alternative':\n            for child in reversed(n['parts']):\n                got = walk(child)\n                if got is not None:\n                    return got\n            return []\n        if t.startswith('multipart/'):\n            out = []\n            for child in n['parts']:\n                out.extend(walk(child))\n            return out\n        if disp == 'attachment':\n            return []\n        if t == 'message/rfc822':\n            return walk(n['body'])\n        if t == 'text/plain':\n            return [n['text']]\n        return []\n    return walk(tree)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A1'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B1'}, {'type': 'image/png'}]}]},), ['B1']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 1'}, {'type': 'text/html'}]},), ['plain 1']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 1'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw1'}, {'type': 'text/html'}]}}]},), ['x', 'fw1']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't1'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t1', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 2: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A2'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B2'}, {'type': 'image/png'}]}]},), ['B2']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 2'}, {'type': 'text/html'}]},), ['plain 2']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 2'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw2'}, {'type': 'text/html'}]}}]},), ['x', 'fw2']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't2'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t2', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 3: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A3'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B3'}, {'type': 'image/png'}]}]},), ['B3']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 3'}, {'type': 'text/html'}]},), ['plain 3']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 3'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw3'}, {'type': 'text/html'}]}}]},), ['x', 'fw3']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't3'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t3', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 4: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A4'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B4'}, {'type': 'image/png'}]}]},), ['B4']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 4'}, {'type': 'text/html'}]},), ['plain 4']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 4'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw4'}, {'type': 'text/html'}]}}]},), ['x', 'fw4']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't4'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t4', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 5: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A5'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B5'}, {'type': 'image/png'}]}]},), ['B5']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 5'}, {'type': 'text/html'}]},), ['plain 5']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 5'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw5'}, {'type': 'text/html'}]}}]},), ['x', 'fw5']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't5'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t5', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])]}\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":"5bb0c4fac26004cb6133b39d7e437021d5cb4e60bb8f1c0e0b0d97ee970d255d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tree):\n    def walk(n):\n        t = n['type'].lower()\n        disp = (n.get('disp') or 'inline').lower()\n        if t == 'multipart/alternative':\n            for child in reversed(n['parts']):\n                got = walk(child)\n                if True:\n                    return got\n            return []\n        if t.startswith('multipart/'):\n            out = []\n            for child in n['parts']:\n                out.extend(walk(child))\n            return out\n        if disp == 'attachment':\n            return []\n        if t == 'message/rfc822':\n            return walk(n['body'])\n        if t == 'text/plain':\n            return [n['text']]\n        return []\n    return walk(tree)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A1'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B1'}, {'type': 'image/png'}]}]},), ['B1']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 1'}, {'type': 'text/html'}]},), ['plain 1']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 1'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw1'}, {'type': 'text/html'}]}}]},), ['x', 'fw1']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't1'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t1', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 2: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A2'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B2'}, {'type': 'image/png'}]}]},), ['B2']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 2'}, {'type': 'text/html'}]},), ['plain 2']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 2'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw2'}, {'type': 'text/html'}]}}]},), ['x', 'fw2']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't2'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t2', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 3: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A3'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B3'}, {'type': 'image/png'}]}]},), ['B3']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 3'}, {'type': 'text/html'}]},), ['plain 3']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 3'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw3'}, {'type': 'text/html'}]}}]},), ['x', 'fw3']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't3'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t3', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 4: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A4'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B4'}, {'type': 'image/png'}]}]},), ['B4']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 4'}, {'type': 'text/html'}]},), ['plain 4']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 4'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw4'}, {'type': 'text/html'}]}}]},), ['x', 'fw4']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't4'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t4', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 5: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A5'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B5'}, {'type': 'image/png'}]}]},), ['B5']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 5'}, {'type': 'text/html'}]},), ['plain 5']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 5'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw5'}, {'type': 'text/html'}]}}]},), ['x', 'fw5']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't5'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t5', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])]}\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":"f1be4396ec22927d1b8a710afb41affde67f9ec6d7239ad0d04e2efbb6c09514","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tree):\n    def walk(n):\n        t = n['type'].lower()\n        disp = (n.get('disp') or 'inline').lower()\n        if t == 'multipart/alternative':\n            for child in reversed(n['parts']):\n                got = walk(child)\n                if got:\n                    return got\n            return []\n        if t.startswith('multipart/'):\n            out = []\n            for child in n['parts']:\n                out.extend(walk(child))\n            return out\n        if disp == 'attachment':\n            return []\n        if t == 'message/rfc822':\n            return walk(n['body'])\n        if t == 'text/plain':\n            return [n['text']]\n        return []\n    return walk(tree)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A1'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B1'}, {'type': 'image/png'}]}]},), ['B1']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 1'}, {'type': 'text/html'}]},), ['plain 1']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 1'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw1'}, {'type': 'text/html'}]}}]},), ['x', 'fw1']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't1'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t1', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 2: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A2'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B2'}, {'type': 'image/png'}]}]},), ['B2']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 2'}, {'type': 'text/html'}]},), ['plain 2']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 2'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw2'}, {'type': 'text/html'}]}}]},), ['x', 'fw2']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't2'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t2', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 3: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A3'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B3'}, {'type': 'image/png'}]}]},), ['B3']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 3'}, {'type': 'text/html'}]},), ['plain 3']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 3'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw3'}, {'type': 'text/html'}]}}]},), ['x', 'fw3']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't3'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t3', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 4: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A4'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B4'}, {'type': 'image/png'}]}]},), ['B4']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 4'}, {'type': 'text/html'}]},), ['plain 4']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 4'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw4'}, {'type': 'text/html'}]}}]},), ['x', 'fw4']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't4'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t4', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])], 5: [('richer alternative holds text', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'A5'}, {'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'B5'}, {'type': 'image/png'}]}]},), ['B5']), ('html last alternative', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'plain 5'}, {'type': 'text/html'}]},), ['plain 5']), ('attached message and log', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'hi'}, {'type': 'message/rfc822', 'disp': 'attachment', 'body': {'type': 'text/plain', 'text': 'inner'}}, {'type': 'text/plain', 'disp': 'attachment', 'text': 'log 5'}]},), ['hi']), ('inline forwarded alternative', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain', 'text': 'x'}, {'type': 'message/rfc822', 'body': {'type': 'multipart/alternative', 'parts': [{'type': 'text/plain', 'text': 'fw5'}, {'type': 'text/html'}]}}]},), ['x', 'fw5']), ('mixed-case types', ({'type': 'MULTIPART/Mixed', 'parts': [{'type': 'Text/Plain', 'text': 't5'}, {'type': 'TEXT/PLAIN', 'text': 'u'}]},), ['t5', 'u']), ('no text at all', ({'type': 'multipart/mixed', 'parts': [{'type': 'image/png'}, {'type': 'application/pdf'}]},), [])]}\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-display-text-alternative-empty-skip","generated_at":"2026-09-29T14:49:18.055892+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Text extraction powers previews, replies and search; wrong choices quote attachments or skip the real body.","repair":"Use `if got:` for the alternative empty skip decision and keep every other rule of the model unchanged.","root_cause":"The alternative empty skip decision evaluates `if True:` where the contract requires `if got:`.","sha256":"80860f72560134d4e31e7b63e0b472bb8a9ac34ee8bd100790c1b56dbd53dd24","title":"Collect the plain-text body to display: alternative empty skip · 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":39.374,"exit_code":1,"observations":[{"actual":["B1"],"check":"richer alternative holds text","expected":["B1"],"passed":true},{"actual":[],"check":"html last alternative","expected":["plain 1"],"passed":false},{"actual":["hi"],"check":"attached message and log","expected":["hi"],"passed":true},{"actual":["x"],"check":"inline forwarded alternative","expected":["x","fw1"],"passed":false},{"actual":["t1","u"],"check":"mixed-case types","expected":["t1","u"],"passed":true},{"actual":[],"check":"no text at all","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"richer alternative holds text\", \"actual\": [\"B1\"], \"expected\": [\"B1\"], \"passed\": true}, {\"check\": \"html last alternative\", \"actual\": [], \"expected\": [\"plain 1\"], \"passed\": false}, {\"check\": \"attached message and log\", \"actual\": [\"hi\"], \"expected\": [\"hi\"], \"passed\": true}, {\"check\": \"inline forwarded alternative\", \"actual\": [\"x\"], \"expected\": [\"x\", \"fw1\"], \"passed\": false}, {\"check\": \"mixed-case types\", \"actual\": [\"t1\", \"u\"], \"expected\": [\"t1\", \"u\"], \"passed\": true}, {\"check\": \"no text at all\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.492,"exit_code":1,"observations":[{"actual":["B1"],"check":"richer alternative holds text","expected":["B1"],"passed":true},{"actual":[],"check":"html last alternative","expected":["plain 1"],"passed":false},{"actual":["hi"],"check":"attached message and log","expected":["hi"],"passed":true},{"actual":["x"],"check":"inline forwarded alternative","expected":["x","fw1"],"passed":false},{"actual":["t1","u"],"check":"mixed-case types","expected":["t1","u"],"passed":true},{"actual":[],"check":"no text at all","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"richer alternative holds text\", \"actual\": [\"B1\"], \"expected\": [\"B1\"], \"passed\": true}, {\"check\": \"html last alternative\", \"actual\": [], \"expected\": [\"plain 1\"], \"passed\": false}, {\"check\": \"attached message and log\", \"actual\": [\"hi\"], \"expected\": [\"hi\"], \"passed\": true}, {\"check\": \"inline forwarded alternative\", \"actual\": [\"x\"], \"expected\": [\"x\", \"fw1\"], \"passed\": false}, {\"check\": \"mixed-case types\", \"actual\": [\"t1\", \"u\"], \"expected\": [\"t1\", \"u\"], \"passed\": true}, {\"check\": \"no text at all\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":38.78,"exit_code":0,"observations":[{"actual":["B1"],"check":"richer alternative holds text","expected":["B1"],"passed":true},{"actual":["plain 1"],"check":"html last alternative","expected":["plain 1"],"passed":true},{"actual":["hi"],"check":"attached message and log","expected":["hi"],"passed":true},{"actual":["x","fw1"],"check":"inline forwarded alternative","expected":["x","fw1"],"passed":true},{"actual":["t1","u"],"check":"mixed-case types","expected":["t1","u"],"passed":true},{"actual":[],"check":"no text at all","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"richer alternative holds text\", \"actual\": [\"B1\"], \"expected\": [\"B1\"], \"passed\": true}, {\"check\": \"html last alternative\", \"actual\": [\"plain 1\"], \"expected\": [\"plain 1\"], \"passed\": true}, {\"check\": \"attached message and log\", \"actual\": [\"hi\"], \"expected\": [\"hi\"], \"passed\": true}, {\"check\": \"inline forwarded alternative\", \"actual\": [\"x\", \"fw1\"], \"expected\": [\"x\", \"fw1\"], \"passed\": true}, {\"check\": \"mixed-case types\", \"actual\": [\"t1\", \"u\"], \"expected\": [\"t1\", \"u\"], \"passed\": true}, {\"check\": \"no text at all\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}