{"abstract":"Players at 21 can still draw.","category":"Card game rule engines","checks":8,"contract":"Input [cards, splits_so_far, from_split_aces, double_after_split]. Split-ace hands may only stand. A total >= 21 may only stand. Otherwise hit; double on two cards if no split yet or DAS allowed; split two cards of equal value if fewer than 3 splits so far; surrender on two cards with no split. Return the action list.","evaluation_group":"w2-card-game-rule-engines-bj-actions","failed_approach":"Stopping 21 only on two-card hands lets multi-card 21s keep hitting.","family":"w2-card-game-rule-engines-bj-actions-twenty-one-stops-play","id":"FA-83731","implementations":{"attempt":{"sha256":"81426f32df88f7f0f4c7a13e3943a76e33c372814ba41dfe3dc5b058683bacab","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cards, splits, from_aces, das = x\n    def v(c):\n        return 10 if c[0] in 'TJQK' else 11 if c[0] == 'A' else int(c[0])\n    acts = ['stand']\n    if from_aces:\n        return acts\n    total = 0\n    aces = 0\n    for c in cards:\n        total += v(c)\n        aces += c[0] == 'A'\n    while total > 21 and aces:\n        total -= 10\n        aces -= 1\n    if total >= 21 and len(cards) == 2:\n        return acts\n    acts.append('hit')\n    two = len(cards) == 2\n    if two and (splits == 0 or das):\n        acts.append('double')\n    if two and v(cards[0]) == v(cards[1]) and splits < 3:\n        acts.append('split')\n    if two and splits == 0:\n        acts.append('surrender')\n    return acts\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['AD', 'QS'], 0, False, False], ['stand']], [[['8C', 'TD'], 0, False, True], ['stand', 'hit', 'double', 'surrender']], [[['9S', '3C', 'QC'], 1, False, True], ['stand']], [[['8H', '8C', 'KC'], 1, False, False], ['stand']], [[['5H', '6C'], 2, True, True], ['stand']], [[['9S', 'QD', '2H', '4C'], 1, True, True], ['stand']], [[['6D', '6C', '3C'], 0, False, False], ['stand', 'hit']], [[['5D', '5C', '6C', 'TC'], 2, False, False], ['stand']]], [[[['2S', '8S'], 1, False, False], ['stand', 'hit']], [[['TD', 'TD', '7D', '6S'], 0, True, True], ['stand']], [[['3S', '3C'], 3, True, True], ['stand']], [[['AC', '6S', 'TC', 'KH'], 1, False, False], ['stand']], [[['QH', 'TS'], 2, False, False], ['stand', 'hit', 'split']], [[['4H', '2D'], 0, False, False], ['stand', 'hit', 'double', 'surrender']], [[['JH', '6S', 'TH'], 3, False, False], ['stand']], [[['3S', '9S', '9D'], 3, False, False], ['stand']]], [[[['KD', '3D'], 3, False, False], ['stand', 'hit']], [[['3H', '7S'], 2, False, True], ['stand', 'hit', 'double']], [[['6S', '6H'], 2, True, True], ['stand']], [[['QD', 'QS', 'TC'], 0, False, True], ['stand']], [[['JC', 'JS'], 1, False, True], ['stand', 'hit', 'double', 'split']], [[['JH', 'JC'], 1, False, False], ['stand', 'hit', 'split']], [[['4H', 'AD', 'QC', 'JC'], 3, False, True], ['stand']], [[['KS', 'AC'], 2, False, True], ['stand']]], [[[['5D', '5C', '9S', '6C'], 0, False, False], ['stand']], [[['4S', '4D', 'TH'], 2, True, True], ['stand']], [[['5D', '5C', '6C', 'TC'], 2, False, False], ['stand']], [[['4H', '4C'], 0, False, True], ['stand', 'hit', 'double', 'split', 'surrender']], [[['3S', 'JS', 'QC', '2S'], 0, False, True], ['stand']], [[['8H', '6S', '9H', '8C'], 0, True, True], ['stand']], [[['KD', 'KD', 'JH', '6C'], 0, False, False], ['stand']], [[['9S', 'TH', '2D'], 0, False, True], ['stand']]], [[[['6C', '4C'], 3, False, True], ['stand', 'hit', 'double']], [[['2C', 'QD'], 0, False, True], ['stand', 'hit', 'double', 'surrender']], [[['3H', '8S'], 1, False, True], ['stand', 'hit', 'double']], [[['3C', '3D'], 0, True, True], ['stand']], [[['6S', 'KH'], 0, False, False], ['stand', 'hit', 'double', 'surrender']], [[['5H', '5C', 'JD', '4D'], 1, True, False], ['stand']], [[['JH', 'JD', 'AS'], 0, False, True], ['stand']], [[['QC', 'QH', 'TH', '8H'], 0, False, False], ['stand']]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"actions case %d\" % i, solve(args), 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":"fab3367241bbba3729ba4291d4fc82f23f3bede1d6597146139e738a1d27be69","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cards, splits, from_aces, das = x\n    def v(c):\n        return 10 if c[0] in 'TJQK' else 11 if c[0] == 'A' else int(c[0])\n    acts = ['stand']\n    if from_aces:\n        return acts\n    total = 0\n    aces = 0\n    for c in cards:\n        total += v(c)\n        aces += c[0] == 'A'\n    while total > 21 and aces:\n        total -= 10\n        aces -= 1\n    if total > 21:\n        return acts\n    acts.append('hit')\n    two = len(cards) == 2\n    if two and (splits == 0 or das):\n        acts.append('double')\n    if two and v(cards[0]) == v(cards[1]) and splits < 3:\n        acts.append('split')\n    if two and splits == 0:\n        acts.append('surrender')\n    return acts\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['AD', 'QS'], 0, False, False], ['stand']], [[['8C', 'TD'], 0, False, True], ['stand', 'hit', 'double', 'surrender']], [[['9S', '3C', 'QC'], 1, False, True], ['stand']], [[['8H', '8C', 'KC'], 1, False, False], ['stand']], [[['5H', '6C'], 2, True, True], ['stand']], [[['9S', 'QD', '2H', '4C'], 1, True, True], ['stand']], [[['6D', '6C', '3C'], 0, False, False], ['stand', 'hit']], [[['5D', '5C', '6C', 'TC'], 2, False, False], ['stand']]], [[[['2S', '8S'], 1, False, False], ['stand', 'hit']], [[['TD', 'TD', '7D', '6S'], 0, True, True], ['stand']], [[['3S', '3C'], 3, True, True], ['stand']], [[['AC', '6S', 'TC', 'KH'], 1, False, False], ['stand']], [[['QH', 'TS'], 2, False, False], ['stand', 'hit', 'split']], [[['4H', '2D'], 0, False, False], ['stand', 'hit', 'double', 'surrender']], [[['JH', '6S', 'TH'], 3, False, False], ['stand']], [[['3S', '9S', '9D'], 3, False, False], ['stand']]], [[[['KD', '3D'], 3, False, False], ['stand', 'hit']], [[['3H', '7S'], 2, False, True], ['stand', 'hit', 'double']], [[['6S', '6H'], 2, True, True], ['stand']], [[['QD', 'QS', 'TC'], 0, False, True], ['stand']], [[['JC', 'JS'], 1, False, True], ['stand', 'hit', 'double', 'split']], [[['JH', 'JC'], 1, False, False], ['stand', 'hit', 'split']], [[['4H', 'AD', 'QC', 'JC'], 3, False, True], ['stand']], [[['KS', 'AC'], 2, False, True], ['stand']]], [[[['5D', '5C', '9S', '6C'], 0, False, False], ['stand']], [[['4S', '4D', 'TH'], 2, True, True], ['stand']], [[['5D', '5C', '6C', 'TC'], 2, False, False], ['stand']], [[['4H', '4C'], 0, False, True], ['stand', 'hit', 'double', 'split', 'surrender']], [[['3S', 'JS', 'QC', '2S'], 0, False, True], ['stand']], [[['8H', '6S', '9H', '8C'], 0, True, True], ['stand']], [[['KD', 'KD', 'JH', '6C'], 0, False, False], ['stand']], [[['9S', 'TH', '2D'], 0, False, True], ['stand']]], [[[['6C', '4C'], 3, False, True], ['stand', 'hit', 'double']], [[['2C', 'QD'], 0, False, True], ['stand', 'hit', 'double', 'surrender']], [[['3H', '8S'], 1, False, True], ['stand', 'hit', 'double']], [[['3C', '3D'], 0, True, True], ['stand']], [[['6S', 'KH'], 0, False, False], ['stand', 'hit', 'double', 'surrender']], [[['5H', '5C', 'JD', '4D'], 1, True, False], ['stand']], [[['JH', 'JD', 'AS'], 0, False, True], ['stand']], [[['QC', 'QH', 'TH', '8H'], 0, False, False], ['stand']]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"actions case %d\" % i, solve(args), 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":"3e509d5a264648e9e8d6e5205278dc21f8d96cc3565c3b22fa2f28240f472908","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cards, splits, from_aces, das = x\n    def v(c):\n        return 10 if c[0] in 'TJQK' else 11 if c[0] == 'A' else int(c[0])\n    acts = ['stand']\n    if from_aces:\n        return acts\n    total = 0\n    aces = 0\n    for c in cards:\n        total += v(c)\n        aces += c[0] == 'A'\n    while total > 21 and aces:\n        total -= 10\n        aces -= 1\n    if total >= 21:\n        return acts\n    acts.append('hit')\n    two = len(cards) == 2\n    if two and (splits == 0 or das):\n        acts.append('double')\n    if two and v(cards[0]) == v(cards[1]) and splits < 3:\n        acts.append('split')\n    if two and splits == 0:\n        acts.append('surrender')\n    return acts\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['AD', 'QS'], 0, False, False], ['stand']], [[['8C', 'TD'], 0, False, True], ['stand', 'hit', 'double', 'surrender']], [[['9S', '3C', 'QC'], 1, False, True], ['stand']], [[['8H', '8C', 'KC'], 1, False, False], ['stand']], [[['5H', '6C'], 2, True, True], ['stand']], [[['9S', 'QD', '2H', '4C'], 1, True, True], ['stand']], [[['6D', '6C', '3C'], 0, False, False], ['stand', 'hit']], [[['5D', '5C', '6C', 'TC'], 2, False, False], ['stand']]], [[[['2S', '8S'], 1, False, False], ['stand', 'hit']], [[['TD', 'TD', '7D', '6S'], 0, True, True], ['stand']], [[['3S', '3C'], 3, True, True], ['stand']], [[['AC', '6S', 'TC', 'KH'], 1, False, False], ['stand']], [[['QH', 'TS'], 2, False, False], ['stand', 'hit', 'split']], [[['4H', '2D'], 0, False, False], ['stand', 'hit', 'double', 'surrender']], [[['JH', '6S', 'TH'], 3, False, False], ['stand']], [[['3S', '9S', '9D'], 3, False, False], ['stand']]], [[[['KD', '3D'], 3, False, False], ['stand', 'hit']], [[['3H', '7S'], 2, False, True], ['stand', 'hit', 'double']], [[['6S', '6H'], 2, True, True], ['stand']], [[['QD', 'QS', 'TC'], 0, False, True], ['stand']], [[['JC', 'JS'], 1, False, True], ['stand', 'hit', 'double', 'split']], [[['JH', 'JC'], 1, False, False], ['stand', 'hit', 'split']], [[['4H', 'AD', 'QC', 'JC'], 3, False, True], ['stand']], [[['KS', 'AC'], 2, False, True], ['stand']]], [[[['5D', '5C', '9S', '6C'], 0, False, False], ['stand']], [[['4S', '4D', 'TH'], 2, True, True], ['stand']], [[['5D', '5C', '6C', 'TC'], 2, False, False], ['stand']], [[['4H', '4C'], 0, False, True], ['stand', 'hit', 'double', 'split', 'surrender']], [[['3S', 'JS', 'QC', '2S'], 0, False, True], ['stand']], [[['8H', '6S', '9H', '8C'], 0, True, True], ['stand']], [[['KD', 'KD', 'JH', '6C'], 0, False, False], ['stand']], [[['9S', 'TH', '2D'], 0, False, True], ['stand']]], [[[['6C', '4C'], 3, False, True], ['stand', 'hit', 'double']], [[['2C', 'QD'], 0, False, True], ['stand', 'hit', 'double', 'surrender']], [[['3H', '8S'], 1, False, True], ['stand', 'hit', 'double']], [[['3C', '3D'], 0, True, True], ['stand']], [[['6S', 'KH'], 0, False, False], ['stand', 'hit', 'double', 'surrender']], [[['5H', '5C', 'JD', '4D'], 1, True, False], ['stand']], [[['JH', 'JD', 'AS'], 0, False, True], ['stand']], [[['QC', 'QH', 'TH', '8H'], 0, False, False], ['stand']]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"actions case %d\" % i, solve(args), 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 bounded toy rule contract stated explicitly in the contract field; cards are two-character codes (rank, suit). Not a complete implementation of any published rulebook or casino table rules. 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-card-game-rule-engines-bj-actions-twenty-one-stops-play","generated_at":"2026-09-29T14:50:24.403714+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Card-game engines, scoring apps and online tables apply this rule automatically on every hand.","repair":"At 21 or more the only action is stand.","root_cause":"The stop test uses > 21.","sha256":"d4a67d5a5edab5216be96d33376b592a9b37de4c01d4937097b3c91d4d0aaca7","title":"A hand totalling 21 is offered hit · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":42.755,"exit_code":1,"observations":[{"actual":["stand"],"check":"actions case 0","expected":["stand"],"passed":true},{"actual":["stand","hit","double","surrender"],"check":"actions case 1","expected":["stand","hit","double","surrender"],"passed":true},{"actual":["stand","hit"],"check":"actions case 2","expected":["stand"],"passed":false},{"actual":["stand","hit"],"check":"actions case 3","expected":["stand"],"passed":false},{"actual":["stand"],"check":"actions case 4","expected":["stand"],"passed":true},{"actual":["stand"],"check":"actions case 5","expected":["stand"],"passed":true},{"actual":["stand","hit"],"check":"actions case 6","expected":["stand","hit"],"passed":true},{"actual":["stand","hit"],"check":"actions case 7","expected":["stand"],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"actions case 0\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 1\", \"actual\": [\"stand\", \"hit\", \"double\", \"surrender\"], \"expected\": [\"stand\", \"hit\", \"double\", \"surrender\"], \"passed\": true}, {\"check\": \"actions case 2\", \"actual\": [\"stand\", \"hit\"], \"expected\": [\"stand\"], \"passed\": false}, {\"check\": \"actions case 3\", \"actual\": [\"stand\", \"hit\"], \"expected\": [\"stand\"], \"passed\": false}, {\"check\": \"actions case 4\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 5\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 6\", \"actual\": [\"stand\", \"hit\"], \"expected\": [\"stand\", \"hit\"], \"passed\": true}, {\"check\": \"actions case 7\", \"actual\": [\"stand\", \"hit\"], \"expected\": [\"stand\"], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":43.397,"exit_code":1,"observations":[{"actual":["stand","hit","double","surrender"],"check":"actions case 0","expected":["stand"],"passed":false},{"actual":["stand","hit","double","surrender"],"check":"actions case 1","expected":["stand","hit","double","surrender"],"passed":true},{"actual":["stand"],"check":"actions case 2","expected":["stand"],"passed":true},{"actual":["stand"],"check":"actions case 3","expected":["stand"],"passed":true},{"actual":["stand"],"check":"actions case 4","expected":["stand"],"passed":true},{"actual":["stand"],"check":"actions case 5","expected":["stand"],"passed":true},{"actual":["stand","hit"],"check":"actions case 6","expected":["stand","hit"],"passed":true},{"actual":["stand"],"check":"actions case 7","expected":["stand"],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"actions case 0\", \"actual\": [\"stand\", \"hit\", \"double\", \"surrender\"], \"expected\": [\"stand\"], \"passed\": false}, {\"check\": \"actions case 1\", \"actual\": [\"stand\", \"hit\", \"double\", \"surrender\"], \"expected\": [\"stand\", \"hit\", \"double\", \"surrender\"], \"passed\": true}, {\"check\": \"actions case 2\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 3\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 4\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 5\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 6\", \"actual\": [\"stand\", \"hit\"], \"expected\": [\"stand\", \"hit\"], \"passed\": true}, {\"check\": \"actions case 7\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.538,"exit_code":0,"observations":[{"actual":["stand"],"check":"actions case 0","expected":["stand"],"passed":true},{"actual":["stand","hit","double","surrender"],"check":"actions case 1","expected":["stand","hit","double","surrender"],"passed":true},{"actual":["stand"],"check":"actions case 2","expected":["stand"],"passed":true},{"actual":["stand"],"check":"actions case 3","expected":["stand"],"passed":true},{"actual":["stand"],"check":"actions case 4","expected":["stand"],"passed":true},{"actual":["stand"],"check":"actions case 5","expected":["stand"],"passed":true},{"actual":["stand","hit"],"check":"actions case 6","expected":["stand","hit"],"passed":true},{"actual":["stand"],"check":"actions case 7","expected":["stand"],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"actions case 0\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 1\", \"actual\": [\"stand\", \"hit\", \"double\", \"surrender\"], \"expected\": [\"stand\", \"hit\", \"double\", \"surrender\"], \"passed\": true}, {\"check\": \"actions case 2\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 3\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 4\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 5\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}, {\"check\": \"actions case 6\", \"actual\": [\"stand\", \"hit\"], \"expected\": [\"stand\", \"hit\"], \"passed\": true}, {\"check\": \"actions case 7\", \"actual\": [\"stand\"], \"expected\": [\"stand\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}