{"abstract":"Player takes a third card on 6.","category":"Card game rule engines","checks":8,"contract":"Input [player_cards, banker_cards, next_shoe_cards]. Values A=1, 2-9 pip, T/J/Q/K 0; totals mod 10. A natural 8/9 on either side stops the coup. Player draws on 0-5. If player stood, banker draws on 0-5; otherwise banker draws on 0-2, on 3 unless the player third card is 8, on 4 vs 2-7, on 5 vs 4-7, on 6 vs 6-7. Return [player_total, banker_total, winner, cards_drawn].","contract_signature":"x","evaluation_group":"w2-card-game-rule-engines-baccarat-tableau","failed_approach":"Using < 5 makes the player stand on 5.","family":"w2-card-game-rule-engines-baccarat-tableau-player-standing-total","id":"FA-83691","implementations":{"attempt":{"sha256":"ae16862b89be5fafa54f3d09af5bec3c5cc2f6e671403ed9131c7b47213d2f73","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    p, b, shoe = x\n    def val(c):\n        r = c[0]\n        if r == 'A':\n            return 1\n        if r in 'TJQK':\n            return 0\n        return int(r)\n    def tot(h):\n        return sum(val(c) for c in h) % 10\n    p = list(p)\n    b = list(b)\n    k = 0\n    pt, bt = tot(p), tot(b)\n    if pt < 8 and bt < 8:\n        third = None\n        if pt < 5:\n            p.append(shoe[k])\n            k += 1\n            third = val(p[-1])\n        if third is None:\n            draw = bt <= 5\n        elif bt <= 2:\n            draw = True\n        elif bt == 3:\n            draw = third != 8\n        elif bt == 4:\n            draw = 2 <= third <= 7\n        elif bt == 5:\n            draw = 4 <= third <= 7\n        elif bt == 6:\n            draw = 6 <= third <= 7\n        else:\n            draw = False\n        if draw:\n            b.append(shoe[k])\n            k += 1\n    pt, bt = tot(p), tot(b)\n    winner = 'player' if pt > bt else 'banker' if bt > pt else 'tie'\n    return [pt, bt, winner, k]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['6S', 'TS'], ['7S', 'QS'], ['QC', 'KD']], [6, 7, 'banker', 0]], [[['JD', '4H'], ['QC', '8D'], ['TS', '7H']], [4, 8, 'banker', 0]], [[['2H', '8C'], ['7C', 'JS'], ['2C', '7D']], [2, 7, 'banker', 1]], [[['2C', '9D'], ['7C', 'JH'], ['2S', '8H']], [3, 7, 'banker', 1]], [[['5C', '3C'], ['TC', '5H'], ['AC', 'TH']], [8, 5, 'player', 0]], [[['7C', '2C'], ['6H', '3S'], ['AH', '5S']], [9, 9, 'tie', 0]], [[['KC', 'JD'], ['TC', 'TD'], ['AH', '4S']], [1, 4, 'banker', 2]], [[['AD', '4H'], ['8S', '3C'], ['JC', 'TC']], [5, 1, 'player', 2]]], [[[['6S', 'QD'], ['6C', '7D'], ['7S', '4D']], [6, 0, 'player', 1]], [[['7H', '3D'], ['JS', 'JH'], ['6H', 'AC']], [6, 1, 'player', 2]], [[['2S', '2C'], ['AS', '7D'], ['2H', '9H']], [4, 8, 'banker', 0]], [[['KC', '6H'], ['9D', 'QS'], ['2C', 'KD']], [6, 9, 'banker', 0]], [[['5S', '6C'], ['6S', '3S'], ['KC', 'KH']], [1, 9, 'banker', 0]], [[['9C', '2H'], ['JC', 'JS'], ['TH', 'QC']], [1, 0, 'player', 2]], [[['6S', 'QD'], ['8H', '9D'], ['3S', 'TD']], [6, 7, 'banker', 0]], [[['9D', '6D'], ['3C', 'JC'], ['QS', 'KC']], [5, 3, 'player', 2]]], [[[['4C', '5S'], ['6S', '4H'], ['QC', '3C']], [9, 0, 'player', 0]], [[['5H', '2C'], ['TD', '6C'], ['7S', 'KC']], [7, 6, 'player', 0]], [[['2C', '4D'], ['8D', '3H'], ['KS', '6C']], [6, 1, 'player', 1]], [[['6S', 'QD'], ['8H', '9D'], ['3S', 'TD']], [6, 7, 'banker', 0]], [[['3H', 'TD'], ['QS', '5C'], ['5D', 'AD']], [8, 6, 'player', 2]], [[['6S', 'JS'], ['4D', '6D'], ['2C', 'KD']], [6, 2, 'player', 1]], [[['AS', '5H'], ['6C', '8C'], ['7D', '9S']], [6, 1, 'player', 1]], [[['7D', '8D'], ['JH', 'KH'], ['QS', '3H']], [5, 3, 'player', 2]]], [[[['8D', 'TH'], ['QS', '9S'], ['3S', '9H']], [8, 9, 'banker', 0]], [[['AS', '5H'], ['5D', '9D'], ['7S', '5S']], [6, 1, 'player', 1]], [[['7C', 'JD'], ['2H', 'KC'], ['JS', 'AS']], [7, 2, 'player', 1]], [[['TH', '8C'], ['2C', '7H'], ['JH', '4D']], [8, 9, 'banker', 0]], [[['TC', '5D'], ['JC', '7S'], ['7C', '4C']], [2, 7, 'banker', 1]], [[['AS', '5H'], ['6C', '8C'], ['7D', '9S']], [6, 1, 'player', 1]], [[['6S', 'KH'], ['7C', '8C'], ['8S', 'AD']], [6, 3, 'player', 1]], [[['QC', '5S'], ['QS', '5H'], ['8S', 'JC']], [3, 5, 'banker', 1]]], [[[['5S', 'JS'], ['KH', 'TC'], ['4C', '9S']], [9, 9, 'tie', 2]], [[['9H', '9S'], ['TS', '4S'], ['TD', 'TC']], [8, 4, 'player', 0]], [[['9D', '9S'], ['2S', '6D'], ['6S', '4C']], [8, 8, 'tie', 0]], [[['2S', '9H'], ['7H', 'AS'], ['AH', '5H']], [1, 8, 'banker', 0]], [[['2C', '6H'], ['3D', 'TH'], ['QD', 'KS']], [8, 3, 'player', 0]], [[['2S', '2H'], ['3C', '9D'], ['KH', '6C']], [4, 8, 'banker', 2]], [[['TS', '6S'], ['TC', 'KD'], ['5H', 'AC']], [6, 5, 'player', 1]], [[['2H', '3D'], ['2C', 'TC'], ['9D', '8D']], [4, 0, 'player', 2]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"coup 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":"74d784dce476cfb89c200b0b92c79709afe8dcfe25f0c7b9f6b07e4aba9f8854","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    p, b, shoe = x\n    def val(c):\n        r = c[0]\n        if r == 'A':\n            return 1\n        if r in 'TJQK':\n            return 0\n        return int(r)\n    def tot(h):\n        return sum(val(c) for c in h) % 10\n    p = list(p)\n    b = list(b)\n    k = 0\n    pt, bt = tot(p), tot(b)\n    if pt < 8 and bt < 8:\n        third = None\n        if pt <= 6:\n            p.append(shoe[k])\n            k += 1\n            third = val(p[-1])\n        if third is None:\n            draw = bt <= 5\n        elif bt <= 2:\n            draw = True\n        elif bt == 3:\n            draw = third != 8\n        elif bt == 4:\n            draw = 2 <= third <= 7\n        elif bt == 5:\n            draw = 4 <= third <= 7\n        elif bt == 6:\n            draw = 6 <= third <= 7\n        else:\n            draw = False\n        if draw:\n            b.append(shoe[k])\n            k += 1\n    pt, bt = tot(p), tot(b)\n    winner = 'player' if pt > bt else 'banker' if bt > pt else 'tie'\n    return [pt, bt, winner, k]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['6S', 'TS'], ['7S', 'QS'], ['QC', 'KD']], [6, 7, 'banker', 0]], [[['JD', '4H'], ['QC', '8D'], ['TS', '7H']], [4, 8, 'banker', 0]], [[['2H', '8C'], ['7C', 'JS'], ['2C', '7D']], [2, 7, 'banker', 1]], [[['2C', '9D'], ['7C', 'JH'], ['2S', '8H']], [3, 7, 'banker', 1]], [[['5C', '3C'], ['TC', '5H'], ['AC', 'TH']], [8, 5, 'player', 0]], [[['7C', '2C'], ['6H', '3S'], ['AH', '5S']], [9, 9, 'tie', 0]], [[['KC', 'JD'], ['TC', 'TD'], ['AH', '4S']], [1, 4, 'banker', 2]], [[['AD', '4H'], ['8S', '3C'], ['JC', 'TC']], [5, 1, 'player', 2]]], [[[['6S', 'QD'], ['6C', '7D'], ['7S', '4D']], [6, 0, 'player', 1]], [[['7H', '3D'], ['JS', 'JH'], ['6H', 'AC']], [6, 1, 'player', 2]], [[['2S', '2C'], ['AS', '7D'], ['2H', '9H']], [4, 8, 'banker', 0]], [[['KC', '6H'], ['9D', 'QS'], ['2C', 'KD']], [6, 9, 'banker', 0]], [[['5S', '6C'], ['6S', '3S'], ['KC', 'KH']], [1, 9, 'banker', 0]], [[['9C', '2H'], ['JC', 'JS'], ['TH', 'QC']], [1, 0, 'player', 2]], [[['6S', 'QD'], ['8H', '9D'], ['3S', 'TD']], [6, 7, 'banker', 0]], [[['9D', '6D'], ['3C', 'JC'], ['QS', 'KC']], [5, 3, 'player', 2]]], [[[['4C', '5S'], ['6S', '4H'], ['QC', '3C']], [9, 0, 'player', 0]], [[['5H', '2C'], ['TD', '6C'], ['7S', 'KC']], [7, 6, 'player', 0]], [[['2C', '4D'], ['8D', '3H'], ['KS', '6C']], [6, 1, 'player', 1]], [[['6S', 'QD'], ['8H', '9D'], ['3S', 'TD']], [6, 7, 'banker', 0]], [[['3H', 'TD'], ['QS', '5C'], ['5D', 'AD']], [8, 6, 'player', 2]], [[['6S', 'JS'], ['4D', '6D'], ['2C', 'KD']], [6, 2, 'player', 1]], [[['AS', '5H'], ['6C', '8C'], ['7D', '9S']], [6, 1, 'player', 1]], [[['7D', '8D'], ['JH', 'KH'], ['QS', '3H']], [5, 3, 'player', 2]]], [[[['8D', 'TH'], ['QS', '9S'], ['3S', '9H']], [8, 9, 'banker', 0]], [[['AS', '5H'], ['5D', '9D'], ['7S', '5S']], [6, 1, 'player', 1]], [[['7C', 'JD'], ['2H', 'KC'], ['JS', 'AS']], [7, 2, 'player', 1]], [[['TH', '8C'], ['2C', '7H'], ['JH', '4D']], [8, 9, 'banker', 0]], [[['TC', '5D'], ['JC', '7S'], ['7C', '4C']], [2, 7, 'banker', 1]], [[['AS', '5H'], ['6C', '8C'], ['7D', '9S']], [6, 1, 'player', 1]], [[['6S', 'KH'], ['7C', '8C'], ['8S', 'AD']], [6, 3, 'player', 1]], [[['QC', '5S'], ['QS', '5H'], ['8S', 'JC']], [3, 5, 'banker', 1]]], [[[['5S', 'JS'], ['KH', 'TC'], ['4C', '9S']], [9, 9, 'tie', 2]], [[['9H', '9S'], ['TS', '4S'], ['TD', 'TC']], [8, 4, 'player', 0]], [[['9D', '9S'], ['2S', '6D'], ['6S', '4C']], [8, 8, 'tie', 0]], [[['2S', '9H'], ['7H', 'AS'], ['AH', '5H']], [1, 8, 'banker', 0]], [[['2C', '6H'], ['3D', 'TH'], ['QD', 'KS']], [8, 3, 'player', 0]], [[['2S', '2H'], ['3C', '9D'], ['KH', '6C']], [4, 8, 'banker', 2]], [[['TS', '6S'], ['TC', 'KD'], ['5H', 'AC']], [6, 5, 'player', 1]], [[['2H', '3D'], ['2C', 'TC'], ['9D', '8D']], [4, 0, 'player', 2]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"coup 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-baccarat-tableau-player-standing-total","generated_at":"2026-09-29T14:50:23.930890+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.","root_cause":"The player draw rule uses <= 6.","sha256":"bf53a5ea9463deb7cd400b0a738f79e1e5ca743be28ec1cb2ded34c06388b15b","title":"Player draws on 6 · 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.278,"exit_code":1,"observations":[{"actual":[6,7,"banker",0],"check":"coup case 0","expected":[6,7,"banker",0],"passed":true},{"actual":[4,8,"banker",0],"check":"coup case 1","expected":[4,8,"banker",0],"passed":true},{"actual":[2,7,"banker",1],"check":"coup case 2","expected":[2,7,"banker",1],"passed":true},{"actual":[3,7,"banker",1],"check":"coup case 3","expected":[3,7,"banker",1],"passed":true},{"actual":[8,5,"player",0],"check":"coup case 4","expected":[8,5,"player",0],"passed":true},{"actual":[9,9,"tie",0],"check":"coup case 5","expected":[9,9,"tie",0],"passed":true},{"actual":[1,4,"banker",2],"check":"coup case 6","expected":[1,4,"banker",2],"passed":true},{"actual":[5,1,"player",1],"check":"coup case 7","expected":[5,1,"player",2],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"coup case 0\", \"actual\": [6, 7, \"banker\", 0], \"expected\": [6, 7, \"banker\", 0], \"passed\": true}, {\"check\": \"coup case 1\", \"actual\": [4, 8, \"banker\", 0], \"expected\": [4, 8, \"banker\", 0], \"passed\": true}, {\"check\": \"coup case 2\", \"actual\": [2, 7, \"banker\", 1], \"expected\": [2, 7, \"banker\", 1], \"passed\": true}, {\"check\": \"coup case 3\", \"actual\": [3, 7, \"banker\", 1], \"expected\": [3, 7, \"banker\", 1], \"passed\": true}, {\"check\": \"coup case 4\", \"actual\": [8, 5, \"player\", 0], \"expected\": [8, 5, \"player\", 0], \"passed\": true}, {\"check\": \"coup case 5\", \"actual\": [9, 9, \"tie\", 0], \"expected\": [9, 9, \"tie\", 0], \"passed\": true}, {\"check\": \"coup case 6\", \"actual\": [1, 4, \"banker\", 2], \"expected\": [1, 4, \"banker\", 2], \"passed\": true}, {\"check\": \"coup case 7\", \"actual\": [5, 1, \"player\", 1], \"expected\": [5, 1, \"player\", 2], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.915,"exit_code":1,"observations":[{"actual":[6,7,"banker",1],"check":"coup case 0","expected":[6,7,"banker",0],"passed":false},{"actual":[4,8,"banker",0],"check":"coup case 1","expected":[4,8,"banker",0],"passed":true},{"actual":[2,7,"banker",1],"check":"coup case 2","expected":[2,7,"banker",1],"passed":true},{"actual":[3,7,"banker",1],"check":"coup case 3","expected":[3,7,"banker",1],"passed":true},{"actual":[8,5,"player",0],"check":"coup case 4","expected":[8,5,"player",0],"passed":true},{"actual":[9,9,"tie",0],"check":"coup case 5","expected":[9,9,"tie",0],"passed":true},{"actual":[1,4,"banker",2],"check":"coup case 6","expected":[1,4,"banker",2],"passed":true},{"actual":[5,1,"player",2],"check":"coup case 7","expected":[5,1,"player",2],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"coup case 0\", \"actual\": [6, 7, \"banker\", 1], \"expected\": [6, 7, \"banker\", 0], \"passed\": false}, {\"check\": \"coup case 1\", \"actual\": [4, 8, \"banker\", 0], \"expected\": [4, 8, \"banker\", 0], \"passed\": true}, {\"check\": \"coup case 2\", \"actual\": [2, 7, \"banker\", 1], \"expected\": [2, 7, \"banker\", 1], \"passed\": true}, {\"check\": \"coup case 3\", \"actual\": [3, 7, \"banker\", 1], \"expected\": [3, 7, \"banker\", 1], \"passed\": true}, {\"check\": \"coup case 4\", \"actual\": [8, 5, \"player\", 0], \"expected\": [8, 5, \"player\", 0], \"passed\": true}, {\"check\": \"coup case 5\", \"actual\": [9, 9, \"tie\", 0], \"expected\": [9, 9, \"tie\", 0], \"passed\": true}, {\"check\": \"coup case 6\", \"actual\": [1, 4, \"banker\", 2], \"expected\": [1, 4, \"banker\", 2], \"passed\": true}, {\"check\": \"coup case 7\", \"actual\": [5, 1, \"player\", 2], \"expected\": [5, 1, \"player\", 2], \"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."}}