{"abstract":"A single pair of nines with three unpaired cards is labelled two pair.","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\".","evaluation_group":"w2-poker_hand_evaluation-category-classifier","failed_approach":"Testing whether any rank appears twice is just the one pair predicate again.","family":"w2-poker_hand_evaluation-category-classifier-two-pair-count-shape","id":"FA-81856","implementations":{"attempt":{"sha256":"3eeb2b013d4a2e4349494fab4d086f1997772ca7068680e29b2d1ab32e939777","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].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 2 in cnt: 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  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah'], 'straight'),\n  ('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\n  ('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one pair')],\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  ('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 [('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  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], 'high card')],\n [('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one 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  ('straight flush middle', ['5d', '6d', '7d', '8d', '9d'], 'straight flush')],\n [('wheel straight', ['Ah', '2d', '3c', '4s', '5h'], 'straight'),\n  ('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one pair'),\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  ('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":"bde0ed45554547c6e9af02ec9a38c05b42803a1d8e418618782841d99c6fa76b","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].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[0]==2 and len(cnt)<=4: 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  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah'], 'straight'),\n  ('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\n  ('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one pair')],\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  ('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 [('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  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], 'high card')],\n [('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one 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  ('straight flush middle', ['5d', '6d', '7d', '8d', '9d'], 'straight flush')],\n [('wheel straight', ['Ah', '2d', '3c', '4s', '5h'], 'straight'),\n  ('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one pair'),\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  ('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"},"fixed":{"sha256":"03bdfdccf5251bc7a8a3fa6b1c5635e70502759a8f012532fee4caf043625db7","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].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  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah'], 'straight'),\n  ('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\n  ('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one pair')],\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  ('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 [('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  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], 'high card')],\n [('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one 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  ('straight flush middle', ['5d', '6d', '7d', '8d', '9d'], 'straight flush')],\n [('wheel straight', ['Ah', '2d', '3c', '4s', '5h'], 'straight'),\n  ('one pair', ['9h', '9d', '4c', 'Ks', '2h'], 'one pair'),\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  ('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-two-pair-count-shape","generated_at":"2026-09-29T14:50:06.927530+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.","repair":"Require the count shape [2,2,1], i.e. exactly three distinct ranks with two pairs.","root_cause":"The two pair test allows four distinct ranks, which is the one pair shape.","sha256":"a6badecd2fcbb35aeded33b56ad0c93e6df9e7e75b035c98cbc8cf626783e5a3","title":"One pair hands leak into the two pair branch · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":38.781,"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":"broadway","expected":"straight","passed":true},{"actual":"three of a kind","check":"trips","expected":"three of a kind","passed":true},{"actual":"two pair","check":"one pair","expected":"one pair","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\": \"broadway\", \"actual\": \"straight\", \"expected\": \"straight\", \"passed\": true}, {\"check\": \"trips\", \"actual\": \"three of a kind\", \"expected\": \"three of a kind\", \"passed\": true}, {\"check\": \"one pair\", \"actual\": \"two pair\", \"expected\": \"one pair\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.833,"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":"broadway","expected":"straight","passed":true},{"actual":"three of a kind","check":"trips","expected":"three of a kind","passed":true},{"actual":"two pair","check":"one pair","expected":"one pair","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\": \"broadway\", \"actual\": \"straight\", \"expected\": \"straight\", \"passed\": true}, {\"check\": \"trips\", \"actual\": \"three of a kind\", \"expected\": \"three of a kind\", \"passed\": true}, {\"check\": \"one pair\", \"actual\": \"two pair\", \"expected\": \"one pair\", \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.307,"exit_code":0,"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":"broadway","expected":"straight","passed":true},{"actual":"three of a kind","check":"trips","expected":"three of a kind","passed":true},{"actual":"one pair","check":"one pair","expected":"one pair","passed":true}],"passed":true,"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\": \"broadway\", \"actual\": \"straight\", \"expected\": \"straight\", \"passed\": true}, {\"check\": \"trips\", \"actual\": \"three of a kind\", \"expected\": \"three of a kind\", \"passed\": true}, {\"check\": \"one pair\", \"actual\": \"one pair\", \"expected\": \"one pair\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}