{"abstract":"Reaching 30 scores 2.","category":"Card game rule engines","checks":8,"contract":"Input [cards_in_current_count, new_card]. Values A=1, T/J/Q/K=10; a count above 31 is \"illegal\". Points: count 15 -> 2, count 31 -> 2; the new card with the immediately preceding same-rank run scores 2/6/12; the longest trailing sequence of 3+ cards whose ranks are consecutive in any order scores its length. Return [points, count].","evaluation_group":"w2-card-game-rule-engines-cribbage-peg","failed_approach":"Scoring whenever the count passes through 15 rewards jumping over it.","family":"w2-card-game-rule-engines-cribbage-peg-fifteen-during-play","id":"FA-83576","implementations":{"attempt":{"sha256":"2cbec5d1103700f441788349882f9ed13560bfe2c7a5083348c9de0fa384d3f8","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    pile, card = x\n    order = 'A23456789TJQK'\n    def val(c):\n        return min(order.index(c[0]) + 1, 10)\n    count = sum(val(c) for c in pile) + val(card)\n    if count > 31:\n        return 'illegal'\n    seq = pile + [card]\n    pts = 0\n    if count >= 15 and count - val(card) < 15:\n        pts += 2\n    if count == 31:\n        pts += 2\n    same = 1\n    for c in reversed(seq[:-1]):\n        if c[0] == card[0]:\n            same += 1\n        else:\n            break\n    pts += {1: 0, 2: 2, 3: 6, 4: 12}[same]\n    best = 0\n    for L in range(3, len(seq) + 1):\n        tail = sorted(order.index(c[0]) for c in seq[-L:])\n        if all(tail[i + 1] == tail[i] + 1 for i in range(L - 1)):\n            best = L\n    pts += best\n    return [pts, count]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['6H', 'QD', 'TH'], '4H'], [0, 30]], [[['4D', 'KS', '2C', 'TC'], 'TS'], 'illegal'], [[['JD', '8D', 'QD'], '9D'], 'illegal'], [[['8S', 'TD', '2H', 'QH'], '5S'], 'illegal'], [[['6S', '7D', '7C', 'KS'], '3C'], 'illegal'], [[['5C', '7H'], 'TS'], [0, 22]], [[['AC', 'AS', 'TS', '4C'], '4C'], [2, 20]], [[['6H', 'AD'], 'TD'], [0, 17]]], [[[[], '5D'], [0, 5]], [[['8C', '2D', '8S', '5H', 'AH'], 'AS'], [2, 25]], [[['5D', '4C', '3S', 'KS'], 'KC'], 'illegal'], [[['9C', '7D'], 'KD'], [0, 26]], [[[], '7C'], [0, 7]], [[['7H'], '7C'], [2, 14]], [[['QH', '2D'], 'JD'], [0, 22]], [[['6C', '4D', 'AD', '9S', '5D'], '5H'], [2, 30]]], [[[['5D', 'JD', '2S', '6H', 'AH'], '4C'], [0, 28]], [[['AD'], 'AS'], [2, 2]], [[['JC'], 'JD'], [2, 20]], [[['TS', '4H', '2H', '7S'], 'QD'], 'illegal'], [[['QS', '3C'], '3C'], [2, 16]], [[['QS', '7D', '6S'], '9S'], 'illegal'], [[['9D'], '9H'], [2, 18]], [[['TH', 'TC'], 'TH'], [6, 30]]], [[[['AD', '5H', 'KD', '6D'], '6S'], [2, 28]], [[['2H', '4S', 'TC', '6H', '8D'], '8H'], 'illegal'], [[['9D', '2C', 'TC'], 'KD'], [2, 31]], [[['AS', '2D'], 'JH'], [0, 13]], [[[], 'AD'], [0, 1]], [[['JH'], '7C'], [0, 17]], [[['AC', 'TS'], 'TH'], [2, 21]], [[['4C', 'TD', 'JD'], '6S'], [0, 30]]], [[[[], '3S'], [0, 3]], [[['TD', '5S', 'AD'], 'AD'], [2, 17]], [[[], '5S'], [0, 5]], [[['6H', 'AD'], 'TD'], [0, 17]], [[['JC', 'JC', '3C'], '3C'], [2, 26]], [[['5C', '3S', '8D', '7D'], 'QC'], 'illegal'], [[['6D', '9H', '7D'], '8D'], [4, 30]], [[['QS'], 'TC'], [0, 20]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"pegging 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":"37e862169b72da295efa175cefea34b7ffc1a51d3472bdc3cf922d73dd6315fd","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    pile, card = x\n    order = 'A23456789TJQK'\n    def val(c):\n        return min(order.index(c[0]) + 1, 10)\n    count = sum(val(c) for c in pile) + val(card)\n    if count > 31:\n        return 'illegal'\n    seq = pile + [card]\n    pts = 0\n    if count % 15 == 0:\n        pts += 2\n    if count == 31:\n        pts += 2\n    same = 1\n    for c in reversed(seq[:-1]):\n        if c[0] == card[0]:\n            same += 1\n        else:\n            break\n    pts += {1: 0, 2: 2, 3: 6, 4: 12}[same]\n    best = 0\n    for L in range(3, len(seq) + 1):\n        tail = sorted(order.index(c[0]) for c in seq[-L:])\n        if all(tail[i + 1] == tail[i] + 1 for i in range(L - 1)):\n            best = L\n    pts += best\n    return [pts, count]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['6H', 'QD', 'TH'], '4H'], [0, 30]], [[['4D', 'KS', '2C', 'TC'], 'TS'], 'illegal'], [[['JD', '8D', 'QD'], '9D'], 'illegal'], [[['8S', 'TD', '2H', 'QH'], '5S'], 'illegal'], [[['6S', '7D', '7C', 'KS'], '3C'], 'illegal'], [[['5C', '7H'], 'TS'], [0, 22]], [[['AC', 'AS', 'TS', '4C'], '4C'], [2, 20]], [[['6H', 'AD'], 'TD'], [0, 17]]], [[[[], '5D'], [0, 5]], [[['8C', '2D', '8S', '5H', 'AH'], 'AS'], [2, 25]], [[['5D', '4C', '3S', 'KS'], 'KC'], 'illegal'], [[['9C', '7D'], 'KD'], [0, 26]], [[[], '7C'], [0, 7]], [[['7H'], '7C'], [2, 14]], [[['QH', '2D'], 'JD'], [0, 22]], [[['6C', '4D', 'AD', '9S', '5D'], '5H'], [2, 30]]], [[[['5D', 'JD', '2S', '6H', 'AH'], '4C'], [0, 28]], [[['AD'], 'AS'], [2, 2]], [[['JC'], 'JD'], [2, 20]], [[['TS', '4H', '2H', '7S'], 'QD'], 'illegal'], [[['QS', '3C'], '3C'], [2, 16]], [[['QS', '7D', '6S'], '9S'], 'illegal'], [[['9D'], '9H'], [2, 18]], [[['TH', 'TC'], 'TH'], [6, 30]]], [[[['AD', '5H', 'KD', '6D'], '6S'], [2, 28]], [[['2H', '4S', 'TC', '6H', '8D'], '8H'], 'illegal'], [[['9D', '2C', 'TC'], 'KD'], [2, 31]], [[['AS', '2D'], 'JH'], [0, 13]], [[[], 'AD'], [0, 1]], [[['JH'], '7C'], [0, 17]], [[['AC', 'TS'], 'TH'], [2, 21]], [[['4C', 'TD', 'JD'], '6S'], [0, 30]]], [[[[], '3S'], [0, 3]], [[['TD', '5S', 'AD'], 'AD'], [2, 17]], [[[], '5S'], [0, 5]], [[['6H', 'AD'], 'TD'], [0, 17]], [[['JC', 'JC', '3C'], '3C'], [2, 26]], [[['5C', '3S', '8D', '7D'], 'QC'], 'illegal'], [[['6D', '9H', '7D'], '8D'], [4, 30]], [[['QS'], 'TC'], [0, 20]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"pegging 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":"5d72010902837d09bac618e6de4e014563f59eb070bc95d9b545eaa1e7886196","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    pile, card = x\n    order = 'A23456789TJQK'\n    def val(c):\n        return min(order.index(c[0]) + 1, 10)\n    count = sum(val(c) for c in pile) + val(card)\n    if count > 31:\n        return 'illegal'\n    seq = pile + [card]\n    pts = 0\n    if count == 15:\n        pts += 2\n    if count == 31:\n        pts += 2\n    same = 1\n    for c in reversed(seq[:-1]):\n        if c[0] == card[0]:\n            same += 1\n        else:\n            break\n    pts += {1: 0, 2: 2, 3: 6, 4: 12}[same]\n    best = 0\n    for L in range(3, len(seq) + 1):\n        tail = sorted(order.index(c[0]) for c in seq[-L:])\n        if all(tail[i + 1] == tail[i] + 1 for i in range(L - 1)):\n            best = L\n    pts += best\n    return [pts, count]\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[[[['6H', 'QD', 'TH'], '4H'], [0, 30]], [[['4D', 'KS', '2C', 'TC'], 'TS'], 'illegal'], [[['JD', '8D', 'QD'], '9D'], 'illegal'], [[['8S', 'TD', '2H', 'QH'], '5S'], 'illegal'], [[['6S', '7D', '7C', 'KS'], '3C'], 'illegal'], [[['5C', '7H'], 'TS'], [0, 22]], [[['AC', 'AS', 'TS', '4C'], '4C'], [2, 20]], [[['6H', 'AD'], 'TD'], [0, 17]]], [[[[], '5D'], [0, 5]], [[['8C', '2D', '8S', '5H', 'AH'], 'AS'], [2, 25]], [[['5D', '4C', '3S', 'KS'], 'KC'], 'illegal'], [[['9C', '7D'], 'KD'], [0, 26]], [[[], '7C'], [0, 7]], [[['7H'], '7C'], [2, 14]], [[['QH', '2D'], 'JD'], [0, 22]], [[['6C', '4D', 'AD', '9S', '5D'], '5H'], [2, 30]]], [[[['5D', 'JD', '2S', '6H', 'AH'], '4C'], [0, 28]], [[['AD'], 'AS'], [2, 2]], [[['JC'], 'JD'], [2, 20]], [[['TS', '4H', '2H', '7S'], 'QD'], 'illegal'], [[['QS', '3C'], '3C'], [2, 16]], [[['QS', '7D', '6S'], '9S'], 'illegal'], [[['9D'], '9H'], [2, 18]], [[['TH', 'TC'], 'TH'], [6, 30]]], [[[['AD', '5H', 'KD', '6D'], '6S'], [2, 28]], [[['2H', '4S', 'TC', '6H', '8D'], '8H'], 'illegal'], [[['9D', '2C', 'TC'], 'KD'], [2, 31]], [[['AS', '2D'], 'JH'], [0, 13]], [[[], 'AD'], [0, 1]], [[['JH'], '7C'], [0, 17]], [[['AC', 'TS'], 'TH'], [2, 21]], [[['4C', 'TD', 'JD'], '6S'], [0, 30]]], [[[[], '3S'], [0, 3]], [[['TD', '5S', 'AD'], 'AD'], [2, 17]], [[[], '5S'], [0, 5]], [[['6H', 'AD'], 'TD'], [0, 17]], [[['JC', 'JC', '3C'], '3C'], [2, 26]], [[['5C', '3S', '8D', '7D'], 'QC'], 'illegal'], [[['6D', '9H', '7D'], '8D'], [4, 30]], [[['QS'], 'TC'], [0, 20]]]]\nfor i, (args, expected) in enumerate(fixtures[N-1]):\n    check(\"pegging 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-cribbage-peg-fifteen-during-play","generated_at":"2026-09-29T14:50:22.762674+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":"Only a count of exactly 15 scores.","root_cause":"The fifteen test uses a modulus.","sha256":"c7c48407312e7284b3d526980307addbbf47fcdda265944e343010ec10dea252","title":"Thirty also pegs as fifteen · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":43.019,"exit_code":1,"observations":[{"actual":[0,30],"check":"pegging case 0","expected":[0,30],"passed":true},{"actual":"illegal","check":"pegging case 1","expected":"illegal","passed":true},{"actual":"illegal","check":"pegging case 2","expected":"illegal","passed":true},{"actual":"illegal","check":"pegging case 3","expected":"illegal","passed":true},{"actual":"illegal","check":"pegging case 4","expected":"illegal","passed":true},{"actual":[2,22],"check":"pegging case 5","expected":[0,22],"passed":false},{"actual":[2,20],"check":"pegging case 6","expected":[2,20],"passed":true},{"actual":[2,17],"check":"pegging case 7","expected":[0,17],"passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"pegging case 0\", \"actual\": [0, 30], \"expected\": [0, 30], \"passed\": true}, {\"check\": \"pegging case 1\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 2\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 3\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 4\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 5\", \"actual\": [2, 22], \"expected\": [0, 22], \"passed\": false}, {\"check\": \"pegging case 6\", \"actual\": [2, 20], \"expected\": [2, 20], \"passed\": true}, {\"check\": \"pegging case 7\", \"actual\": [2, 17], \"expected\": [0, 17], \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.201,"exit_code":1,"observations":[{"actual":[2,30],"check":"pegging case 0","expected":[0,30],"passed":false},{"actual":"illegal","check":"pegging case 1","expected":"illegal","passed":true},{"actual":"illegal","check":"pegging case 2","expected":"illegal","passed":true},{"actual":"illegal","check":"pegging case 3","expected":"illegal","passed":true},{"actual":"illegal","check":"pegging case 4","expected":"illegal","passed":true},{"actual":[0,22],"check":"pegging case 5","expected":[0,22],"passed":true},{"actual":[2,20],"check":"pegging case 6","expected":[2,20],"passed":true},{"actual":[0,17],"check":"pegging case 7","expected":[0,17],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"pegging case 0\", \"actual\": [2, 30], \"expected\": [0, 30], \"passed\": false}, {\"check\": \"pegging case 1\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 2\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 3\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 4\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 5\", \"actual\": [0, 22], \"expected\": [0, 22], \"passed\": true}, {\"check\": \"pegging case 6\", \"actual\": [2, 20], \"expected\": [2, 20], \"passed\": true}, {\"check\": \"pegging case 7\", \"actual\": [0, 17], \"expected\": [0, 17], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":40.369,"exit_code":0,"observations":[{"actual":[0,30],"check":"pegging case 0","expected":[0,30],"passed":true},{"actual":"illegal","check":"pegging case 1","expected":"illegal","passed":true},{"actual":"illegal","check":"pegging case 2","expected":"illegal","passed":true},{"actual":"illegal","check":"pegging case 3","expected":"illegal","passed":true},{"actual":"illegal","check":"pegging case 4","expected":"illegal","passed":true},{"actual":[0,22],"check":"pegging case 5","expected":[0,22],"passed":true},{"actual":[2,20],"check":"pegging case 6","expected":[2,20],"passed":true},{"actual":[0,17],"check":"pegging case 7","expected":[0,17],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"pegging case 0\", \"actual\": [0, 30], \"expected\": [0, 30], \"passed\": true}, {\"check\": \"pegging case 1\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 2\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 3\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 4\", \"actual\": \"illegal\", \"expected\": \"illegal\", \"passed\": true}, {\"check\": \"pegging case 5\", \"actual\": [0, 22], \"expected\": [0, 22], \"passed\": true}, {\"check\": \"pegging case 6\", \"actual\": [2, 20], \"expected\": [2, 20], \"passed\": true}, {\"check\": \"pegging case 7\", \"actual\": [0, 17], \"expected\": [0, 17], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}