{"abstract":"A base64 token contains MIME line wrapping.","category":"Encodings","checks":4,"contract":"Encode bytes to standard padded Base64 with no newline, even for long input.","evaluation_group":"model-ab3756f33f36302c","failed_approach":"The attempted repair handles the primary example but still violates a separate boundary of the same contract.","family":"xp-base64-line-wrapping","id":"FA-4031","implementations":{"attempt":{"sha256":"20de0c51927f6471a8e7dbea75133abe4ab66e4bff365db9a99c17663a3f9c88","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct\nfrom urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit\nfrom email.header import decode_header, make_header\nfrom email.utils import getaddresses\nfrom xml.etree import ElementTree as ET\nimport shlex, string, textwrap\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        return base64.encodebytes(bytes(x)).decode().rstrip('\\n')\n    except Exception as exc:\n        return {\"error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('boundary 1', solve([97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97]), 'YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh')\ncheck('boundary 2', solve([97]), 'YQ==')\ncheck('boundary 3', solve([]), '')\ncheck('boundary 4', solve([0, 0, 0]), 'AAAA')\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":"bea3cd1bef007762b6e888a64a2f391a85ba0c93062b7de28fa1016e6fc21524","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct\nfrom urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit\nfrom email.header import decode_header, make_header\nfrom email.utils import getaddresses\nfrom xml.etree import ElementTree as ET\nimport shlex, string, textwrap\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        return base64.encodebytes(bytes(x)).decode()\n    except Exception as exc:\n        return {\"error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('boundary 1', solve([97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97]), 'YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh')\ncheck('boundary 2', solve([97]), 'YQ==')\ncheck('boundary 3', solve([]), '')\ncheck('boundary 4', solve([0, 0, 0]), 'AAAA')\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":"36353d0882e6a28649c542ff12f519b7f5cae5efc1922f12f3d4d4b6a7da266c","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport re, unicodedata, json, csv, io, html, base64, binascii, codecs, struct\nfrom urllib.parse import quote, unquote, unquote_to_bytes, urlencode, parse_qsl, urlsplit, urlunsplit\nfrom email.header import decode_header, make_header\nfrom email.utils import getaddresses\nfrom xml.etree import ElementTree as ET\nimport shlex, string, textwrap\n\nN = 1\nobservations = []\ndef solve(x):\n    try:\n        return base64.b64encode(bytes(x)).decode()\n    except Exception as exc:\n        return {\"error\": type(exc).__name__}\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('boundary 1', solve([97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97, 97]), 'YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh')\ncheck('boundary 2', solve([97]), 'YQ==')\ncheck('boundary 3', solve([]), '')\ncheck('boundary 4', solve([0, 0, 0]), 'AAAA')\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":" 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":"xp-base64-line-wrapping","generated_at":"2026-09-29T14:37:34.618949+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"A local executable model for consumers of structured text; oracle values are authored literals, not outputs copied from the repaired implementation.","repair":"Implement the complete stated contract, including the boundary fixtures: Encode bytes to standard padded Base64 with no newline, even for long input.","root_cause":"The implementation applies an operation whose text or grammar semantics violate this contract: Encode bytes to standard padded Base64 with no newline, even for long input.","sha256":"6563272c751425d0ff4a34ae2eb4d16cf7c91aa85ecebaed4f84ed3a01b3e755","title":"A base64 token contains MIME line wrapping · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":66.279,"exit_code":1,"observations":[{"actual":"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\nYWFh","check":"boundary 1","expected":"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh","passed":false},{"actual":"YQ==","check":"boundary 2","expected":"YQ==","passed":true},{"actual":"","check":"boundary 3","expected":"","passed":true},{"actual":"AAAA","check":"boundary 4","expected":"AAAA","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": \"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\\nYWFh\", \"expected\": \"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\", \"passed\": false}, {\"check\": \"boundary 2\", \"actual\": \"YQ==\", \"expected\": \"YQ==\", \"passed\": true}, {\"check\": \"boundary 3\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": \"AAAA\", \"expected\": \"AAAA\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":56.313,"exit_code":1,"observations":[{"actual":"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\nYWFh\n","check":"boundary 1","expected":"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh","passed":false},{"actual":"YQ==\n","check":"boundary 2","expected":"YQ==","passed":false},{"actual":"","check":"boundary 3","expected":"","passed":true},{"actual":"AAAA\n","check":"boundary 4","expected":"AAAA","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": \"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\\nYWFh\\n\", \"expected\": \"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\", \"passed\": false}, {\"check\": \"boundary 2\", \"actual\": \"YQ==\\n\", \"expected\": \"YQ==\", \"passed\": false}, {\"check\": \"boundary 3\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": \"AAAA\\n\", \"expected\": \"AAAA\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":55.565,"exit_code":0,"observations":[{"actual":"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh","check":"boundary 1","expected":"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh","passed":true},{"actual":"YQ==","check":"boundary 2","expected":"YQ==","passed":true},{"actual":"","check":"boundary 3","expected":"","passed":true},{"actual":"AAAA","check":"boundary 4","expected":"AAAA","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": \"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\", \"expected\": \"YWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFhYWFh\", \"passed\": true}, {\"check\": \"boundary 2\", \"actual\": \"YQ==\", \"expected\": \"YQ==\", \"passed\": true}, {\"check\": \"boundary 3\", \"actual\": \"\", \"expected\": \"\", \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": \"AAAA\", \"expected\": \"AAAA\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}