{"abstract":"Four hearts and a spade are reported as a flush.","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":"Comparing only the first and last suits misses a mismatched middle card.","family":"w2-poker_hand_evaluation-category-classifier-flush-suit-agreement","id":"FA-81871","implementations":{"attempt":{"sha256":"1394f463fdf28579f8ac7b4b6d08918cf590d1cbd43b17be9e2bce7b09be9fba","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=suits[0]==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  ('plain flush', ['2h', '7h', '9h', 'Jh', 'Kh'], 'flush'),\n  ('full house', ['7h', '7d', '7c', 'Ks', 'Kh'], 'full house'),\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 [('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  ('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  ('straight flush middle', ['5d', '6d', '7d', '8d', '9d'], 'straight flush'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush')],\n [('wheel straight', ['Ah', '2d', '3c', '4s', '5h'], 'straight'),\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  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah'], 'straight'),\n  ('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\n  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], '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 [('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  ('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  ('two pair', ['9h', '9d', '4c', '4s', '2h'], 'two pair'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], 'high card')],\n [('wheel straight flush', ['As', '2s', '3s', '4s', '5s'], 'straight flush'),\n  ('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\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  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], 'high card'),\n  ('high card', ['2h', '7d', '9c', 'Js', 'Kh'], 'high card'),\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":"2c92266d1169eb067d9e374cc130b7018568096fc42162cd4cbb6320c08f7512","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=suits.count(suits[0])>=4\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  ('plain flush', ['2h', '7h', '9h', 'Jh', 'Kh'], 'flush'),\n  ('full house', ['7h', '7d', '7c', 'Ks', 'Kh'], 'full house'),\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 [('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  ('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  ('straight flush middle', ['5d', '6d', '7d', '8d', '9d'], 'straight flush'),\n  ('ten flush with 10 token', ['10c', '2c', '5c', '8c', 'Qc'], 'flush')],\n [('wheel straight', ['Ah', '2d', '3c', '4s', '5h'], 'straight'),\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  ('broadway', ['Th', 'Jd', 'Qc', 'Ks', 'Ah'], 'straight'),\n  ('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\n  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], '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 [('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  ('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  ('two pair', ['9h', '9d', '4c', '4s', '2h'], 'two pair'),\n  ('ten written as 10', ['10h', 'Jd', 'Qc', 'Ks', '9h'], 'straight'),\n  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], 'high card')],\n [('wheel straight flush', ['As', '2s', '3s', '4s', '5s'], 'straight flush'),\n  ('trips', ['7h', '7d', '7c', 'Ks', '2h'], 'three of a kind'),\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  ('four-flush only', ['2h', '7h', '9h', 'Jh', 'Ks'], 'high card'),\n  ('high card', ['2h', '7d', '9c', 'Js', 'Kh'], 'high card'),\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-flush-suit-agreement","generated_at":"2026-09-29T14:50:06.971356+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 flush test counts at least four cards of the first suit, the threshold of a flush draw rather than a made flush.","sha256":"7aebbdf0adbbf4ba30596373a8a5525427be73f14fede2a89eb650b4af014a17","title":"Four-flush draw counted as a made flush · 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":41.083,"exit_code":1,"observations":[{"actual":"straight flush","check":"wheel straight","expected":"straight","passed":false},{"actual":"straight flush","check":"wheel straight flush","expected":"straight flush","passed":true},{"actual":"flush","check":"four to wheel plus nine","expected":"high card","passed":false},{"actual":"flush","check":"plain flush","expected":"flush","passed":true},{"actual":"full house","check":"full house","expected":"full house","passed":true},{"actual":"two pair","check":"lower-case ranks","expected":"two pair","passed":true},{"actual":"flush","check":"mixed-case suits flush","expected":"flush","passed":true},{"actual":"high card","check":"four-flush only","expected":"high card","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"wheel straight\", \"actual\": \"straight flush\", \"expected\": \"straight\", \"passed\": false}, {\"check\": \"wheel straight flush\", \"actual\": \"straight flush\", \"expected\": \"straight flush\", \"passed\": true}, {\"check\": \"four to wheel plus nine\", \"actual\": \"flush\", \"expected\": \"high card\", \"passed\": false}, {\"check\": \"plain flush\", \"actual\": \"flush\", \"expected\": \"flush\", \"passed\": true}, {\"check\": \"full house\", \"actual\": \"full house\", \"expected\": \"full house\", \"passed\": true}, {\"check\": \"lower-case ranks\", \"actual\": \"two pair\", \"expected\": \"two pair\", \"passed\": true}, {\"check\": \"mixed-case suits flush\", \"actual\": \"flush\", \"expected\": \"flush\", \"passed\": true}, {\"check\": \"four-flush only\", \"actual\": \"high card\", \"expected\": \"high card\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.324,"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":"flush","check":"plain flush","expected":"flush","passed":true},{"actual":"full house","check":"full house","expected":"full house","passed":true},{"actual":"two pair","check":"lower-case ranks","expected":"two pair","passed":true},{"actual":"flush","check":"mixed-case suits flush","expected":"flush","passed":true},{"actual":"flush","check":"four-flush only","expected":"high card","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\": \"plain flush\", \"actual\": \"flush\", \"expected\": \"flush\", \"passed\": true}, {\"check\": \"full house\", \"actual\": \"full house\", \"expected\": \"full house\", \"passed\": true}, {\"check\": \"lower-case ranks\", \"actual\": \"two pair\", \"expected\": \"two pair\", \"passed\": true}, {\"check\": \"mixed-case suits flush\", \"actual\": \"flush\", \"expected\": \"flush\", \"passed\": true}, {\"check\": \"four-flush only\", \"actual\": \"flush\", \"expected\": \"high card\", \"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."}}