{"abstract":"The declared payload length is smaller than the actual UTF-8 payload for non-ASCII text.","category":"Protocols","checks":7,"contract":"Return the hexadecimal representation of an ASCII decimal byte-length prefix, a colon, then the UTF-8 payload. The prefix excludes its own bytes and the colon.","evaluation_group":"encoding-utf8-byte-length","failed_approach":"Counting UTF-16 code units still does not measure UTF-8 payload bytes.","family":"parse-byte-length-frame","id":"FA-181","implementations":{"attempt":{"sha256":"58a2a6a7bf0be2f0f74466ec4bda0a13e4d99c99fbe9d74c3703d9161bba1028","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text):\n    return (str(len(text.encode('utf-16-le')) // 2).encode('ascii') + b':' + text.encode('utf-8')).hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('ASCII length', solve('x' * N), (str(N).encode() + b':' + b'x' * N).hex())\ncheck('two-byte code point', solve('é' * N), (str(2 * N).encode() + b':' + b'\\xc3\\xa9' * N).hex())\ncheck('four-byte code point', solve('🙂' * N), (str(4 * N).encode() + b':' + b'\\xf0\\x9f\\x99\\x82' * N).hex())\ncheck('combining mark remains separate', solve('e\\u0301' * N), (str(3 * N).encode() + b':' + b'e\\xcc\\x81' * N).hex())\ncheck('mixed encoding widths', solve('A界' * N), (str(4 * N).encode() + b':' + b'A\\xe7\\x95\\x8c' * N).hex())\ncheck('empty payload', solve(''), '303a')\ncheck('delimiter inside payload', solve(':' * N), (str(N).encode() + b':' + b':' * N).hex())\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":"3ff8d5519ba47fb21760914b1684da866c42289365f73a6fdf0400396bd4e281","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text):\n    return (str(len(text)).encode('ascii') + b':' + text.encode('utf-8')).hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('ASCII length', solve('x' * N), (str(N).encode() + b':' + b'x' * N).hex())\ncheck('two-byte code point', solve('é' * N), (str(2 * N).encode() + b':' + b'\\xc3\\xa9' * N).hex())\ncheck('four-byte code point', solve('🙂' * N), (str(4 * N).encode() + b':' + b'\\xf0\\x9f\\x99\\x82' * N).hex())\ncheck('combining mark remains separate', solve('e\\u0301' * N), (str(3 * N).encode() + b':' + b'e\\xcc\\x81' * N).hex())\ncheck('mixed encoding widths', solve('A界' * N), (str(4 * N).encode() + b':' + b'A\\xe7\\x95\\x8c' * N).hex())\ncheck('empty payload', solve(''), '303a')\ncheck('delimiter inside payload', solve(':' * N), (str(N).encode() + b':' + b':' * N).hex())\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":"d704e9c3120f56f4c8c7d56b3463be04bd16f47cc3a0149761f775f63f34e370","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(text):\n    payload = text.encode('utf-8')\n    return (str(len(payload)).encode('ascii') + b':' + payload).hex()\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('ASCII length', solve('x' * N), (str(N).encode() + b':' + b'x' * N).hex())\ncheck('two-byte code point', solve('é' * N), (str(2 * N).encode() + b':' + b'\\xc3\\xa9' * N).hex())\ncheck('four-byte code point', solve('🙂' * N), (str(4 * N).encode() + b':' + b'\\xf0\\x9f\\x99\\x82' * N).hex())\ncheck('combining mark remains separate', solve('e\\u0301' * N), (str(3 * N).encode() + b':' + b'e\\xcc\\x81' * N).hex())\ncheck('mixed encoding widths', solve('A界' * N), (str(4 * N).encode() + b':' + b'A\\xe7\\x95\\x8c' * N).hex())\ncheck('empty payload', solve(''), '303a')\ncheck('delimiter inside payload', solve(':' * N), (str(N).encode() + b':' + b':' * N).hex())\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":"parse-byte-length-frame","generated_at":"2026-09-29T14:36:51.018177+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Length-prefixed protocols operate on bytes. Unicode code points and UTF-16 units match byte counts for some fixtures, making ASCII-only tests insufficient.","repair":"Encode once to UTF-8 and prefix the length of the encoded bytes.","root_cause":"A protocol byte count is calculated from Unicode characters rather than the encoded payload.","sha256":"f6b2f977625fa55b2bfc8cfcd3179516066be288bf6ba0661479d8b515ee6c14","title":"A character count truncates a UTF-8 frame · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":31.775,"exit_code":1,"observations":[{"actual":"313a78","check":"ASCII length","expected":"313a78","passed":true},{"actual":"313ac3a9","check":"two-byte code point","expected":"323ac3a9","passed":false},{"actual":"323af09f9982","check":"four-byte code point","expected":"343af09f9982","passed":false},{"actual":"323a65cc81","check":"combining mark remains separate","expected":"333a65cc81","passed":false},{"actual":"323a41e7958c","check":"mixed encoding widths","expected":"343a41e7958c","passed":false},{"actual":"303a","check":"empty payload","expected":"303a","passed":true},{"actual":"313a3a","check":"delimiter inside payload","expected":"313a3a","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ASCII length\", \"actual\": \"313a78\", \"expected\": \"313a78\", \"passed\": true}, {\"check\": \"two-byte code point\", \"actual\": \"313ac3a9\", \"expected\": \"323ac3a9\", \"passed\": false}, {\"check\": \"four-byte code point\", \"actual\": \"323af09f9982\", \"expected\": \"343af09f9982\", \"passed\": false}, {\"check\": \"combining mark remains separate\", \"actual\": \"323a65cc81\", \"expected\": \"333a65cc81\", \"passed\": false}, {\"check\": \"mixed encoding widths\", \"actual\": \"323a41e7958c\", \"expected\": \"343a41e7958c\", \"passed\": false}, {\"check\": \"empty payload\", \"actual\": \"303a\", \"expected\": \"303a\", \"passed\": true}, {\"check\": \"delimiter inside payload\", \"actual\": \"313a3a\", \"expected\": \"313a3a\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":34.094,"exit_code":1,"observations":[{"actual":"313a78","check":"ASCII length","expected":"313a78","passed":true},{"actual":"313ac3a9","check":"two-byte code point","expected":"323ac3a9","passed":false},{"actual":"313af09f9982","check":"four-byte code point","expected":"343af09f9982","passed":false},{"actual":"323a65cc81","check":"combining mark remains separate","expected":"333a65cc81","passed":false},{"actual":"323a41e7958c","check":"mixed encoding widths","expected":"343a41e7958c","passed":false},{"actual":"303a","check":"empty payload","expected":"303a","passed":true},{"actual":"313a3a","check":"delimiter inside payload","expected":"313a3a","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ASCII length\", \"actual\": \"313a78\", \"expected\": \"313a78\", \"passed\": true}, {\"check\": \"two-byte code point\", \"actual\": \"313ac3a9\", \"expected\": \"323ac3a9\", \"passed\": false}, {\"check\": \"four-byte code point\", \"actual\": \"313af09f9982\", \"expected\": \"343af09f9982\", \"passed\": false}, {\"check\": \"combining mark remains separate\", \"actual\": \"323a65cc81\", \"expected\": \"333a65cc81\", \"passed\": false}, {\"check\": \"mixed encoding widths\", \"actual\": \"323a41e7958c\", \"expected\": \"343a41e7958c\", \"passed\": false}, {\"check\": \"empty payload\", \"actual\": \"303a\", \"expected\": \"303a\", \"passed\": true}, {\"check\": \"delimiter inside payload\", \"actual\": \"313a3a\", \"expected\": \"313a3a\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":31.929,"exit_code":0,"observations":[{"actual":"313a78","check":"ASCII length","expected":"313a78","passed":true},{"actual":"323ac3a9","check":"two-byte code point","expected":"323ac3a9","passed":true},{"actual":"343af09f9982","check":"four-byte code point","expected":"343af09f9982","passed":true},{"actual":"333a65cc81","check":"combining mark remains separate","expected":"333a65cc81","passed":true},{"actual":"343a41e7958c","check":"mixed encoding widths","expected":"343a41e7958c","passed":true},{"actual":"303a","check":"empty payload","expected":"303a","passed":true},{"actual":"313a3a","check":"delimiter inside payload","expected":"313a3a","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ASCII length\", \"actual\": \"313a78\", \"expected\": \"313a78\", \"passed\": true}, {\"check\": \"two-byte code point\", \"actual\": \"323ac3a9\", \"expected\": \"323ac3a9\", \"passed\": true}, {\"check\": \"four-byte code point\", \"actual\": \"343af09f9982\", \"expected\": \"343af09f9982\", \"passed\": true}, {\"check\": \"combining mark remains separate\", \"actual\": \"333a65cc81\", \"expected\": \"333a65cc81\", \"passed\": true}, {\"check\": \"mixed encoding widths\", \"actual\": \"343a41e7958c\", \"expected\": \"343a41e7958c\", \"passed\": true}, {\"check\": \"empty payload\", \"actual\": \"303a\", \"expected\": \"303a\", \"passed\": true}, {\"check\": \"delimiter inside payload\", \"actual\": \"313a3a\", \"expected\": \"313a3a\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}