{"abstract":"Methods written in lower case or padded are not recognised as the same method.","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":"Upper-casing without trimming keeps the padding. The attempted `methods.append(params['method'].upper())` still disagrees with a fixture.","family":"w2-email_mime_structure-calendar-invitation-method-normalization","id":"FA-76751","implementations":{"attempt":{"sha256":"904bc05d93d9e4749119a4cfe235f1466c3ac44a1ac5a8818b3abb68fd3c6b2e","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'].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":"437d6dfc755a442e4bc60aaad50cb21af162790c7daa4327bfd040b9ace031e4","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'])\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-method-normalization","generated_at":"2026-09-29T14:49:19.220127+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 `methods.append(params['method'].strip().upper())` for the method normalization decision and keep every other rule of the model unchanged.","root_cause":"The method normalization decision evaluates `methods.append(params['method'])` where the contract requires `methods.append(params['method'].strip().upper())`.","sha256":"112eab8cbd52e0fbe4c1792757f33631f6ec708ad67d8d32990b3eee5090de37","title":"Detect a calendar invitation inside a message: method normalization · 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":42.151,"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":false},{"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":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\": false}, {\"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\": false}\n"},"broken":{"elapsed_ms":39.822,"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":false},{"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":"AMBIGUOUS"},"check":"same method twice","expected":{"attachments_ics":0,"count":2,"method":"REPLY"},"passed":false},{"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":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\": false}, {\"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\": \"AMBIGUOUS\", \"count\": 2, \"attachments_ics\": 0}, \"expected\": {\"attachments_ics\": 0, \"count\": 2, \"method\": \"REPLY\"}, \"passed\": false}, {\"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\": false}\n"},"fixed":{"elapsed_ms":41.51,"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"}