{"abstract":"The same-colour jack beats the jack of trump.","category":"Card game rule engines","checks":8,"contract":"Input [four_cards, leader, trump]. The jack of trump (right bower) is highest, the jack of the same-colour suit (left bower) is second and belongs to the trump suit; then A K Q T 9 of trump. Otherwise the highest card of the effective led suit (A K Q J T 9) wins. Return the winning seat.","contract_signature":"x","evaluation_group":"w2-card-game-rule-engines-euchre-trick","failed_approach":"Ranking jacks in their natural slot makes the bowers lose to trump aces.","family":"w2-card-game-rule-engines-euchre-trick-bower-ranking","id":"FA-83646","implementations":{"attempt":{"sha256":"8fb58c246d392e5192e905423b54f19bbb958653bbab7f28f839e0f129fe4607","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cards, leader, trump = x\n    partner = {'S': 'C', 'C': 'S', 'H': 'D', 'D': 'H'}[trump]\n    def suit(c):\n        if c[0] == 'J' and c[1] == partner:\n            return trump\n        return c[1]\n    def power(c):\n        if suit(c) == trump:\n            return 50 + '9TJQKA'.index(c[0])\n        return '9TJQKA'.index(c[0])\n    best = 0\n    for i in range(1, len(cards)):\n        c = cards[i]\n        b = cards[best]\n        if suit(c) == suit(b) and power(c) > power(b):\n            best = i\n        elif suit(c) == trump and suit(b) != trump:\n            best = i\n    return (leader + best) % 4\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['JC', 'JD', 'TC', 'JH'], 3, 'H'], 2], [[['9H', 'JS', 'TH', 'QC'], 3, 'C'], 0], [[['KS', '9H', 'QC', '9D'], 3, 'S'], 3], [[['JD', 'QD', 'AD', 'AC'], 0, 'H'], 0], [[['JD', 'AS', 'JC', 'QH'], 3, 'S'], 1], [[['KH', '9S', 'JH', 'QS'], 3, 'D'], 1], [[['TS', 'JS', 'TC', 'QC'], 2, 'S'], 3], [[['9D', 'AS', 'JS', 'TD'], 0, 'S'], 2]], [[[['JH', 'AH', 'KD', 'JD'], 2, 'D'], 1], [[['JD', '9H', 'TH', 'AS'], 0, 'H'], 0], [[['JD', 'TS', '9C', 'QD'], 3, 'C'], 1], [[['QS', 'KD', '9S', '9C'], 1, 'S'], 1], [[['TH', 'AS', 'TD', 'KD'], 2, 'C'], 2], [[['QS', 'TC', 'KH', 'AS'], 0, 'D'], 3], [[['TH', 'JS', 'QC', 'JC'], 2, 'C'], 1], [[['KD', 'AS', 'JD', 'JH'], 0, 'D'], 2]], [[[['KC', 'KD', 'JS', 'QH'], 1, 'C'], 3], [[['JC', 'TH', '9H', 'QD'], 1, 'D'], 0], [[['9D', 'AS', 'JS', 'TD'], 0, 'S'], 2], [[['JS', 'TH', 'TC', 'JD'], 2, 'C'], 2], [[['TC', 'JS', 'AC', 'TH'], 1, 'C'], 2], [[['QC', 'QD', 'KC', 'JS'], 2, 'C'], 1], [[['JD', '9D', 'AH', 'JS'], 1, 'H'], 1], [[['KC', 'JD', 'QS', 'JH'], 0, 'D'], 1]], [[[['AH', 'KD', '9S', 'KC'], 3, 'S'], 1], [[['JD', 'QD', 'KC', 'JC'], 3, 'S'], 2], [[['TH', 'AH', 'JD', 'QD'], 2, 'S'], 3], [[['KS', '9D', 'TD', 'JS'], 0, 'C'], 3], [[['9C', 'JH', 'JS', 'TC'], 2, 'C'], 0], [[['QD', 'AH', 'KS', 'TC'], 3, 'H'], 0], [[['9D', 'JH', 'QH', 'QD'], 3, 'D'], 0], [[['JS', 'AH', '9H', 'JC'], 2, 'C'], 1]], [[[['QH', 'AD', 'AS', 'QC'], 3, 'D'], 0], [[['TC', 'JD', 'QS', 'JC'], 3, 'C'], 2], [[['AH', 'JH', '9C', 'TS'], 0, 'D'], 1], [[['AD', 'KS', 'JH', 'JD'], 2, 'H'], 0], [[['TH', 'JS', 'QC', 'JC'], 2, 'C'], 1], [[['KC', '9H', 'JS', 'JC'], 2, 'S'], 0], [[['9D', 'JS', 'TS', 'QC'], 1, 'C'], 2], [[['KH', 'JC', 'JS', 'TC'], 3, 'C'], 0]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"trick 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":"7b448dde3e2e36f1cd2235dbbf4004bd92faea5e9bb5105738ed1e904787046b","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    cards, leader, trump = x\n    partner = {'S': 'C', 'C': 'S', 'H': 'D', 'D': 'H'}[trump]\n    def suit(c):\n        if c[0] == 'J' and c[1] == partner:\n            return trump\n        return c[1]\n    def power(c):\n        if suit(c) == trump:\n            if c[0] == 'J':\n                return 99 if c[1] == trump else 100\n            return 50 + '9TJQKA'.index(c[0])\n        return '9TJQKA'.index(c[0])\n    best = 0\n    for i in range(1, len(cards)):\n        c = cards[i]\n        b = cards[best]\n        if suit(c) == suit(b) and power(c) > power(b):\n            best = i\n        elif suit(c) == trump and suit(b) != trump:\n            best = i\n    return (leader + best) % 4\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['JC', 'JD', 'TC', 'JH'], 3, 'H'], 2], [[['9H', 'JS', 'TH', 'QC'], 3, 'C'], 0], [[['KS', '9H', 'QC', '9D'], 3, 'S'], 3], [[['JD', 'QD', 'AD', 'AC'], 0, 'H'], 0], [[['JD', 'AS', 'JC', 'QH'], 3, 'S'], 1], [[['KH', '9S', 'JH', 'QS'], 3, 'D'], 1], [[['TS', 'JS', 'TC', 'QC'], 2, 'S'], 3], [[['9D', 'AS', 'JS', 'TD'], 0, 'S'], 2]], [[[['JH', 'AH', 'KD', 'JD'], 2, 'D'], 1], [[['JD', '9H', 'TH', 'AS'], 0, 'H'], 0], [[['JD', 'TS', '9C', 'QD'], 3, 'C'], 1], [[['QS', 'KD', '9S', '9C'], 1, 'S'], 1], [[['TH', 'AS', 'TD', 'KD'], 2, 'C'], 2], [[['QS', 'TC', 'KH', 'AS'], 0, 'D'], 3], [[['TH', 'JS', 'QC', 'JC'], 2, 'C'], 1], [[['KD', 'AS', 'JD', 'JH'], 0, 'D'], 2]], [[[['KC', 'KD', 'JS', 'QH'], 1, 'C'], 3], [[['JC', 'TH', '9H', 'QD'], 1, 'D'], 0], [[['9D', 'AS', 'JS', 'TD'], 0, 'S'], 2], [[['JS', 'TH', 'TC', 'JD'], 2, 'C'], 2], [[['TC', 'JS', 'AC', 'TH'], 1, 'C'], 2], [[['QC', 'QD', 'KC', 'JS'], 2, 'C'], 1], [[['JD', '9D', 'AH', 'JS'], 1, 'H'], 1], [[['KC', 'JD', 'QS', 'JH'], 0, 'D'], 1]], [[[['AH', 'KD', '9S', 'KC'], 3, 'S'], 1], [[['JD', 'QD', 'KC', 'JC'], 3, 'S'], 2], [[['TH', 'AH', 'JD', 'QD'], 2, 'S'], 3], [[['KS', '9D', 'TD', 'JS'], 0, 'C'], 3], [[['9C', 'JH', 'JS', 'TC'], 2, 'C'], 0], [[['QD', 'AH', 'KS', 'TC'], 3, 'H'], 0], [[['9D', 'JH', 'QH', 'QD'], 3, 'D'], 0], [[['JS', 'AH', '9H', 'JC'], 2, 'C'], 1]], [[[['QH', 'AD', 'AS', 'QC'], 3, 'D'], 0], [[['TC', 'JD', 'QS', 'JC'], 3, 'C'], 2], [[['AH', 'JH', '9C', 'TS'], 0, 'D'], 1], [[['AD', 'KS', 'JH', 'JD'], 2, 'H'], 0], [[['TH', 'JS', 'QC', 'JC'], 2, 'C'], 1], [[['KC', '9H', 'JS', 'JC'], 2, 'S'], 0], [[['9D', 'JS', 'TS', 'QC'], 1, 'C'], 2], [[['KH', 'JC', 'JS', 'TC'], 3, 'C'], 0]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"trick 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-euchre-trick-bower-ranking","generated_at":"2026-09-29T14:50:23.452964+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":"Bower powers are swapped.","sha256":"9459b3f6b0a04fe3c9d7e7958ba77e30e69f24b7429e06e4b7d5b3c44a68fe93","title":"Left bower outranks right bower · 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.88,"exit_code":1,"observations":[{"actual":0,"check":"trick case 0","expected":2,"passed":false},{"actual":2,"check":"trick case 1","expected":0,"passed":false},{"actual":3,"check":"trick case 2","expected":3,"passed":true},{"actual":0,"check":"trick case 3","expected":0,"passed":true},{"actual":0,"check":"trick case 4","expected":1,"passed":false},{"actual":1,"check":"trick case 5","expected":1,"passed":true},{"actual":3,"check":"trick case 6","expected":3,"passed":true},{"actual":1,"check":"trick case 7","expected":2,"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"trick case 0\", \"actual\": 0, \"expected\": 2, \"passed\": false}, {\"check\": \"trick case 1\", \"actual\": 2, \"expected\": 0, \"passed\": false}, {\"check\": \"trick case 2\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"trick case 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"trick case 4\", \"actual\": 0, \"expected\": 1, \"passed\": false}, {\"check\": \"trick case 5\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"trick case 6\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"trick case 7\", \"actual\": 1, \"expected\": 2, \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":38.997,"exit_code":1,"observations":[{"actual":0,"check":"trick case 0","expected":2,"passed":false},{"actual":0,"check":"trick case 1","expected":0,"passed":true},{"actual":3,"check":"trick case 2","expected":3,"passed":true},{"actual":0,"check":"trick case 3","expected":0,"passed":true},{"actual":1,"check":"trick case 4","expected":1,"passed":true},{"actual":1,"check":"trick case 5","expected":1,"passed":true},{"actual":3,"check":"trick case 6","expected":3,"passed":true},{"actual":2,"check":"trick case 7","expected":2,"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"trick case 0\", \"actual\": 0, \"expected\": 2, \"passed\": false}, {\"check\": \"trick case 1\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"trick case 2\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"trick case 3\", \"actual\": 0, \"expected\": 0, \"passed\": true}, {\"check\": \"trick case 4\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"trick case 5\", \"actual\": 1, \"expected\": 1, \"passed\": true}, {\"check\": \"trick case 6\", \"actual\": 3, \"expected\": 3, \"passed\": true}, {\"check\": \"trick case 7\", \"actual\": 2, \"expected\": 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."}}