{"abstract":"Trailing bytes, overlong encodings, and values larger than the specified integer width are accepted.","category":"Protocols","checks":9,"contract":"Decode exactly one minimally encoded unsigned 32-bit LEB128 integer from bytes. Return None for an empty, unterminated, overlong, overflowing, or multi-value input; otherwise return the integer.","contract_signature":"data","evaluation_group":"model-bb4cc9d347a44063","failed_approach":"Stopping at the first terminating byte ignores trailing data and does not reject overlong or overflowing representations.","family":"parse-canonical-varint","id":"FA-226","implementations":{"attempt":{"sha256":"267d32f8602d9ad2dea37fb1d0a0fa4949d8ab1909c55e61dba19f5e08b6935b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(data):\n    value = 0\n    for index, byte in enumerate(data[:5]):\n        value |= (byte & 0x7f) << (7 * index)\n        if byte < 0x80:\n            return value\n    return None\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero uses one byte', solve(b'\\x00'), 0)\ncheck('single-byte variant', solve(bytes([N])), N)\ncheck('two-byte variant', solve(bytes([0x80 | N, N])), 129 * N)\ncheck('maximum uint32', solve(b'\\xff\\xff\\xff\\xff\\x0f'), 4294967295)\ncheck('overflow fifth group rejected', solve(b'\\xff\\xff\\xff\\xff' + bytes([15 + N])), None)\ncheck('overlong zero rejected', solve(b'\\x80' * N + b'\\x00'), None)\ncheck('trailing value rejected', solve(bytes([N, N + 1])), None)\ncheck('unterminated input rejected', solve(b'\\x80' * N), None)\ncheck('empty input rejected', solve(b''), None)\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":"06df464b3e516fc694675c6633871a964b90e19a05a24c27ede65ac3409cf6b9","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(data):\n    return sum((byte & 0x7f) << (7 * index) for index, byte in enumerate(data))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\ncheck('zero uses one byte', solve(b'\\x00'), 0)\ncheck('single-byte variant', solve(bytes([N])), N)\ncheck('two-byte variant', solve(bytes([0x80 | N, N])), 129 * N)\ncheck('maximum uint32', solve(b'\\xff\\xff\\xff\\xff\\x0f'), 4294967295)\ncheck('overflow fifth group rejected', solve(b'\\xff\\xff\\xff\\xff' + bytes([15 + N])), None)\ncheck('overlong zero rejected', solve(b'\\x80' * N + b'\\x00'), None)\ncheck('trailing value rejected', solve(bytes([N, N + 1])), None)\ncheck('unterminated input rejected', solve(b'\\x80' * N), None)\ncheck('empty input rejected', solve(b''), None)\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-canonical-varint","generated_at":"2026-09-29T14:36:51.525124+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Binary framing needs a single accepted representation and an exact consumption contract. Decoding a numeric prefix alone cannot establish that the whole frame was valid.","root_cause":"The decoder accumulates seven-bit groups without enforcing termination, canonical length, and the numeric bound together.","sha256":"fca97da7da8742092a000b24e7d0d8cb05cff98caffc4864750f07cd314ec04b","title":"A varint decoder accepts an ambiguous or overflowing frame · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verified":true,"visibility":"public","verification":{"attempt":{"elapsed_ms":32.004,"exit_code":1,"observations":[{"actual":0,"check":"zero uses one byte","expected":0,"passed":true},{"actual":1,"check":"single-byte variant","expected":1,"passed":true},{"actual":129,"check":"two-byte variant","expected":129,"passed":true},{"actual":4294967295,"check":"maximum uint32","expected":4294967295,"passed":true},{"actual":4563402751,"check":"overflow fifth group rejected","expected":null,"passed":false},{"actual":0,"check":"overlong zero rejected","expected":null,"passed":false},{"actual":1,"check":"trailing value rejected","expected":null,"passed":false},{"actual":null,"check":"unterminated input rejected","expected":null,"passed":true},{"actual":null,"check":"empty input rejected","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero uses one byte\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"single-byte variant\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"two-byte variant\", \"actual\": 129, \"expected\": 129, \"passed\": true}, {\"check\": \"maximum uint32\", \"actual\": 4294967295, \"expected\": 4294967295, \"passed\": true}, {\"check\": \"overflow fifth group rejected\", \"actual\": 4563402751, \"expected\": null, \"passed\": false}, {\"check\": \"overlong zero rejected\", \"actual\": 0, \"expected\": null, \"passed\": false}, {\"check\": \"trailing value rejected\", \"actual\": 1, \"expected\": null, \"passed\": false}, {\"check\": \"unterminated input rejected\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"empty input rejected\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":33.578,"exit_code":1,"observations":[{"actual":0,"check":"zero uses one byte","expected":0,"passed":true},{"actual":1,"check":"single-byte variant","expected":1,"passed":true},{"actual":129,"check":"two-byte variant","expected":129,"passed":true},{"actual":4294967295,"check":"maximum uint32","expected":4294967295,"passed":true},{"actual":4563402751,"check":"overflow fifth group rejected","expected":null,"passed":false},{"actual":0,"check":"overlong zero rejected","expected":null,"passed":false},{"actual":257,"check":"trailing value rejected","expected":null,"passed":false},{"actual":0,"check":"unterminated input rejected","expected":null,"passed":false},{"actual":0,"check":"empty input rejected","expected":null,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"zero uses one byte\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"single-byte variant\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"two-byte variant\", \"actual\": 129, \"expected\": 129, \"passed\": true}, {\"check\": \"maximum uint32\", \"actual\": 4294967295, \"expected\": 4294967295, \"passed\": true}, {\"check\": \"overflow fifth group rejected\", \"actual\": 4563402751, \"expected\": null, \"passed\": false}, {\"check\": \"overlong zero rejected\", \"actual\": 0, \"expected\": null, \"passed\": false}, {\"check\": \"trailing value rejected\", \"actual\": 257, \"expected\": null, \"passed\": false}, {\"check\": \"unterminated input rejected\", \"actual\": 0, \"expected\": null, \"passed\": false}, {\"check\": \"empty input rejected\", \"actual\": 0, \"expected\": null, \"passed\": false}], \"passed\": false}\n"}},"member_only":{"stages":["fixed"],"fields":["implementations.fixed","verification.fixed","harness","repair"],"note":"The verified repair, its recorded checks, the repair description, and the scoring harness are available to members."}}