{"abstract":"An .ics attachment sent as application/octet-stream is not counted.","category":"Email MIME structure","checks":7,"contract":"Walk multiparts but never descend into message/rfc822 parts. A text/calendar part, or any part whose filename ends in \".ics\" (case-insensitive), with an attachment disposition only counts as an attached .ics file. Other text/calendar parts with a method parameter contribute their method (trimmed, upper-cased; parameter names case-insensitive). Result {method: the single distinct method, \"AMBIGUOUS\" for several, None for none; count: contributing parts; attachments_ics}.","evaluation_group":"w2-email_mime_structure-calendar-invitation","failed_approach":"A case-sensitive extension check misses INVITE.ICS. The attempted `(n.get('filename') or '').endswith('.ics')` still disagrees with a fixture.","family":"w2-email_mime_structure-calendar-invitation-ics-extension","id":"FA-76761","implementations":{"attempt":{"sha256":"6d31dbadc279a1e9ec0ff38ffe0431d1d31ebae2b630dda1702bebc82904de1d","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tree):\n    methods = []\n    ics = 0\n    def walk(n):\n        nonlocal ics\n        t = n['type'].lower()\n        if t.startswith('multipart/'):\n            for c in n['parts']:\n                walk(c)\n            return\n        if t == 'message/rfc822':\n            return\n        disp = (n.get('disp') or '').lower()\n        if t == 'text/calendar' or (n.get('filename') or '').endswith('.ics'):\n            if disp == 'attachment':\n                ics += 1\n                return\n            if t == 'text/calendar':\n                params = {k.lower(): v for k, v in n.get('params', {}).items()}\n                if params.get('method'):\n                    methods.append(params['method'].strip().upper())\n    walk(tree)\n    distinct = sorted(set(methods))\n    method = None if not distinct else (distinct[0] if len(distinct) == 1 else 'AMBIGUOUS')\n    return {'method': method, 'count': len(methods), 'attachments_ics': ics}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e1.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE1.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 2: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e2.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE2.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 3: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e3.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE3.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 4: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e4.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE4.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 5: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e5.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE5.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})]}\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":"a8b7fc30edb90db6ef6e7318515500d8142b97c26077a920be0fe62896003e93","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tree):\n    methods = []\n    ics = 0\n    def walk(n):\n        nonlocal ics\n        t = n['type'].lower()\n        if t.startswith('multipart/'):\n            for c in n['parts']:\n                walk(c)\n            return\n        if t == 'message/rfc822':\n            return\n        disp = (n.get('disp') or '').lower()\n        if t == 'text/calendar' or False:\n            if disp == 'attachment':\n                ics += 1\n                return\n            if t == 'text/calendar':\n                params = {k.lower(): v for k, v in n.get('params', {}).items()}\n                if params.get('method'):\n                    methods.append(params['method'].strip().upper())\n    walk(tree)\n    distinct = sorted(set(methods))\n    method = None if not distinct else (distinct[0] if len(distinct) == 1 else 'AMBIGUOUS')\n    return {'method': method, 'count': len(methods), 'attachments_ics': ics}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e1.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE1.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 2: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e2.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE2.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 3: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e3.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE3.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 4: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e4.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE4.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 5: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e5.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE5.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})]}\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":"b31861e0bcfa7907c0e037efe7e5e9749128a941a1a4584eeeac37fa5046b83a","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(tree):\n    methods = []\n    ics = 0\n    def walk(n):\n        nonlocal ics\n        t = n['type'].lower()\n        if t.startswith('multipart/'):\n            for c in n['parts']:\n                walk(c)\n            return\n        if t == 'message/rfc822':\n            return\n        disp = (n.get('disp') or '').lower()\n        if t == 'text/calendar' or (n.get('filename') or '').lower().endswith('.ics'):\n            if disp == 'attachment':\n                ics += 1\n                return\n            if t == 'text/calendar':\n                params = {k.lower(): v for k, v in n.get('params', {}).items()}\n                if params.get('method'):\n                    methods.append(params['method'].strip().upper())\n    walk(tree)\n    distinct = sorted(set(methods))\n    method = None if not distinct else (distinct[0] if len(distinct) == 1 else 'AMBIGUOUS')\n    return {'method': method, 'count': len(methods), 'attachments_ics': ics}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\n_CASES = {1: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e1.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE1.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 2: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e2.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE2.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 3: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e3.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE3.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 4: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e4.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE4.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})], 5: [('forwarded invitation', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'message/rfc822', 'body': {'type': 'text/calendar', 'params': {'method': 'REQUEST'}}}]},), {'attachments_ics': 0, 'count': 0, 'method': None}), ('attached calendar with method', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'PUBLISH'}, 'disp': 'attachment', 'filename': 'e5.ics'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('padded lower-case method', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'Method': ' request '}}]},), {'attachments_ics': 0, 'count': 1, 'method': 'REQUEST'}), ('conflicting methods', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/calendar', 'params': {'method': 'REQUEST'}}, {'type': 'text/calendar', 'params': {'method': 'CANCEL'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'AMBIGUOUS'}), ('same method twice', ({'type': 'multipart/alternative', 'parts': [{'type': 'text/plain'}, {'type': 'text/calendar', 'params': {'method': 'REPLY'}}, {'type': 'text/calendar', 'params': {'method': 'reply'}}]},), {'attachments_ics': 0, 'count': 2, 'method': 'REPLY'}), ('upper-case ics attachment', ({'type': 'multipart/mixed', 'parts': [{'type': 'text/plain'}, {'type': 'application/octet-stream', 'filename': 'INVITE5.ICS', 'disp': 'attachment'}]},), {'attachments_ics': 1, 'count': 0, 'method': None}), ('plain message', ({'type': 'text/plain'},), {'attachments_ics': 0, 'count': 0, 'method': None})]}\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-calendar-invitation-ics-extension","generated_at":"2026-09-29T14:49:19.308324+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Clients show accept/decline controls only for real invitations addressed to the reader.","repair":"Use `(n.get('filename') or '').lower().endswith('.ics')` for the ics extension decision and keep every other rule of the model unchanged.","root_cause":"The ics extension decision evaluates `False` where the contract requires `(n.get('filename') or '').lower().endswith('.ics')`.","sha256":"4665e2ab0be2aa036e5bc7eeed5980d9dde1f1f660a73a1343930a5c39a7f496","title":"Detect a calendar invitation inside a message: ics extension · 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":40.033,"exit_code":1,"observations":[{"actual":{"attachments_ics":0,"count":0,"method":null},"check":"forwarded invitation","expected":{"attachments_ics":0,"count":0,"method":null},"passed":true},{"actual":{"attachments_ics":1,"count":0,"method":null},"check":"attached calendar with method","expected":{"attachments_ics":1,"count":0,"method":null},"passed":true},{"actual":{"attachments_ics":0,"count":1,"method":"REQUEST"},"check":"padded lower-case method","expected":{"attachments_ics":0,"count":1,"method":"REQUEST"},"passed":true},{"actual":{"attachments_ics":0,"count":2,"method":"AMBIGUOUS"},"check":"conflicting methods","expected":{"attachments_ics":0,"count":2,"method":"AMBIGUOUS"},"passed":true},{"actual":{"attachments_ics":0,"count":2,"method":"REPLY"},"check":"same method twice","expected":{"attachments_ics":0,"count":2,"method":"REPLY"},"passed":true},{"actual":{"attachments_ics":0,"count":0,"method":null},"check":"upper-case ics attachment","expected":{"attachments_ics":1,"count":0,"method":null},"passed":false},{"actual":{"attachments_ics":0,"count":0,"method":null},"check":"plain message","expected":{"attachments_ics":0,"count":0,"method":null},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"forwarded invitation\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 0, \"method\": null}, \"passed\": true}, {\"check\": \"attached calendar with method\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 1}, \"expected\": {\"attachments_ics\": 1, \"count\": 0, \"method\": null}, \"passed\": true}, {\"check\": \"padded lower-case method\", \"actual\": {\"method\": \"REQUEST\", \"count\": 1, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 1, \"method\": \"REQUEST\"}, \"passed\": true}, {\"check\": \"conflicting methods\", \"actual\": {\"method\": \"AMBIGUOUS\", \"count\": 2, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 2, \"method\": \"AMBIGUOUS\"}, \"passed\": true}, {\"check\": \"same method twice\", \"actual\": {\"method\": \"REPLY\", \"count\": 2, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 2, \"method\": \"REPLY\"}, \"passed\": true}, {\"check\": \"upper-case ics attachment\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 1, \"count\": 0, \"method\": null}, \"passed\": false}, {\"check\": \"plain message\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 0, \"method\": null}, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.185,"exit_code":1,"observations":[{"actual":{"attachments_ics":0,"count":0,"method":null},"check":"forwarded invitation","expected":{"attachments_ics":0,"count":0,"method":null},"passed":true},{"actual":{"attachments_ics":1,"count":0,"method":null},"check":"attached calendar with method","expected":{"attachments_ics":1,"count":0,"method":null},"passed":true},{"actual":{"attachments_ics":0,"count":1,"method":"REQUEST"},"check":"padded lower-case method","expected":{"attachments_ics":0,"count":1,"method":"REQUEST"},"passed":true},{"actual":{"attachments_ics":0,"count":2,"method":"AMBIGUOUS"},"check":"conflicting methods","expected":{"attachments_ics":0,"count":2,"method":"AMBIGUOUS"},"passed":true},{"actual":{"attachments_ics":0,"count":2,"method":"REPLY"},"check":"same method twice","expected":{"attachments_ics":0,"count":2,"method":"REPLY"},"passed":true},{"actual":{"attachments_ics":0,"count":0,"method":null},"check":"upper-case ics attachment","expected":{"attachments_ics":1,"count":0,"method":null},"passed":false},{"actual":{"attachments_ics":0,"count":0,"method":null},"check":"plain message","expected":{"attachments_ics":0,"count":0,"method":null},"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"forwarded invitation\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 0, \"method\": null}, \"passed\": true}, {\"check\": \"attached calendar with method\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 1}, \"expected\": {\"attachments_ics\": 1, \"count\": 0, \"method\": null}, \"passed\": true}, {\"check\": \"padded lower-case method\", \"actual\": {\"method\": \"REQUEST\", \"count\": 1, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 1, \"method\": \"REQUEST\"}, \"passed\": true}, {\"check\": \"conflicting methods\", \"actual\": {\"method\": \"AMBIGUOUS\", \"count\": 2, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 2, \"method\": \"AMBIGUOUS\"}, \"passed\": true}, {\"check\": \"same method twice\", \"actual\": {\"method\": \"REPLY\", \"count\": 2, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 2, \"method\": \"REPLY\"}, \"passed\": true}, {\"check\": \"upper-case ics attachment\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 1, \"count\": 0, \"method\": null}, \"passed\": false}, {\"check\": \"plain message\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 0, \"method\": null}, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":37.583,"exit_code":0,"observations":[{"actual":{"attachments_ics":0,"count":0,"method":null},"check":"forwarded invitation","expected":{"attachments_ics":0,"count":0,"method":null},"passed":true},{"actual":{"attachments_ics":1,"count":0,"method":null},"check":"attached calendar with method","expected":{"attachments_ics":1,"count":0,"method":null},"passed":true},{"actual":{"attachments_ics":0,"count":1,"method":"REQUEST"},"check":"padded lower-case method","expected":{"attachments_ics":0,"count":1,"method":"REQUEST"},"passed":true},{"actual":{"attachments_ics":0,"count":2,"method":"AMBIGUOUS"},"check":"conflicting methods","expected":{"attachments_ics":0,"count":2,"method":"AMBIGUOUS"},"passed":true},{"actual":{"attachments_ics":0,"count":2,"method":"REPLY"},"check":"same method twice","expected":{"attachments_ics":0,"count":2,"method":"REPLY"},"passed":true},{"actual":{"attachments_ics":1,"count":0,"method":null},"check":"upper-case ics attachment","expected":{"attachments_ics":1,"count":0,"method":null},"passed":true},{"actual":{"attachments_ics":0,"count":0,"method":null},"check":"plain message","expected":{"attachments_ics":0,"count":0,"method":null},"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"forwarded invitation\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 0, \"method\": null}, \"passed\": true}, {\"check\": \"attached calendar with method\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 1}, \"expected\": {\"attachments_ics\": 1, \"count\": 0, \"method\": null}, \"passed\": true}, {\"check\": \"padded lower-case method\", \"actual\": {\"method\": \"REQUEST\", \"count\": 1, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 1, \"method\": \"REQUEST\"}, \"passed\": true}, {\"check\": \"conflicting methods\", \"actual\": {\"method\": \"AMBIGUOUS\", \"count\": 2, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 2, \"method\": \"AMBIGUOUS\"}, \"passed\": true}, {\"check\": \"same method twice\", \"actual\": {\"method\": \"REPLY\", \"count\": 2, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 2, \"method\": \"REPLY\"}, \"passed\": true}, {\"check\": \"upper-case ics attachment\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 1}, \"expected\": {\"attachments_ics\": 1, \"count\": 0, \"method\": null}, \"passed\": true}, {\"check\": \"plain message\", \"actual\": {\"method\": null, \"count\": 0, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 0, \"method\": null}, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}