FAILURE MAP
← Case archive

FA-83381 / Card game rule engines / Open access

Dealer hits soft 17 under S17 and stands under H17 · case 01

The table rule is applied backwards on soft 17.

Verified by executionVariant 1 · 8 checks per implementationDownload source bundle ↓JSON ↗

ROOT CAUSE

The soft-17 test compares against the wrong rule name.

VERIFIED REPAIR

Hit soft 17 only when rule is H17.

Unsuccessful approach: Dropping the softness test makes an H17 dealer hit hard 17 too.

Case contract

Input [dealer_cards, shoe, rule]. Dealer draws from the front of the shoe while total < 17, and under H17 also on soft 17; aces count 11 when that does not bust. Stop if the shoe runs out. Return [final_cards, total].

Why this case matters

Card-game engines, scoring apps and online tables apply this rule automatically on every hand.

1 / The failure

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cards, shoe, rule = x
    hand = list(cards)
    pos = 0
    def value(h):
        t = 0
        a = 0
        for c in h:
            if c[0] == 'A':
                a += 1
                t += 1
            elif c[0] in 'TJQK':
                t += 10
            else:
                t += int(c[0])
        soft = a > 0 and t + 10 <= 21
        return (t + 10 if soft else t), soft
    while True:
        t, soft = value(hand)
        if t < 17 or (t == 17 and soft and rule == 'S17'):
            if pos >= len(shoe):
                break
            hand.append(shoe[pos])
            pos += 1
        else:
            break
    t, soft = value(hand)
    return [hand, t]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['JH', '5D'], ['7D', 'KH', '2H', '6D', 'QS', 'KS'], 'H17'], [['JH', '5D', '7D'], 22]], [[['KS', '7S'], ['TC', 'JH', 'AD', '3D', 'KC', 'QD'], 'H17'], [['KS', '7S'], 17]], [[['QS', 'JS'], ['6H', '6D', '3C', '3S', '9D', 'QD'], 'S17'], [['QS', 'JS'], 20]], [[['3H', '7D'], ['3S', '9S', '4D', '2H', '6C', '9H'], 'S17'], [['3H', '7D', '3S', '9S'], 22]], [[['3C', '2D'], ['QS', 'QH', '2C', '8D', 'KC', 'JC'], 'S17'], [['3C', '2D', 'QS', 'QH'], 25]], [[['TC', '6H'], ['TH', '5C', '2D', '7S', '2S', '3S'], 'H17'], [['TC', '6H', 'TH'], 26]], [[['3D', 'TC'], ['AH', '3C', 'JH', '2C', 'AC', '7H'], 'H17'], [['3D', 'TC', 'AH', '3C'], 17]], [[['6S', 'AD'], ['8S', '4H', '9D', 'TC', '5S', '4D'], 'H17'], [['6S', 'AD', '8S', '4H'], 19]]], [[[['KS', '2D'], ['7D', '7H', '8S', '4H', '8H', 'KC'], 'S17'], [['KS', '2D', '7D'], 19]], [[['TH', '8S'], ['QC', 'QS', 'KH', 'JH', '3D', 'QH'], 'S17'], [['TH', '8S'], 18]], [[['8C', 'QS'], ['AS', 'KC', '5C', '6C', '9S', '6S'], 'S17'], [['8C', 'QS'], 18]], [[['TC', '7H'], ['2S', '8C', 'JC', '7S', '2H', '8H'], 'H17'], [['TC', '7H'], 17]], [[['2C', 'QS'], ['QD', '7D', '9D', '7C', 'KH', 'AS'], 'S17'], [['2C', 'QS', 'QD'], 22]], [[['KC', '9C'], ['2H', 'JD', '2C', 'KS', 'AC', '7C'], 'S17'], [['KC', '9C'], 19]], [[['6H', '5S'], ['4S', '2C', 'QS', 'AD', '9S', 'QH'], 'H17'], [['6H', '5S', '4S', '2C'], 17]], [[['AS', '6H'], ['2C', '9D', '5S', '3H'], 'S17'], [['AS', '6H'], 17]]], [[[['KS', '7S'], ['TC', 'JH', 'AD', '3D', 'KC', 'QD'], 'H17'], [['KS', '7S'], 17]], [[['JS', 'QC'], ['AH', '4S', '6C', 'TS', '5D', 'QD'], 'S17'], [['JS', 'QC'], 20]], [[['5C', '7S'], ['4C', 'KH', '9H', 'QC', 'KD', '3D'], 'H17'], [['5C', '7S', '4C', 'KH'], 26]], [[['JD', '7S'], ['7D', 'KH', '5D', '9H', '4D', '3H'], 'S17'], [['JD', '7S'], 17]], [[['KC', 'QH'], ['5H', 'JS', '9S', '6H', '5D', '3C'], 'H17'], [['KC', 'QH'], 20]], [[['TH', '5S'], ['7H', 'JD', '4C', '6D', '7D', 'QC'], 'H17'], [['TH', '5S', '7H'], 22]], [[['AC', 'JC'], ['7D', 'JH', '4S', '8D', '6D', 'TH'], 'S17'], [['AC', 'JC'], 21]], [[['AS', 'AH'], ['4C', 'AD', '9C'], 'H17'], [['AS', 'AH', '4C', 'AD', '9C'], 16]]], [[[['9H', '7D'], ['QD', '8C', '6D', 'AD', 'JD', 'AS'], 'H17'], [['9H', '7D', 'QD'], 26]], [[['8D', '4H'], ['5H', '2S', 'TS', 'QH', 'TD', '9H'], 'H17'], [['8D', '4H', '5H'], 17]], [[['2D', 'KC'], ['9D', 'AD', 'QC', 'TD', '6C', 'TC'], 'S17'], [['2D', 'KC', '9D'], 21]], [[['5D', '3S'], ['JC', '7S', '4S', '6H', '2D', 'KC'], 'H17'], [['5D', '3S', 'JC'], 18]], [[['8C', 'JS'], ['2C', '2S', '9C', '3C', '4D', 'TH'], 'S17'], [['8C', 'JS'], 18]], [[['5C', 'QD'], ['2H', 'TD', 'TC', '8C', '2C', 'QS'], 'H17'], [['5C', 'QD', '2H'], 17]], [[['9H', '2H'], ['6S', '5D', 'JS', '6D', 'KD', 'JC'], 'H17'], [['9H', '2H', '6S'], 17]], [[['AS', '6H'], ['2C', '9D', '5S', '3H'], 'H17'], [['AS', '6H', '2C'], 19]]], [[[['3C', 'TD'], ['4S', '4C', '6S', '6D', '4H', '2S'], 'S17'], [['3C', 'TD', '4S'], 17]], [[['QS', 'JS'], ['8H', '2C', '6H', '5C', 'AH', 'QH'], 'S17'], [['QS', 'JS'], 20]], [[['2C', '9D'], ['7H', '2S', '3S', '4H', '2D', '4S'], 'H17'], [['2C', '9D', '7H'], 18]], [[['3S', '9D'], ['2D', 'KC', '3D', 'TD', 'AS', 'TH'], 'S17'], [['3S', '9D', '2D', 'KC'], 24]], [[['4D', '7S'], ['3S', '8S', '8D', 'QC', 'AH', 'JC'], 'S17'], [['4D', '7S', '3S', '8S'], 22]], [[['7C', '6S'], ['5S', '7D', '9H', '3C', '4S', 'JH'], 'H17'], [['7C', '6S', '5S'], 18]], [[['7H', 'JS'], ['6C', '3C', '9H', '3H', 'QC', '5H'], 'H17'], [['7H', 'JS'], 17]], [[['5S', 'AH'], ['AC', '4D', '2C'], 'H17'], [['5S', 'AH', 'AC', '4D'], 21]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("dealer hand case %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
dealer hand case 0[['JH', '5D', '7D'], 22][['JH', '5D', '7D'], 22]Passed
dealer hand case 1[['KS', '7S'], 17][['KS', '7S'], 17]Passed
dealer hand case 2[['QS', 'JS'], 20][['QS', 'JS'], 20]Passed
dealer hand case 3[['3H', '7D', '3S', '9S'], 22][['3H', '7D', '3S', '9S'], 22]Passed
dealer hand case 4[['3C', '2D', 'QS', 'QH'], 25][['3C', '2D', 'QS', 'QH'], 25]Passed
dealer hand case 5[['TC', '6H', 'TH'], 26][['TC', '6H', 'TH'], 26]Passed
dealer hand case 6[['3D', 'TC', 'AH', '3C'], 17][['3D', 'TC', 'AH', '3C'], 17]Passed
dealer hand case 7[['6S', 'AD'], 17][['6S', 'AD', '8S', '4H'], 19]Failed

SHA-256 / 0f4796a6ede49aad0099edec836e767e08b9362a69153c1aa946616373f62583

2 / The unsuccessful fix

Exit 1
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cards, shoe, rule = x
    hand = list(cards)
    pos = 0
    def value(h):
        t = 0
        a = 0
        for c in h:
            if c[0] == 'A':
                a += 1
                t += 1
            elif c[0] in 'TJQK':
                t += 10
            else:
                t += int(c[0])
        soft = a > 0 and t + 10 <= 21
        return (t + 10 if soft else t), soft
    while True:
        t, soft = value(hand)
        if t < 17 or (t == 17 and rule == 'H17'):
            if pos >= len(shoe):
                break
            hand.append(shoe[pos])
            pos += 1
        else:
            break
    t, soft = value(hand)
    return [hand, t]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['JH', '5D'], ['7D', 'KH', '2H', '6D', 'QS', 'KS'], 'H17'], [['JH', '5D', '7D'], 22]], [[['KS', '7S'], ['TC', 'JH', 'AD', '3D', 'KC', 'QD'], 'H17'], [['KS', '7S'], 17]], [[['QS', 'JS'], ['6H', '6D', '3C', '3S', '9D', 'QD'], 'S17'], [['QS', 'JS'], 20]], [[['3H', '7D'], ['3S', '9S', '4D', '2H', '6C', '9H'], 'S17'], [['3H', '7D', '3S', '9S'], 22]], [[['3C', '2D'], ['QS', 'QH', '2C', '8D', 'KC', 'JC'], 'S17'], [['3C', '2D', 'QS', 'QH'], 25]], [[['TC', '6H'], ['TH', '5C', '2D', '7S', '2S', '3S'], 'H17'], [['TC', '6H', 'TH'], 26]], [[['3D', 'TC'], ['AH', '3C', 'JH', '2C', 'AC', '7H'], 'H17'], [['3D', 'TC', 'AH', '3C'], 17]], [[['6S', 'AD'], ['8S', '4H', '9D', 'TC', '5S', '4D'], 'H17'], [['6S', 'AD', '8S', '4H'], 19]]], [[[['KS', '2D'], ['7D', '7H', '8S', '4H', '8H', 'KC'], 'S17'], [['KS', '2D', '7D'], 19]], [[['TH', '8S'], ['QC', 'QS', 'KH', 'JH', '3D', 'QH'], 'S17'], [['TH', '8S'], 18]], [[['8C', 'QS'], ['AS', 'KC', '5C', '6C', '9S', '6S'], 'S17'], [['8C', 'QS'], 18]], [[['TC', '7H'], ['2S', '8C', 'JC', '7S', '2H', '8H'], 'H17'], [['TC', '7H'], 17]], [[['2C', 'QS'], ['QD', '7D', '9D', '7C', 'KH', 'AS'], 'S17'], [['2C', 'QS', 'QD'], 22]], [[['KC', '9C'], ['2H', 'JD', '2C', 'KS', 'AC', '7C'], 'S17'], [['KC', '9C'], 19]], [[['6H', '5S'], ['4S', '2C', 'QS', 'AD', '9S', 'QH'], 'H17'], [['6H', '5S', '4S', '2C'], 17]], [[['AS', '6H'], ['2C', '9D', '5S', '3H'], 'S17'], [['AS', '6H'], 17]]], [[[['KS', '7S'], ['TC', 'JH', 'AD', '3D', 'KC', 'QD'], 'H17'], [['KS', '7S'], 17]], [[['JS', 'QC'], ['AH', '4S', '6C', 'TS', '5D', 'QD'], 'S17'], [['JS', 'QC'], 20]], [[['5C', '7S'], ['4C', 'KH', '9H', 'QC', 'KD', '3D'], 'H17'], [['5C', '7S', '4C', 'KH'], 26]], [[['JD', '7S'], ['7D', 'KH', '5D', '9H', '4D', '3H'], 'S17'], [['JD', '7S'], 17]], [[['KC', 'QH'], ['5H', 'JS', '9S', '6H', '5D', '3C'], 'H17'], [['KC', 'QH'], 20]], [[['TH', '5S'], ['7H', 'JD', '4C', '6D', '7D', 'QC'], 'H17'], [['TH', '5S', '7H'], 22]], [[['AC', 'JC'], ['7D', 'JH', '4S', '8D', '6D', 'TH'], 'S17'], [['AC', 'JC'], 21]], [[['AS', 'AH'], ['4C', 'AD', '9C'], 'H17'], [['AS', 'AH', '4C', 'AD', '9C'], 16]]], [[[['9H', '7D'], ['QD', '8C', '6D', 'AD', 'JD', 'AS'], 'H17'], [['9H', '7D', 'QD'], 26]], [[['8D', '4H'], ['5H', '2S', 'TS', 'QH', 'TD', '9H'], 'H17'], [['8D', '4H', '5H'], 17]], [[['2D', 'KC'], ['9D', 'AD', 'QC', 'TD', '6C', 'TC'], 'S17'], [['2D', 'KC', '9D'], 21]], [[['5D', '3S'], ['JC', '7S', '4S', '6H', '2D', 'KC'], 'H17'], [['5D', '3S', 'JC'], 18]], [[['8C', 'JS'], ['2C', '2S', '9C', '3C', '4D', 'TH'], 'S17'], [['8C', 'JS'], 18]], [[['5C', 'QD'], ['2H', 'TD', 'TC', '8C', '2C', 'QS'], 'H17'], [['5C', 'QD', '2H'], 17]], [[['9H', '2H'], ['6S', '5D', 'JS', '6D', 'KD', 'JC'], 'H17'], [['9H', '2H', '6S'], 17]], [[['AS', '6H'], ['2C', '9D', '5S', '3H'], 'H17'], [['AS', '6H', '2C'], 19]]], [[[['3C', 'TD'], ['4S', '4C', '6S', '6D', '4H', '2S'], 'S17'], [['3C', 'TD', '4S'], 17]], [[['QS', 'JS'], ['8H', '2C', '6H', '5C', 'AH', 'QH'], 'S17'], [['QS', 'JS'], 20]], [[['2C', '9D'], ['7H', '2S', '3S', '4H', '2D', '4S'], 'H17'], [['2C', '9D', '7H'], 18]], [[['3S', '9D'], ['2D', 'KC', '3D', 'TD', 'AS', 'TH'], 'S17'], [['3S', '9D', '2D', 'KC'], 24]], [[['4D', '7S'], ['3S', '8S', '8D', 'QC', 'AH', 'JC'], 'S17'], [['4D', '7S', '3S', '8S'], 22]], [[['7C', '6S'], ['5S', '7D', '9H', '3C', '4S', 'JH'], 'H17'], [['7C', '6S', '5S'], 18]], [[['7H', 'JS'], ['6C', '3C', '9H', '3H', 'QC', '5H'], 'H17'], [['7H', 'JS'], 17]], [[['5S', 'AH'], ['AC', '4D', '2C'], 'H17'], [['5S', 'AH', 'AC', '4D'], 21]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("dealer hand case %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
dealer hand case 0[['JH', '5D', '7D'], 22][['JH', '5D', '7D'], 22]Passed
dealer hand case 1[['KS', '7S', 'TC'], 27][['KS', '7S'], 17]Failed
dealer hand case 2[['QS', 'JS'], 20][['QS', 'JS'], 20]Passed
dealer hand case 3[['3H', '7D', '3S', '9S'], 22][['3H', '7D', '3S', '9S'], 22]Passed
dealer hand case 4[['3C', '2D', 'QS', 'QH'], 25][['3C', '2D', 'QS', 'QH'], 25]Passed
dealer hand case 5[['TC', '6H', 'TH'], 26][['TC', '6H', 'TH'], 26]Passed
dealer hand case 6[['3D', 'TC', 'AH', '3C', 'JH'], 27][['3D', 'TC', 'AH', '3C'], 17]Failed
dealer hand case 7[['6S', 'AD', '8S', '4H'], 19][['6S', 'AD', '8S', '4H'], 19]Passed

SHA-256 / e7b3379aef0b1c2a07cd38e8a5dd2e25ecfe934e8e7da67a00f535e6a27700b7

3 / The verified repair

Exit 0
"""Failure Map reference implementation. Python standard library only."""
import json

N = 1
observations = []
def solve(x):
    cards, shoe, rule = x
    hand = list(cards)
    pos = 0
    def value(h):
        t = 0
        a = 0
        for c in h:
            if c[0] == 'A':
                a += 1
                t += 1
            elif c[0] in 'TJQK':
                t += 10
            else:
                t += int(c[0])
        soft = a > 0 and t + 10 <= 21
        return (t + 10 if soft else t), soft
    while True:
        t, soft = value(hand)
        if t < 17 or (t == 17 and soft and rule == 'H17'):
            if pos >= len(shoe):
                break
            hand.append(shoe[pos])
            pos += 1
        else:
            break
    t, soft = value(hand)
    return [hand, t]
def check(label, actual, expected):
    observations.append({"check": label, "actual": actual, "expected": expected, "passed": actual == expected})
fixtures = [[[[['JH', '5D'], ['7D', 'KH', '2H', '6D', 'QS', 'KS'], 'H17'], [['JH', '5D', '7D'], 22]], [[['KS', '7S'], ['TC', 'JH', 'AD', '3D', 'KC', 'QD'], 'H17'], [['KS', '7S'], 17]], [[['QS', 'JS'], ['6H', '6D', '3C', '3S', '9D', 'QD'], 'S17'], [['QS', 'JS'], 20]], [[['3H', '7D'], ['3S', '9S', '4D', '2H', '6C', '9H'], 'S17'], [['3H', '7D', '3S', '9S'], 22]], [[['3C', '2D'], ['QS', 'QH', '2C', '8D', 'KC', 'JC'], 'S17'], [['3C', '2D', 'QS', 'QH'], 25]], [[['TC', '6H'], ['TH', '5C', '2D', '7S', '2S', '3S'], 'H17'], [['TC', '6H', 'TH'], 26]], [[['3D', 'TC'], ['AH', '3C', 'JH', '2C', 'AC', '7H'], 'H17'], [['3D', 'TC', 'AH', '3C'], 17]], [[['6S', 'AD'], ['8S', '4H', '9D', 'TC', '5S', '4D'], 'H17'], [['6S', 'AD', '8S', '4H'], 19]]], [[[['KS', '2D'], ['7D', '7H', '8S', '4H', '8H', 'KC'], 'S17'], [['KS', '2D', '7D'], 19]], [[['TH', '8S'], ['QC', 'QS', 'KH', 'JH', '3D', 'QH'], 'S17'], [['TH', '8S'], 18]], [[['8C', 'QS'], ['AS', 'KC', '5C', '6C', '9S', '6S'], 'S17'], [['8C', 'QS'], 18]], [[['TC', '7H'], ['2S', '8C', 'JC', '7S', '2H', '8H'], 'H17'], [['TC', '7H'], 17]], [[['2C', 'QS'], ['QD', '7D', '9D', '7C', 'KH', 'AS'], 'S17'], [['2C', 'QS', 'QD'], 22]], [[['KC', '9C'], ['2H', 'JD', '2C', 'KS', 'AC', '7C'], 'S17'], [['KC', '9C'], 19]], [[['6H', '5S'], ['4S', '2C', 'QS', 'AD', '9S', 'QH'], 'H17'], [['6H', '5S', '4S', '2C'], 17]], [[['AS', '6H'], ['2C', '9D', '5S', '3H'], 'S17'], [['AS', '6H'], 17]]], [[[['KS', '7S'], ['TC', 'JH', 'AD', '3D', 'KC', 'QD'], 'H17'], [['KS', '7S'], 17]], [[['JS', 'QC'], ['AH', '4S', '6C', 'TS', '5D', 'QD'], 'S17'], [['JS', 'QC'], 20]], [[['5C', '7S'], ['4C', 'KH', '9H', 'QC', 'KD', '3D'], 'H17'], [['5C', '7S', '4C', 'KH'], 26]], [[['JD', '7S'], ['7D', 'KH', '5D', '9H', '4D', '3H'], 'S17'], [['JD', '7S'], 17]], [[['KC', 'QH'], ['5H', 'JS', '9S', '6H', '5D', '3C'], 'H17'], [['KC', 'QH'], 20]], [[['TH', '5S'], ['7H', 'JD', '4C', '6D', '7D', 'QC'], 'H17'], [['TH', '5S', '7H'], 22]], [[['AC', 'JC'], ['7D', 'JH', '4S', '8D', '6D', 'TH'], 'S17'], [['AC', 'JC'], 21]], [[['AS', 'AH'], ['4C', 'AD', '9C'], 'H17'], [['AS', 'AH', '4C', 'AD', '9C'], 16]]], [[[['9H', '7D'], ['QD', '8C', '6D', 'AD', 'JD', 'AS'], 'H17'], [['9H', '7D', 'QD'], 26]], [[['8D', '4H'], ['5H', '2S', 'TS', 'QH', 'TD', '9H'], 'H17'], [['8D', '4H', '5H'], 17]], [[['2D', 'KC'], ['9D', 'AD', 'QC', 'TD', '6C', 'TC'], 'S17'], [['2D', 'KC', '9D'], 21]], [[['5D', '3S'], ['JC', '7S', '4S', '6H', '2D', 'KC'], 'H17'], [['5D', '3S', 'JC'], 18]], [[['8C', 'JS'], ['2C', '2S', '9C', '3C', '4D', 'TH'], 'S17'], [['8C', 'JS'], 18]], [[['5C', 'QD'], ['2H', 'TD', 'TC', '8C', '2C', 'QS'], 'H17'], [['5C', 'QD', '2H'], 17]], [[['9H', '2H'], ['6S', '5D', 'JS', '6D', 'KD', 'JC'], 'H17'], [['9H', '2H', '6S'], 17]], [[['AS', '6H'], ['2C', '9D', '5S', '3H'], 'H17'], [['AS', '6H', '2C'], 19]]], [[[['3C', 'TD'], ['4S', '4C', '6S', '6D', '4H', '2S'], 'S17'], [['3C', 'TD', '4S'], 17]], [[['QS', 'JS'], ['8H', '2C', '6H', '5C', 'AH', 'QH'], 'S17'], [['QS', 'JS'], 20]], [[['2C', '9D'], ['7H', '2S', '3S', '4H', '2D', '4S'], 'H17'], [['2C', '9D', '7H'], 18]], [[['3S', '9D'], ['2D', 'KC', '3D', 'TD', 'AS', 'TH'], 'S17'], [['3S', '9D', '2D', 'KC'], 24]], [[['4D', '7S'], ['3S', '8S', '8D', 'QC', 'AH', 'JC'], 'S17'], [['4D', '7S', '3S', '8S'], 22]], [[['7C', '6S'], ['5S', '7D', '9H', '3C', '4S', 'JH'], 'H17'], [['7C', '6S', '5S'], 18]], [[['7H', 'JS'], ['6C', '3C', '9H', '3H', 'QC', '5H'], 'H17'], [['7H', 'JS'], 17]], [[['5S', 'AH'], ['AC', '4D', '2C'], 'H17'], [['5S', 'AH', 'AC', '4D'], 21]]]]
for i, (args, expected) in enumerate(fixtures[N-1]):
    check("dealer hand case %d" % i, solve(args), expected)
print(json.dumps({"observations": observations, "passed": all(x["passed"] for x in observations)}, ensure_ascii=False))
raise SystemExit(0 if all(x["passed"] for x in observations) else 1)
Boundary fixtureActualExpectedOutcome
dealer hand case 0[['JH', '5D', '7D'], 22][['JH', '5D', '7D'], 22]Passed
dealer hand case 1[['KS', '7S'], 17][['KS', '7S'], 17]Passed
dealer hand case 2[['QS', 'JS'], 20][['QS', 'JS'], 20]Passed
dealer hand case 3[['3H', '7D', '3S', '9S'], 22][['3H', '7D', '3S', '9S'], 22]Passed
dealer hand case 4[['3C', '2D', 'QS', 'QH'], 25][['3C', '2D', 'QS', 'QH'], 25]Passed
dealer hand case 5[['TC', '6H', 'TH'], 26][['TC', '6H', 'TH'], 26]Passed
dealer hand case 6[['3D', 'TC', 'AH', '3C'], 17][['3D', 'TC', 'AH', '3C'], 17]Passed
dealer hand case 7[['6S', 'AD', '8S', '4H'], 19][['6S', 'AD', '8S', '4H'], 19]Passed

SHA-256 / edcb5be8a104a026b506864117f0992f554498ebf5b32a7f8d81297681909417

Verification & scope

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.

Observations recorded using Python 3.12.14 at 2026-09-29T14:50:21.126043+00:00.

Case digest / 5a176d1f920991236d64b19b36f07136bb7b4b9c70a9ac2c7a3f17ca7e6c1d27