{"abstract":"When the board plays, the hand is annotated as using both hole cards.","category":"Poker hand evaluation","checks":8,"contract":"Input: {\"hole\": two cards, \"board\": five cards}. Return the minimum number of hole cards (0, 1 or 2) needed to make the player's best possible five-card hand; 0 means the board plays.","contract_signature":"x","evaluation_group":"w2-poker_hand_evaluation-hole-cards-played","failed_approach":"Starting from one hole card never reports that the board plays.","family":"w2-poker_hand_evaluation-hole-cards-played-minimal-usage-search-order","id":"FA-82331","implementations":{"attempt":{"sha256":"b81a5c9f84e31b54d9929f0d5280d80c776a067efbfedc96d8e49ac072a27c85","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport collections\nimport itertools\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'\n    def key5(h):\n        vals=sorted((R.index(c[0])+2 for c in h), reverse=True)\n        cnt=collections.Counter(vals)\n        order=sorted(cnt, key=lambda v:(cnt[v],v), reverse=True)\n        shape=sorted(cnt.values(), reverse=True)\n        flush=len({c[1] for c in h})==1\n        straight=len(cnt)==5 and (vals[0]-vals[4]==4 or vals==[14,5,4,3,2])\n        top=5 if vals==[14,5,4,3,2] else vals[0]\n        if straight: return (8 if flush else 4, [top])\n        if flush: return (5, vals)\n        return ({(4,1):7,(3,2):6,(3,1,1):3,(2,2,1):2,(2,1,1,1):1}.get(tuple(shape),0), order)\n    hole=x['hole']; board=x['board']\n    best=max(key5(c) for c in itertools.combinations(hole+board,5))\n    for n in range(1,3):\n        for hc in itertools.combinations(hole,n):\n            for bc in itertools.combinations(board,5-n):\n                if key5(hc+bc)==best: return n\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('board straight plays', {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '3d']}, 0),\n  ('one card kicker', {'board': ['9h', '9d', '7c', '6s', '2h'], 'hole': ['Ac', '3d']}, 1),\n  ('hole ranks duplicate board straight',\n   {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['9c', 'Ts']}, 0),\n  ('second hole card redundant', {'board': ['Kh', 'Kd', '9c', '7s', '5h'], 'hole': ['9d', '7d']},\n   1),\n  ('wheel with both', {'board': ['9h', '9d', '5c', '4s', '2h'], 'hole': ['Ac', '3d']}, 2),\n  ('both cards pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['Kc', 'Qd']}, 2),\n  ('pocket pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['8c', '8d']}, 2),\n  ('same category better kicker', {'board': ['Ah', 'Ad', '9c', '7s', '5h'], 'hole': ['Jc', '2d']},\n   1)],\n [('hole ranks duplicate board straight',\n   {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['9c', 'Ts']}, 0),\n  ('second hole card redundant', {'board': ['Kh', 'Kd', '9c', '7s', '5h'], 'hole': ['9d', '7d']},\n   1),\n  ('pocket pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['8c', '8d']}, 2),\n  ('low kicker does not play', {'board': ['Ah', 'Kd', '9c', '7s', '5h'], 'hole': ['2c', '3d']}, 0),\n  ('same category better kicker', {'board': ['Ah', 'Ad', '9c', '7s', '5h'], 'hole': ['Jc', '2d']},\n   1),\n  ('flush with one card', {'board': ['3h', '7h', '9h', 'Jh', 'Kd'], 'hole': ['Ah', '2c']}, 1),\n  ('improved board flush', {'board': ['4h', '7h', '9h', 'Jh', 'Kh'], 'hole': ['Ah', '3d']}, 1),\n  ('quads on board kicker', {'board': ['9h', '9d', '9c', '9s', 'Kh'], 'hole': ['Ac', '2d']}, 1)],\n [('board straight plays', {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '3d']}, 0),\n  ('one card kicker', {'board': ['9h', '9d', '7c', '6s', '2h'], 'hole': ['Ac', '3d']}, 1),\n  ('hole ranks duplicate board straight',\n   {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['9c', 'Ts']}, 0),\n  ('second hole card redundant', {'board': ['Kh', 'Kd', '9c', '7s', '5h'], 'hole': ['9d', '7d']},\n   1),\n  ('low kicker does not play', {'board': ['Ah', 'Kd', '9c', '7s', '5h'], 'hole': ['2c', '3d']}, 0),\n  ('board flush plays', {'board': ['4h', '7h', '9h', 'Jh', 'Kh'], 'hole': ['2c', '3d']}, 0),\n  ('improved board flush', {'board': ['4h', '7h', '9h', 'Jh', 'Kh'], 'hole': ['Ah', '3d']}, 1),\n  ('quads on board kicker', {'board': ['9h', '9d', '9c', '9s', 'Kh'], 'hole': ['Ac', '2d']}, 1)],\n [('board straight plays', {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '3d']}, 0),\n  ('one card kicker', {'board': ['9h', '9d', '7c', '6s', '2h'], 'hole': ['Ac', '3d']}, 1),\n  ('hole ranks duplicate board straight',\n   {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['9c', 'Ts']}, 0),\n  ('second hole card redundant', {'board': ['Kh', 'Kd', '9c', '7s', '5h'], 'hole': ['9d', '7d']},\n   1),\n  ('wheel with both', {'board': ['9h', '9d', '5c', '4s', '2h'], 'hole': ['Ac', '3d']}, 2),\n  ('both cards pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['Kc', 'Qd']}, 2),\n  ('low kicker does not play', {'board': ['Ah', 'Kd', '9c', '7s', '5h'], 'hole': ['2c', '3d']}, 0),\n  ('board flush plays', {'board': ['4h', '7h', '9h', 'Jh', 'Kh'], 'hole': ['2c', '3d']}, 0)],\n [('board straight plays', {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '3d']}, 0),\n  ('one card kicker', {'board': ['9h', '9d', '7c', '6s', '2h'], 'hole': ['Ac', '3d']}, 1),\n  ('hole ranks duplicate board straight',\n   {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['9c', 'Ts']}, 0),\n  ('second hole card redundant', {'board': ['Kh', 'Kd', '9c', '7s', '5h'], 'hole': ['9d', '7d']},\n   1),\n  ('wheel with both', {'board': ['9h', '9d', '5c', '4s', '2h'], 'hole': ['Ac', '3d']}, 2),\n  ('both cards pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['Kc', 'Qd']}, 2),\n  ('pocket pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['8c', '8d']}, 2),\n  ('board flush plays', {'board': ['4h', '7h', '9h', 'Jh', 'Kh'], 'hole': ['2c', '3d']}, 0)]]\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":"75c4384f73a6c8b1c3cdc23be7fe098c091dc55e91f47b1e88462282f032dd82","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\nimport collections\nimport itertools\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'\n    def key5(h):\n        vals=sorted((R.index(c[0])+2 for c in h), reverse=True)\n        cnt=collections.Counter(vals)\n        order=sorted(cnt, key=lambda v:(cnt[v],v), reverse=True)\n        shape=sorted(cnt.values(), reverse=True)\n        flush=len({c[1] for c in h})==1\n        straight=len(cnt)==5 and (vals[0]-vals[4]==4 or vals==[14,5,4,3,2])\n        top=5 if vals==[14,5,4,3,2] else vals[0]\n        if straight: return (8 if flush else 4, [top])\n        if flush: return (5, vals)\n        return ({(4,1):7,(3,2):6,(3,1,1):3,(2,2,1):2,(2,1,1,1):1}.get(tuple(shape),0), order)\n    hole=x['hole']; board=x['board']\n    best=max(key5(c) for c in itertools.combinations(hole+board,5))\n    for n in range(2,-1,-1):\n        for hc in itertools.combinations(hole,n):\n            for bc in itertools.combinations(board,5-n):\n                if key5(hc+bc)==best: return n\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('board straight plays', {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '3d']}, 0),\n  ('one card kicker', {'board': ['9h', '9d', '7c', '6s', '2h'], 'hole': ['Ac', '3d']}, 1),\n  ('hole ranks duplicate board straight',\n   {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['9c', 'Ts']}, 0),\n  ('second hole card redundant', {'board': ['Kh', 'Kd', '9c', '7s', '5h'], 'hole': ['9d', '7d']},\n   1),\n  ('wheel with both', {'board': ['9h', '9d', '5c', '4s', '2h'], 'hole': ['Ac', '3d']}, 2),\n  ('both cards pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['Kc', 'Qd']}, 2),\n  ('pocket pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['8c', '8d']}, 2),\n  ('same category better kicker', {'board': ['Ah', 'Ad', '9c', '7s', '5h'], 'hole': ['Jc', '2d']},\n   1)],\n [('hole ranks duplicate board straight',\n   {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['9c', 'Ts']}, 0),\n  ('second hole card redundant', {'board': ['Kh', 'Kd', '9c', '7s', '5h'], 'hole': ['9d', '7d']},\n   1),\n  ('pocket pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['8c', '8d']}, 2),\n  ('low kicker does not play', {'board': ['Ah', 'Kd', '9c', '7s', '5h'], 'hole': ['2c', '3d']}, 0),\n  ('same category better kicker', {'board': ['Ah', 'Ad', '9c', '7s', '5h'], 'hole': ['Jc', '2d']},\n   1),\n  ('flush with one card', {'board': ['3h', '7h', '9h', 'Jh', 'Kd'], 'hole': ['Ah', '2c']}, 1),\n  ('improved board flush', {'board': ['4h', '7h', '9h', 'Jh', 'Kh'], 'hole': ['Ah', '3d']}, 1),\n  ('quads on board kicker', {'board': ['9h', '9d', '9c', '9s', 'Kh'], 'hole': ['Ac', '2d']}, 1)],\n [('board straight plays', {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '3d']}, 0),\n  ('one card kicker', {'board': ['9h', '9d', '7c', '6s', '2h'], 'hole': ['Ac', '3d']}, 1),\n  ('hole ranks duplicate board straight',\n   {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['9c', 'Ts']}, 0),\n  ('second hole card redundant', {'board': ['Kh', 'Kd', '9c', '7s', '5h'], 'hole': ['9d', '7d']},\n   1),\n  ('low kicker does not play', {'board': ['Ah', 'Kd', '9c', '7s', '5h'], 'hole': ['2c', '3d']}, 0),\n  ('board flush plays', {'board': ['4h', '7h', '9h', 'Jh', 'Kh'], 'hole': ['2c', '3d']}, 0),\n  ('improved board flush', {'board': ['4h', '7h', '9h', 'Jh', 'Kh'], 'hole': ['Ah', '3d']}, 1),\n  ('quads on board kicker', {'board': ['9h', '9d', '9c', '9s', 'Kh'], 'hole': ['Ac', '2d']}, 1)],\n [('board straight plays', {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '3d']}, 0),\n  ('one card kicker', {'board': ['9h', '9d', '7c', '6s', '2h'], 'hole': ['Ac', '3d']}, 1),\n  ('hole ranks duplicate board straight',\n   {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['9c', 'Ts']}, 0),\n  ('second hole card redundant', {'board': ['Kh', 'Kd', '9c', '7s', '5h'], 'hole': ['9d', '7d']},\n   1),\n  ('wheel with both', {'board': ['9h', '9d', '5c', '4s', '2h'], 'hole': ['Ac', '3d']}, 2),\n  ('both cards pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['Kc', 'Qd']}, 2),\n  ('low kicker does not play', {'board': ['Ah', 'Kd', '9c', '7s', '5h'], 'hole': ['2c', '3d']}, 0),\n  ('board flush plays', {'board': ['4h', '7h', '9h', 'Jh', 'Kh'], 'hole': ['2c', '3d']}, 0)],\n [('board straight plays', {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['2c', '3d']}, 0),\n  ('one card kicker', {'board': ['9h', '9d', '7c', '6s', '2h'], 'hole': ['Ac', '3d']}, 1),\n  ('hole ranks duplicate board straight',\n   {'board': ['9h', 'Td', 'Jc', 'Qs', 'Kh'], 'hole': ['9c', 'Ts']}, 0),\n  ('second hole card redundant', {'board': ['Kh', 'Kd', '9c', '7s', '5h'], 'hole': ['9d', '7d']},\n   1),\n  ('wheel with both', {'board': ['9h', '9d', '5c', '4s', '2h'], 'hole': ['Ac', '3d']}, 2),\n  ('both cards pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['Kc', 'Qd']}, 2),\n  ('pocket pair', {'board': ['Kh', 'Qs', '5c', '4s', '2h'], 'hole': ['8c', '8d']}, 2),\n  ('board flush plays', {'board': ['4h', '7h', '9h', 'Jh', 'Kh'], 'hole': ['2c', '3d']}, 0)]]\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\"); 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-hole-cards-played-minimal-usage-search-order","generated_at":"2026-09-29T14:50:11.204130+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"\"Board plays\" detection drives split-pot explanations and hand-history annotations.","root_cause":"The search tries two hole cards first and returns the first matching count.","sha256":"22c09d733380d6470a2d892d08ee1ef564fb011989407f0bddbd403a1f5efa22","title":"Reports the most hole cards that can play · 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":43.351,"exit_code":1,"observations":[{"actual":null,"check":"board straight plays","expected":0,"passed":false},{"actual":1,"check":"one card kicker","expected":1,"passed":true},{"actual":1,"check":"hole ranks duplicate board straight","expected":0,"passed":false},{"actual":1,"check":"second hole card redundant","expected":1,"passed":true},{"actual":2,"check":"wheel with both","expected":2,"passed":true},{"actual":2,"check":"both cards pair","expected":2,"passed":true},{"actual":2,"check":"pocket pair","expected":2,"passed":true},{"actual":1,"check":"same category better kicker","expected":1,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"board straight plays\", \"actual\": null, \"expected\": 0, \"passed\": false}, {\"check\": \"one card kicker\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"hole ranks duplicate board straight\", \"actual\": 1, \"expected\": 0, \"passed\": false}, {\"check\": \"second hole card redundant\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"wheel with both\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"both cards pair\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"pocket pair\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"same category better kicker\", \"actual\": 1, \"expected\": 1, \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":90.991,"exit_code":1,"observations":[{"actual":0,"check":"board straight plays","expected":0,"passed":true},{"actual":1,"check":"one card kicker","expected":1,"passed":true},{"actual":2,"check":"hole ranks duplicate board straight","expected":0,"passed":false},{"actual":2,"check":"second hole card redundant","expected":1,"passed":false},{"actual":2,"check":"wheel with both","expected":2,"passed":true},{"actual":2,"check":"both cards pair","expected":2,"passed":true},{"actual":2,"check":"pocket pair","expected":2,"passed":true},{"actual":1,"check":"same category better kicker","expected":1,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"board straight plays\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"one card kicker\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"hole ranks duplicate board straight\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"second hole card redundant\", \"actual\": 2, \"expected\": 1, \"passed\": false}, {\"check\": \"wheel with both\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"both cards pair\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"pocket pair\", \"actual\": 2, \"expected\": 2, \"passed\": true}, {\"check\": \"same category better kicker\", \"actual\": 1, \"expected\": 1, \"passed\": true}], \"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."}}