{"abstract":"A card with no rank or a rank token \"KQ\" produces a hand label instead of \"invalid\".","category":"Poker hand evaluation","checks":8,"contract":"Input: two hole cards as strings (rank may be \"10\"; rank and suit case-insensitive). Return canonical hold'em notation: pairs \"QQ\", otherwise higher rank first with \"s\" for suited or \"o\" for offsuit (e.g. \"AKs\", \"T9o\"). Return \"invalid\" for duplicate cards or unknown ranks.","evaluation_group":"w2-poker_hand_evaluation-starting-hand-notation","failed_approach":"Rejecting only empty tokens still accepts multi-letter substrings such as \"KQ\".","family":"w2-poker_hand_evaluation-starting-hand-notation-rank-membership-test","id":"FA-82116","implementations":{"attempt":{"sha256":"231b922764ebae60349e8bde3f31c51cf0b8df82f010d4505622b9941d47f415","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'\n    if len(x)!=2 or x[0].upper()==x[1].upper(): return 'invalid'\n    def rank(c):\n        t=c[:-1].upper()\n        return 'T' if t=='10' else t\n    a,b=rank(x[0]),rank(x[1])\n    if not a or not b: return 'invalid'\n    if a==b: return a+b\n    hi,lo=sorted([a,b], key=R.index, reverse=True)\n    return hi+lo+('s' if x[0][-1].lower()==x[1][-1].lower() else 'o')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),\n  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),\n  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),\n  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid')],\n [('nine ten mixed', ['9c', '10d'], 'T9o'), ('pair of queens', ['Qh', 'Qs'], 'QQ'),\n  ('duplicate card case', ['Ah', 'aH'], 'invalid'), ('exact duplicate', ['7c', '7c'], 'invalid'),\n  ('queen ten', ['Tc', 'Qc'], 'QTs'), ('lower case ranks', ['kd', 'js'], 'KJo'),\n  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid')],\n [('exact duplicate', ['7c', '7c'], 'invalid'), ('queen ten', ['Tc', 'Qc'], 'QTs'),\n  ('lower case ranks', ['kd', 'js'], 'KJo'), ('suit case differs', ['Jh', 'TH'], 'JTs'),\n  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid'),\n  ('ten first suited', ['10h', 'Jh'], 'JTs'), ('deuce seven', ['2d', '7s'], '72o')],\n [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),\n  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('empty rank', ['h', 'Kd'], 'invalid'),\n  ('two-letter rank', ['KQh', '2d'], 'invalid'), ('ten first suited', ['10h', 'Jh'], 'JTs'),\n  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],\n [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),\n  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),\n  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('empty rank', ['h', 'Kd'], 'invalid'),\n  ('two-letter rank', ['KQh', '2d'], 'invalid'),\n  ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'error:' + type(exc).__name__\n    check(label, actual, 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":"178a91e2733b3edcb19b439cf6a05204509037cf0afde7ffa83cabad2f781da1","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'\n    if len(x)!=2 or x[0].upper()==x[1].upper(): return 'invalid'\n    def rank(c):\n        t=c[:-1].upper()\n        return 'T' if t=='10' else t\n    a,b=rank(x[0]),rank(x[1])\n    if a not in R or b not in R: return 'invalid'\n    if a==b: return a+b\n    hi,lo=sorted([a,b], key=R.index, reverse=True)\n    return hi+lo+('s' if x[0][-1].lower()==x[1][-1].lower() else 'o')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),\n  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),\n  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),\n  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid')],\n [('nine ten mixed', ['9c', '10d'], 'T9o'), ('pair of queens', ['Qh', 'Qs'], 'QQ'),\n  ('duplicate card case', ['Ah', 'aH'], 'invalid'), ('exact duplicate', ['7c', '7c'], 'invalid'),\n  ('queen ten', ['Tc', 'Qc'], 'QTs'), ('lower case ranks', ['kd', 'js'], 'KJo'),\n  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid')],\n [('exact duplicate', ['7c', '7c'], 'invalid'), ('queen ten', ['Tc', 'Qc'], 'QTs'),\n  ('lower case ranks', ['kd', 'js'], 'KJo'), ('suit case differs', ['Jh', 'TH'], 'JTs'),\n  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid'),\n  ('ten first suited', ['10h', 'Jh'], 'JTs'), ('deuce seven', ['2d', '7s'], '72o')],\n [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),\n  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('empty rank', ['h', 'Kd'], 'invalid'),\n  ('two-letter rank', ['KQh', '2d'], 'invalid'), ('ten first suited', ['10h', 'Jh'], 'JTs'),\n  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],\n [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),\n  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),\n  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('empty rank', ['h', 'Kd'], 'invalid'),\n  ('two-letter rank', ['KQh', '2d'], 'invalid'),\n  ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'error:' + type(exc).__name__\n    check(label, actual, 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":"ad643207e854f95affabeaa0312bd78b89abe043f6b5e21d25f72183c526dd66","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    R='23456789TJQKA'\n    if len(x)!=2 or x[0].upper()==x[1].upper(): return 'invalid'\n    def rank(c):\n        t=c[:-1].upper()\n        return 'T' if t=='10' else t\n    a,b=rank(x[0]),rank(x[1])\n    if a not in list(R) or b not in list(R): return 'invalid'\n    if a==b: return a+b\n    hi,lo=sorted([a,b], key=R.index, reverse=True)\n    return hi+lo+('s' if x[0][-1].lower()==x[1][-1].lower() else 'o')\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),\n  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),\n  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),\n  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid')],\n [('nine ten mixed', ['9c', '10d'], 'T9o'), ('pair of queens', ['Qh', 'Qs'], 'QQ'),\n  ('duplicate card case', ['Ah', 'aH'], 'invalid'), ('exact duplicate', ['7c', '7c'], 'invalid'),\n  ('queen ten', ['Tc', 'Qc'], 'QTs'), ('lower case ranks', ['kd', 'js'], 'KJo'),\n  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid')],\n [('exact duplicate', ['7c', '7c'], 'invalid'), ('queen ten', ['Tc', 'Qc'], 'QTs'),\n  ('lower case ranks', ['kd', 'js'], 'KJo'), ('suit case differs', ['Jh', 'TH'], 'JTs'),\n  ('empty rank', ['h', 'Kd'], 'invalid'), ('two-letter rank', ['KQh', '2d'], 'invalid'),\n  ('ten first suited', ['10h', 'Jh'], 'JTs'), ('deuce seven', ['2d', '7s'], '72o')],\n [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),\n  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('empty rank', ['h', 'Kd'], 'invalid'),\n  ('two-letter rank', ['KQh', '2d'], 'invalid'), ('ten first suited', ['10h', 'Jh'], 'JTs'),\n  ('deuce seven', ['2d', '7s'], '72o'), ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')],\n [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('king ace offsuit order', ['Kd', 'Ah'], 'AKo'),\n  ('ten nine suited with 10', ['10s', '9s'], 'T9s'), ('nine ten mixed', ['9c', '10d'], 'T9o'),\n  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('empty rank', ['h', 'Kd'], 'invalid'),\n  ('two-letter rank', ['KQh', '2d'], 'invalid'),\n  ('pair of tens mixed tokens', ['10h', 'Td'], 'TT')]]\nfor label, args, expected in fixtures[N-1]:\n    try:\n        actual = solve(args)\n    except Exception as exc:\n        actual = 'error:' + type(exc).__name__\n    check(label, actual, 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 deterministic toy model with an explicitly stated contract; card strings are rank+suit (for example \"As\", \"Td\"); no claim of conformance to any casino or tournament rulebook. 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-poker_hand_evaluation-starting-hand-notation-rank-membership-test","generated_at":"2026-09-29T14:50:09.179351+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Range tools, solvers and hand histories key statistics on this notation.","repair":"Test membership against the list of single rank characters.","root_cause":"Membership is tested against the rank string, so any substring (including \"\") passes.","sha256":"7e581daf18468f7f5e6a397528a34c06aee77113327ea11ba9a10996a8b239d0","title":"Substring test accepts empty and multi-letter ranks · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.637,"exit_code":1,"observations":[{"actual":"AKs","check":"ace king suited","expected":"AKs","passed":true},{"actual":"AKo","check":"king ace offsuit order","expected":"AKo","passed":true},{"actual":"T9s","check":"ten nine suited with 10","expected":"T9s","passed":true},{"actual":"T9o","check":"nine ten mixed","expected":"T9o","passed":true},{"actual":"QQ","check":"pair of queens","expected":"QQ","passed":true},{"actual":"invalid","check":"duplicate card case","expected":"invalid","passed":true},{"actual":"invalid","check":"empty rank","expected":"invalid","passed":true},{"actual":"error:ValueError","check":"two-letter rank","expected":"invalid","passed":false}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ace king suited\", \"actual\": \"AKs\", \"expected\": \"AKs\", \"passed\": true}, {\"check\": \"king ace offsuit order\", \"actual\": \"AKo\", \"expected\": \"AKo\", \"passed\": true}, {\"check\": \"ten nine suited with 10\", \"actual\": \"T9s\", \"expected\": \"T9s\", \"passed\": true}, {\"check\": \"nine ten mixed\", \"actual\": \"T9o\", \"expected\": \"T9o\", \"passed\": true}, {\"check\": \"pair of queens\", \"actual\": \"QQ\", \"expected\": \"QQ\", \"passed\": true}, {\"check\": \"duplicate card case\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"empty rank\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"two-letter rank\", \"actual\": \"error:ValueError\", \"expected\": \"invalid\", \"passed\": false}], \"passed\": false}\n"},"broken":{"elapsed_ms":41.335,"exit_code":1,"observations":[{"actual":"AKs","check":"ace king suited","expected":"AKs","passed":true},{"actual":"AKo","check":"king ace offsuit order","expected":"AKo","passed":true},{"actual":"T9s","check":"ten nine suited with 10","expected":"T9s","passed":true},{"actual":"T9o","check":"nine ten mixed","expected":"T9o","passed":true},{"actual":"QQ","check":"pair of queens","expected":"QQ","passed":true},{"actual":"invalid","check":"duplicate card case","expected":"invalid","passed":true},{"actual":"Ko","check":"empty rank","expected":"invalid","passed":false},{"actual":"invalid","check":"two-letter rank","expected":"invalid","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ace king suited\", \"actual\": \"AKs\", \"expected\": \"AKs\", \"passed\": true}, {\"check\": \"king ace offsuit order\", \"actual\": \"AKo\", \"expected\": \"AKo\", \"passed\": true}, {\"check\": \"ten nine suited with 10\", \"actual\": \"T9s\", \"expected\": \"T9s\", \"passed\": true}, {\"check\": \"nine ten mixed\", \"actual\": \"T9o\", \"expected\": \"T9o\", \"passed\": true}, {\"check\": \"pair of queens\", \"actual\": \"QQ\", \"expected\": \"QQ\", \"passed\": true}, {\"check\": \"duplicate card case\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"empty rank\", \"actual\": \"Ko\", \"expected\": \"invalid\", \"passed\": false}, {\"check\": \"two-letter rank\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.044,"exit_code":0,"observations":[{"actual":"AKs","check":"ace king suited","expected":"AKs","passed":true},{"actual":"AKo","check":"king ace offsuit order","expected":"AKo","passed":true},{"actual":"T9s","check":"ten nine suited with 10","expected":"T9s","passed":true},{"actual":"T9o","check":"nine ten mixed","expected":"T9o","passed":true},{"actual":"QQ","check":"pair of queens","expected":"QQ","passed":true},{"actual":"invalid","check":"duplicate card case","expected":"invalid","passed":true},{"actual":"invalid","check":"empty rank","expected":"invalid","passed":true},{"actual":"invalid","check":"two-letter rank","expected":"invalid","passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ace king suited\", \"actual\": \"AKs\", \"expected\": \"AKs\", \"passed\": true}, {\"check\": \"king ace offsuit order\", \"actual\": \"AKo\", \"expected\": \"AKo\", \"passed\": true}, {\"check\": \"ten nine suited with 10\", \"actual\": \"T9s\", \"expected\": \"T9s\", \"passed\": true}, {\"check\": \"nine ten mixed\", \"actual\": \"T9o\", \"expected\": \"T9o\", \"passed\": true}, {\"check\": \"pair of queens\", \"actual\": \"QQ\", \"expected\": \"QQ\", \"passed\": true}, {\"check\": \"duplicate card case\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"empty rank\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"two-letter rank\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}