{"abstract":"Queen-ten is written \"TQs\" and ace-king \"KAo\".","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.","contract_signature":"x","evaluation_group":"w2-poker_hand_evaluation-starting-hand-notation","failed_approach":"Sorting by rank strength ascending puts the lower card first.","family":"w2-poker_hand_evaluation-starting-hand-notation-rank-ordering-key","id":"FA-82101","implementations":{"attempt":{"sha256":"4b35c062243345fb9f2080398f8cbe2c7e2071d2ad3fa0191f20b7f7d261872d","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)\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  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),\n  ('exact duplicate', ['7c', '7c'], 'invalid'), ('empty rank', ['h', 'Kd'], 'invalid'),\n  ('two-letter rank', ['KQh', '2d'], 'invalid'),\n  ('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  ('queen ten', ['Tc', 'Qc'], 'QTs'), ('empty rank', ['h', 'Kd'], 'invalid'),\n  ('two-letter rank', ['KQh', '2d'], 'invalid'),\n  ('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  ('queen ten', ['Tc', 'Qc'], 'QTs'), ('lower case ranks', ['kd', 'js'], 'KJo'),\n  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')],\n [('nine ten mixed', ['9c', '10d'], 'T9o'), ('pair of queens', ['Qh', 'Qs'], 'QQ'),\n  ('duplicate card case', ['Ah', 'aH'], 'invalid'), ('queen ten', ['Tc', 'Qc'], 'QTs'),\n  ('lower case ranks', ['kd', 'js'], 'KJo'), ('suit case differs', ['Jh', 'TH'], 'JTs'),\n  ('ten first suited', ['10h', 'Jh'], 'JTs'), ('deuce seven', ['2d', '7s'], '72o')],\n [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('pair of queens', ['Qh', 'Qs'], 'QQ'),\n  ('duplicate card case', ['Ah', 'aH'], 'invalid'), ('queen ten', ['Tc', 'Qc'], 'QTs'),\n  ('lower case ranks', ['kd', 'js'], 'KJo'), ('suit case differs', ['Jh', 'TH'], 'JTs'),\n  ('ten first suited', ['10h', 'Jh'], 'JTs'), ('deuce seven', ['2d', '7s'], '72o')]]\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":"c44d999b1ca76e3556e0dbd721712d542db69dd181837cffe96c29e1a39ff5e8","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], 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  ('pair of queens', ['Qh', 'Qs'], 'QQ'), ('duplicate card case', ['Ah', 'aH'], 'invalid'),\n  ('exact duplicate', ['7c', '7c'], 'invalid'), ('empty rank', ['h', 'Kd'], 'invalid'),\n  ('two-letter rank', ['KQh', '2d'], 'invalid'),\n  ('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  ('queen ten', ['Tc', 'Qc'], 'QTs'), ('empty rank', ['h', 'Kd'], 'invalid'),\n  ('two-letter rank', ['KQh', '2d'], 'invalid'),\n  ('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  ('queen ten', ['Tc', 'Qc'], 'QTs'), ('lower case ranks', ['kd', 'js'], 'KJo'),\n  ('suit case differs', ['Jh', 'TH'], 'JTs'), ('ten first suited', ['10h', 'Jh'], 'JTs')],\n [('nine ten mixed', ['9c', '10d'], 'T9o'), ('pair of queens', ['Qh', 'Qs'], 'QQ'),\n  ('duplicate card case', ['Ah', 'aH'], 'invalid'), ('queen ten', ['Tc', 'Qc'], 'QTs'),\n  ('lower case ranks', ['kd', 'js'], 'KJo'), ('suit case differs', ['Jh', 'TH'], 'JTs'),\n  ('ten first suited', ['10h', 'Jh'], 'JTs'), ('deuce seven', ['2d', '7s'], '72o')],\n [('ace king suited', ['Ah', 'Kh'], 'AKs'), ('pair of queens', ['Qh', 'Qs'], 'QQ'),\n  ('duplicate card case', ['Ah', 'aH'], 'invalid'), ('queen ten', ['Tc', 'Qc'], 'QTs'),\n  ('lower case ranks', ['kd', 'js'], 'KJo'), ('suit case differs', ['Jh', 'TH'], 'JTs'),\n  ('ten first suited', ['10h', 'Jh'], 'JTs'), ('deuce seven', ['2d', '7s'], '72o')]]\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-ordering-key","generated_at":"2026-09-29T14:50:08.911830+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.","root_cause":"The two ranks are sorted as characters, where T sorts after Q and K after A.","sha256":"d18c6cf67dd81414aed77e6c7787f87c77d2e265a073642d7c027709354b9d32","title":"Ranks ordered alphabetically instead of by strength · 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":39.627,"exit_code":1,"observations":[{"actual":"KAs","check":"ace king suited","expected":"AKs","passed":false},{"actual":"KAo","check":"king ace offsuit order","expected":"AKo","passed":false},{"actual":"QQ","check":"pair of queens","expected":"QQ","passed":true},{"actual":"invalid","check":"duplicate card case","expected":"invalid","passed":true},{"actual":"invalid","check":"exact duplicate","expected":"invalid","passed":true},{"actual":"invalid","check":"empty rank","expected":"invalid","passed":true},{"actual":"invalid","check":"two-letter rank","expected":"invalid","passed":true},{"actual":"TT","check":"pair of tens mixed tokens","expected":"TT","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ace king suited\", \"actual\": \"KAs\", \"expected\": \"AKs\", \"passed\": false}, {\"check\": \"king ace offsuit order\", \"actual\": \"KAo\", \"expected\": \"AKo\", \"passed\": false}, {\"check\": \"pair of queens\", \"actual\": \"QQ\", \"expected\": \"QQ\", \"passed\": true}, {\"check\": \"duplicate card case\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"exact duplicate\", \"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}, {\"check\": \"pair of tens mixed tokens\", \"actual\": \"TT\", \"expected\": \"TT\", \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":40.533,"exit_code":1,"observations":[{"actual":"KAs","check":"ace king suited","expected":"AKs","passed":false},{"actual":"KAo","check":"king ace offsuit order","expected":"AKo","passed":false},{"actual":"QQ","check":"pair of queens","expected":"QQ","passed":true},{"actual":"invalid","check":"duplicate card case","expected":"invalid","passed":true},{"actual":"invalid","check":"exact duplicate","expected":"invalid","passed":true},{"actual":"invalid","check":"empty rank","expected":"invalid","passed":true},{"actual":"invalid","check":"two-letter rank","expected":"invalid","passed":true},{"actual":"TT","check":"pair of tens mixed tokens","expected":"TT","passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"ace king suited\", \"actual\": \"KAs\", \"expected\": \"AKs\", \"passed\": false}, {\"check\": \"king ace offsuit order\", \"actual\": \"KAo\", \"expected\": \"AKo\", \"passed\": false}, {\"check\": \"pair of queens\", \"actual\": \"QQ\", \"expected\": \"QQ\", \"passed\": true}, {\"check\": \"duplicate card case\", \"actual\": \"invalid\", \"expected\": \"invalid\", \"passed\": true}, {\"check\": \"exact duplicate\", \"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}, {\"check\": \"pair of tens mixed tokens\", \"actual\": \"TT\", \"expected\": \"TT\", \"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."}}