{"abstract":"Hands containing \"10h\" fail to evaluate while \"Th\" works.","category":"Poker hand evaluation","checks":8,"contract":"Input: five distinct cards as rank+suit strings; ranks 2-9, T or 10, J, Q, K, A (case-insensitive), suits c/d/h/s (case-insensitive). Return the standard five-card category name in lower case; A-2-3-4-5 is a straight; royal flush is reported as \"straight flush\".","contract_signature":"x","evaluation_group":"w2-poker_hand_evaluation-category-classifier","failed_approach":"Handling \"10\" but dropping the upper-case normalization breaks lower-case rank letters such as \"kd\".","family":"w2-poker_hand_evaluation-category-classifier-ten-token-parsing","id":"FA-81861","implementations":{"attempt":{"sha256":"a39424da02e0583033e9e85eb0e96096c90af7777f212916aed1f5639ec569c2","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport collections\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'\n    vals=sorted((R.index('T' if c[:-1]=='10' else c[:-1])+2 for c in x), reverse=True)\n    suits=[c[-1].lower() for c in x]\n    cnt=sorted(collections.Counter(vals).values(), reverse=True)\n    flush=len(set(suits))==1\n    uniq=sorted(set(vals))\n    straight=False\n    if len(uniq)==5:\n        if uniq[4]-uniq[0]==4: straight=True\n        elif uniq==[2,3,4,5,14]: straight=True\n    if straight and flush: return 'straight flush'\n    if cnt[0]==4: return 'four of a kind'\n    if cnt==[3,2]: return 'full house'\n    if flush: return 'flush'\n    if straight: return 'straight'\n    if cnt[0]==3: return 'three of a kind'\n    if cnt==[2,2,1]: return 'two pair'\n    if cnt[0]==2: return 'one pair'\n    return 'high card'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('wheel straight', ['Ah', '2d', '3c', '4s', '5h'], 'straight'),\n  ('wheel straight flush', ['As', '2s', '3s', '4s', '5s'], 'straight flush'),\n  ('four to wheel plus nine', ['2h', '3d', '4c', '5s', '9h'], 'high card'),\n  ('four to wheel plus king', ['2h', '3d', '4c', '5s', 'Kh'], 'high card'),\n  ('plain flush', ['2h', '7h', '9h', 'Jh', 'Kh'], 'flush'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('lower-case ranks', ['kd', 'kh', '3c', '3s', '8h'], 'two pair'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush')],\n [('four to wheel plus king', ['2h', '3d', '4c', '5s', 'Kh'], 'high card'),\n  ('plain flush', ['2h', '7h', '9h', 'Jh', 'Kh'], 'flush'),\n  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah'], 'straight'),\n  ('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\n  ('full house', ['7h', '7d', '7c', 'Ks', 'Kh'], 'full house'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('lower-case ranks', ['kd', 'kh', '3c', '3s', '8h'], 'two pair'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush')],\n [('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\n  ('full house', ['7h', '7d', '7c', 'Ks', 'Kh'], 'full house'),\n  ('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one pair'),\n  ('two pair', ['9h', '9d', '4c', '4s', '2h'], 'two pair'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('lower-case ranks', ['kd', 'kh', '3c', '3s', '8h'], 'two pair'),\n  ('mixed-case suits flush', ['2H', '7h', '9h', 'JH', 'Kh'], 'flush'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush')],\n [('two pair', ['9h', '9d', '4c', '4s', '2h'], 'two pair'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('lower-case ranks', ['kd', 'kh', '3c', '3s', '8h'], 'two pair'),\n  ('mixed-case suits flush', ['2H', '7h', '9h', 'JH', 'Kh'], 'flush'),\n  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], 'high card'),\n  ('quads', ['6h', '6d', '6c', '6s', '2h'], 'four of a kind'),\n  ('high card', ['2h', '7d', '9c', 'Js', 'Kh'], 'high card'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush')],\n [('wheel straight', ['Ah', '2d', '3c', '4s', '5h'], 'straight'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('lower-case ranks', ['kd', 'kh', '3c', '3s', '8h'], 'two pair'),\n  ('quads', ['6h', '6d', '6c', '6s', '2h'], 'four of a kind'),\n  ('high card', ['2h', '7d', '9c', 'Js', 'Kh'], 'high card'),\n  ('straight flush middle', ['5d', '6d', '7d', '8d', '9d'], 'straight flush'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush'),\n  ('flush ends match only', ['2h', '7d', '9h', 'Jc', 'Kh'], 'high card')]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'error:' + type(exc).__name__\n    check(label, actual, 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":"ca11981cba2e313577814b7dc8ccad5c7154ea47d2f7786529437e8a898e4953","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport collections\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'\n    vals=sorted((R.index(c[0].upper())+2 for c in x), reverse=True)\n    suits=[c[-1].lower() for c in x]\n    cnt=sorted(collections.Counter(vals).values(), reverse=True)\n    flush=len(set(suits))==1\n    uniq=sorted(set(vals))\n    straight=False\n    if len(uniq)==5:\n        if uniq[4]-uniq[0]==4: straight=True\n        elif uniq==[2,3,4,5,14]: straight=True\n    if straight and flush: return 'straight flush'\n    if cnt[0]==4: return 'four of a kind'\n    if cnt==[3,2]: return 'full house'\n    if flush: return 'flush'\n    if straight: return 'straight'\n    if cnt[0]==3: return 'three of a kind'\n    if cnt==[2,2,1]: return 'two pair'\n    if cnt[0]==2: return 'one pair'\n    return 'high card'\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('wheel straight', ['Ah', '2d', '3c', '4s', '5h'], 'straight'),\n  ('wheel straight flush', ['As', '2s', '3s', '4s', '5s'], 'straight flush'),\n  ('four to wheel plus nine', ['2h', '3d', '4c', '5s', '9h'], 'high card'),\n  ('four to wheel plus king', ['2h', '3d', '4c', '5s', 'Kh'], 'high card'),\n  ('plain flush', ['2h', '7h', '9h', 'Jh', 'Kh'], 'flush'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('lower-case ranks', ['kd', 'kh', '3c', '3s', '8h'], 'two pair'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush')],\n [('four to wheel plus king', ['2h', '3d', '4c', '5s', 'Kh'], 'high card'),\n  ('plain flush', ['2h', '7h', '9h', 'Jh', 'Kh'], 'flush'),\n  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah'], 'straight'),\n  ('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\n  ('full house', ['7h', '7d', '7c', 'Ks', 'Kh'], 'full house'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('lower-case ranks', ['kd', 'kh', '3c', '3s', '8h'], 'two pair'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush')],\n [('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\n  ('full house', ['7h', '7d', '7c', 'Ks', 'Kh'], 'full house'),\n  ('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one pair'),\n  ('two pair', ['9h', '9d', '4c', '4s', '2h'], 'two pair'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('lower-case ranks', ['kd', 'kh', '3c', '3s', '8h'], 'two pair'),\n  ('mixed-case suits flush', ['2H', '7h', '9h', 'JH', 'Kh'], 'flush'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush')],\n [('two pair', ['9h', '9d', '4c', '4s', '2h'], 'two pair'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('lower-case ranks', ['kd', 'kh', '3c', '3s', '8h'], 'two pair'),\n  ('mixed-case suits flush', ['2H', '7h', '9h', 'JH', 'Kh'], 'flush'),\n  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], 'high card'),\n  ('quads', ['6h', '6d', '6c', '6s', '2h'], 'four of a kind'),\n  ('high card', ['2h', '7d', '9c', 'Js', 'Kh'], 'high card'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush')],\n [('wheel straight', ['Ah', '2d', '3c', '4s', '5h'], 'straight'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('lower-case ranks', ['kd', 'kh', '3c', '3s', '8h'], 'two pair'),\n  ('quads', ['6h', '6d', '6c', '6s', '2h'], 'four of a kind'),\n  ('high card', ['2h', '7d', '9c', 'Js', 'Kh'], 'high card'),\n  ('straight flush middle', ['5d', '6d', '7d', '8d', '9d'], 'straight flush'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush'),\n  ('flush ends match only', ['2h', '7d', '9h', 'Jc', 'Kh'], 'high card')]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'error:' + type(exc).__name__\n    check(label, actual, 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":"A deterministic toy model with an explicitly stated contract; card strings are rank+suit (for example \"As\", \"Td\", \"10h\"); no claim of conformance to any casino or tournament rulebook. 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-poker_hand_evaluation-category-classifier-ten-token-parsing","generated_at":"2026-09-29T14:50:06.926996+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Poker engines settle real money pots from these comparisons; a single misranked hand pays the wrong seat.","root_cause":"The rank is read from the first character only, so \"10h\" yields rank \"1\", which is not in the rank table.","sha256":"c6006a1abc909fc228c6d5b904a4b40d89df6f2906838f448bf2a16995c5ca72","title":"Two-character ten token crashes rank parsing · 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":37.72,"exit_code":1,"observations":[{"actual":"straight","check":"wheel straight","expected":"straight","passed":true},{"actual":"straight flush","check":"wheel straight flush","expected":"straight flush","passed":true},{"actual":"high card","check":"four to wheel plus nine","expected":"high card","passed":true},{"actual":"high card","check":"four to wheel plus king","expected":"high card","passed":true},{"actual":"flush","check":"plain flush","expected":"flush","passed":true},{"actual":"straight","check":"ten written as 10","expected":"straight","passed":true},{"actual":"error:ValueError","check":"lower-case ranks","expected":"two pair","passed":false},{"actual":"flush","check":"ten flush with 10 token","expected":"flush","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wheel straight\", \"actual\": \"straight\", \"expected\": \"straight\", \"passed\": true}, {\"check\": \"wheel straight flush\", \"actual\": \"straight flush\", \"expected\": \"straight flush\", \"passed\": true}, {\"check\": \"four to wheel plus nine\", \"actual\": \"high card\", \"expected\": \"high card\", \"passed\": true}, {\"check\": \"four to wheel plus king\", \"actual\": \"high card\", \"expected\": \"high card\", \"passed\": true}, {\"check\": \"plain flush\", \"actual\": \"flush\", \"expected\": \"flush\", \"passed\": true}, {\"check\": \"ten written as 10\", \"actual\": \"straight\", \"expected\": \"straight\", \"passed\": true}, {\"check\": \"lower-case ranks\", \"actual\": \"error:ValueError\", \"expected\": \"two pair\", \"passed\": false}, {\"check\": \"ten flush with 10 token\", \"actual\": \"flush\", \"expected\": \"flush\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.25,"exit_code":1,"observations":[{"actual":"straight","check":"wheel straight","expected":"straight","passed":true},{"actual":"straight flush","check":"wheel straight flush","expected":"straight flush","passed":true},{"actual":"high card","check":"four to wheel plus nine","expected":"high card","passed":true},{"actual":"high card","check":"four to wheel plus king","expected":"high card","passed":true},{"actual":"flush","check":"plain flush","expected":"flush","passed":true},{"actual":"error:ValueError","check":"ten written as 10","expected":"straight","passed":false},{"actual":"two pair","check":"lower-case ranks","expected":"two pair","passed":true},{"actual":"error:ValueError","check":"ten flush with 10 token","expected":"flush","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wheel straight\", \"actual\": \"straight\", \"expected\": \"straight\", \"passed\": true}, {\"check\": \"wheel straight flush\", \"actual\": \"straight flush\", \"expected\": \"straight flush\", \"passed\": true}, {\"check\": \"four to wheel plus nine\", \"actual\": \"high card\", \"expected\": \"high card\", \"passed\": true}, {\"check\": \"four to wheel plus king\", \"actual\": \"high card\", \"expected\": \"high card\", \"passed\": true}, {\"check\": \"plain flush\", \"actual\": \"flush\", \"expected\": \"flush\", \"passed\": true}, {\"check\": \"ten written as 10\", \"actual\": \"error:ValueError\", \"expected\": \"straight\", \"passed\": false}, {\"check\": \"lower-case ranks\", \"actual\": \"two pair\", \"expected\": \"two pair\", \"passed\": true}, {\"check\": \"ten flush with 10 token\", \"actual\": \"error:ValueError\", \"expected\": \"flush\", \"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."}}