{"abstract":"A prefix AST silently ignores an unconsumed token.","category":"Parsing","checks":4,"contract":"Parse binary +/* prefix expressions with other tokens as leaves; reject missing operands and unconsumed tokens.","evaluation_group":"model-79c4b782357e079d","failed_approach":"The attempted repair handles the primary example but still violates a separate boundary of the same contract.","family":"xp-prefix-trailing-token","id":"FA-4051","implementations":{"attempt":{"sha256":"81c884b2234fa45695446d78e444298036ba12a43d1c278f157d73642449bc35","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        def parse(i):\n            if i >= len(x): raise ValueError('missing operand')\n            t=x[i]\n            if t not in ('+','*'): return t,i+1\n            a,j=parse(i+1)\n            b,k=parse(j)\n            return [t,a,b],k\n        try:\n            tree,end=parse(0)\n        except ValueError:\n            return None\n        return tree if len(x)<=3 else None\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(['+', 'a', 'b', 'c']), None)\ncheck('boundary 2', solve(['+', 'a', '*', 'b', 'c']), ['+', 'a', ['*', 'b', 'c']])\ncheck('boundary 3', solve(['a']), 'a')\ncheck('boundary 4', solve(['+', 'a']), 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":"9d747ccca334b0385a0eb0f865bfbd316d1be292179e959ed48419bd018274c6","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        def parse(i):\n            if i >= len(x): raise ValueError('missing operand')\n            t=x[i]\n            if t not in ('+','*'): return t,i+1\n            a,j=parse(i+1)\n            b,k=parse(j)\n            return [t,a,b],k\n        try:\n            tree,end=parse(0)\n        except ValueError:\n            return None\n        return tree\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(['+', 'a', 'b', 'c']), None)\ncheck('boundary 2', solve(['+', 'a', '*', 'b', 'c']), ['+', 'a', ['*', 'b', 'c']])\ncheck('boundary 3', solve(['a']), 'a')\ncheck('boundary 4', solve(['+', 'a']), 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"},"fixed":{"sha256":"2af3155983eb761d3103ec112aa356856875fb5766e6e3dafc0f002373b09bd2","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        def parse(i):\n            if i >= len(x): raise ValueError('missing operand')\n            t=x[i]\n            if t not in ('+','*'): return t,i+1\n            a,j=parse(i+1)\n            b,k=parse(j)\n            return [t,a,b],k\n        try:\n            tree,end=parse(0)\n        except ValueError:\n            return None\n        return tree if end==len(x) else None\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(['+', 'a', 'b', 'c']), None)\ncheck('boundary 2', solve(['+', 'a', '*', 'b', 'c']), ['+', 'a', ['*', 'b', 'c']])\ncheck('boundary 3', solve(['a']), 'a')\ncheck('boundary 4', solve(['+', 'a']), 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":"xp-prefix-trailing-token","generated_at":"2026-09-29T14:37:34.780697+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: Parse binary +/* prefix expressions with other tokens as leaves; reject missing operands and unconsumed tokens.","root_cause":"The implementation applies an operation whose text or grammar semantics violate this contract: Parse binary +/* prefix expressions with other tokens as leaves; reject missing operands and unconsumed tokens.","sha256":"a8530e43fb1b540c9d48c7bb842939daee1465381856920bd29b28dba32e4537","title":"A prefix AST silently ignores an unconsumed token · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":61.25,"exit_code":1,"observations":[{"actual":null,"check":"boundary 1","expected":null,"passed":true},{"actual":null,"check":"boundary 2","expected":["+","a",["*","b","c"]],"passed":false},{"actual":"a","check":"boundary 3","expected":"a","passed":true},{"actual":null,"check":"boundary 4","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 2\", \"actual\": null, \"expected\": [\"+\", \"a\", [\"*\", \"b\", \"c\"]], \"passed\": false}, {\"check\": \"boundary 3\", \"actual\": \"a\", \"expected\": \"a\", \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":63.23,"exit_code":1,"observations":[{"actual":["+","a","b"],"check":"boundary 1","expected":null,"passed":false},{"actual":["+","a",["*","b","c"]],"check":"boundary 2","expected":["+","a",["*","b","c"]],"passed":true},{"actual":"a","check":"boundary 3","expected":"a","passed":true},{"actual":null,"check":"boundary 4","expected":null,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": [\"+\", \"a\", \"b\"], \"expected\": null, \"passed\": false}, {\"check\": \"boundary 2\", \"actual\": [\"+\", \"a\", [\"*\", \"b\", \"c\"]], \"expected\": [\"+\", \"a\", [\"*\", \"b\", \"c\"]], \"passed\": true}, {\"check\": \"boundary 3\", \"actual\": \"a\", \"expected\": \"a\", \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":139.9,"exit_code":0,"observations":[{"actual":null,"check":"boundary 1","expected":null,"passed":true},{"actual":["+","a",["*","b","c"]],"check":"boundary 2","expected":["+","a",["*","b","c"]],"passed":true},{"actual":"a","check":"boundary 3","expected":"a","passed":true},{"actual":null,"check":"boundary 4","expected":null,"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"boundary 1\", \"actual\": null, \"expected\": null, \"passed\": true}, {\"check\": \"boundary 2\", \"actual\": [\"+\", \"a\", [\"*\", \"b\", \"c\"]], \"expected\": [\"+\", \"a\", [\"*\", \"b\", \"c\"]], \"passed\": true}, {\"check\": \"boundary 3\", \"actual\": \"a\", \"expected\": \"a\", \"passed\": true}, {\"check\": \"boundary 4\", \"actual\": null, \"expected\": null, \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}