{"abstract":"Rights \"KH\" return [\"h1\", \"h1\"].","category":"Chess move legality","checks":8,"contract":"Input: {\"board\", \"rights\"}: rights letters are K/Q (outermost own rook on the back rank on the king's h-side / a-side), file letters A-H or a-h (the own rook on that file), or \"-\". A right only counts if the king is on its back rank (rank 1 for white, 8 for black) and the rook exists. Return the sorted distinct list of rook squares that carry castling rights.","evaluation_group":"w2-chess_move_legality-xfen-castling-rook-files","failed_approach":"Returning the raw list keeps duplicates and loses the ordering.","family":"w2-chess_move_legality-xfen-castling-rook-files-distinct-rook-squares","id":"FA-82771","implementations":{"attempt":{"sha256":"a81c23f64134eb7b4ae8c71d4dc8472be51d504b1eaf0070dc6eb1d4933844b7","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    b=x['board']; out=[]\n    for ch in x['rights']:\n        if ch=='-': continue\n        white=ch.isupper(); rank='1' if white else '8'\n        R='R' if white else 'r'; K='K' if white else 'k'\n        kfs=[s[0] for s,v in b.items() if v==K and s[1]==rank]\n        if not kfs: continue\n        kf=kfs[0]\n        rooks=sorted(s[0] for s,v in b.items() if v==R and s[1]==rank)\n        if ch.upper()=='K':\n            side=[f for f in rooks if f>kf]\n            if side: out.append(side[-1]+rank)\n        elif ch.upper()=='Q':\n            side=[f for f in rooks if f<kf]\n            if side: out.append(side[0]+rank)\n        elif ch.lower() in 'abcdefgh' and ch.lower() in rooks:\n            out.append(ch.lower()+rank)\n    return out\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('standard KQkq',\n   {'board': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'}, 'rights': 'KQkq'},\n   ['a1', 'a8', 'h1', 'h8']),\n  ('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('black file letters', {'board': {'b8': 'r', 'e1': 'K', 'g8': 'k', 'h8': 'r'}, 'rights': 'bh'},\n   ['b8', 'h8']),\n  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('file letter without rook', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'A'}, [])],\n [('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('file letter without rook', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'A'}, []),\n  ('dash', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': '-'}, []),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8']),\n  ('black king on white back rank',\n   {'board': {'a1': 'R', 'b8': 'K', 'd1': 'k', 'h8': 'r'}, 'rights': 'k'}, []),\n  ('black king on rank one', {'board': {'d1': 'k', 'e8': 'K', 'h1': 'r', 'h8': 'R'}, 'rights': 'k'},\n   [])],\n [('standard KQkq',\n   {'board': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'}, 'rights': 'KQkq'},\n   ['a1', 'a8', 'h1', 'h8']),\n  ('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('dash', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': '-'}, []),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8']),\n  ('black king on white back rank',\n   {'board': {'a1': 'R', 'b8': 'K', 'd1': 'k', 'h8': 'r'}, 'rights': 'k'}, []),\n  ('black king on rank one', {'board': {'d1': 'k', 'e8': 'K', 'h1': 'r', 'h8': 'R'}, 'rights': 'k'},\n   [])],\n [('standard KQkq',\n   {'board': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'}, 'rights': 'KQkq'},\n   ['a1', 'a8', 'h1', 'h8']),\n  ('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('black file letters', {'board': {'b8': 'r', 'e1': 'K', 'g8': 'k', 'h8': 'r'}, 'rights': 'bh'},\n   ['b8', 'h8']),\n  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8'])],\n [('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('black file letters', {'board': {'b8': 'r', 'e1': 'K', 'g8': 'k', 'h8': 'r'}, 'rights': 'bh'},\n   ['b8', 'h8']),\n  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('file letter without rook', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'A'}, []),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8'])]]\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":"198130452a8de1e02b6aa684d0c18a4e1fabc95fb1c9e696dbf191706fc43bf0","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    b=x['board']; out=[]\n    for ch in x['rights']:\n        if ch=='-': continue\n        white=ch.isupper(); rank='1' if white else '8'\n        R='R' if white else 'r'; K='K' if white else 'k'\n        kfs=[s[0] for s,v in b.items() if v==K and s[1]==rank]\n        if not kfs: continue\n        kf=kfs[0]\n        rooks=sorted(s[0] for s,v in b.items() if v==R and s[1]==rank)\n        if ch.upper()=='K':\n            side=[f for f in rooks if f>kf]\n            if side: out.append(side[-1]+rank)\n        elif ch.upper()=='Q':\n            side=[f for f in rooks if f<kf]\n            if side: out.append(side[0]+rank)\n        elif ch.lower() in 'abcdefgh' and ch.lower() in rooks:\n            out.append(ch.lower()+rank)\n    return sorted(out)\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('standard KQkq',\n   {'board': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'}, 'rights': 'KQkq'},\n   ['a1', 'a8', 'h1', 'h8']),\n  ('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('black file letters', {'board': {'b8': 'r', 'e1': 'K', 'g8': 'k', 'h8': 'r'}, 'rights': 'bh'},\n   ['b8', 'h8']),\n  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('file letter without rook', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'A'}, [])],\n [('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('file letter without rook', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'A'}, []),\n  ('dash', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': '-'}, []),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8']),\n  ('black king on white back rank',\n   {'board': {'a1': 'R', 'b8': 'K', 'd1': 'k', 'h8': 'r'}, 'rights': 'k'}, []),\n  ('black king on rank one', {'board': {'d1': 'k', 'e8': 'K', 'h1': 'r', 'h8': 'R'}, 'rights': 'k'},\n   [])],\n [('standard KQkq',\n   {'board': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'}, 'rights': 'KQkq'},\n   ['a1', 'a8', 'h1', 'h8']),\n  ('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('dash', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': '-'}, []),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8']),\n  ('black king on white back rank',\n   {'board': {'a1': 'R', 'b8': 'K', 'd1': 'k', 'h8': 'r'}, 'rights': 'k'}, []),\n  ('black king on rank one', {'board': {'d1': 'k', 'e8': 'K', 'h1': 'r', 'h8': 'R'}, 'rights': 'k'},\n   [])],\n [('standard KQkq',\n   {'board': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'}, 'rights': 'KQkq'},\n   ['a1', 'a8', 'h1', 'h8']),\n  ('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('black file letters', {'board': {'b8': 'r', 'e1': 'K', 'g8': 'k', 'h8': 'r'}, 'rights': 'bh'},\n   ['b8', 'h8']),\n  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8'])],\n [('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('black file letters', {'board': {'b8': 'r', 'e1': 'K', 'g8': 'k', 'h8': 'r'}, 'rights': 'bh'},\n   ['b8', 'h8']),\n  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('file letter without rook', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'A'}, []),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8'])]]\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":"6c83a26706e71a09832e6d6099c70184802e5d1348a3b4968979211d248f44a5","source":"\"\"\"Failure Map reference implementation. Python standard library only.\"\"\"\nimport json\n\nN = 1\nobservations = []\ndef solve(x):\n    b=x['board']; out=[]\n    for ch in x['rights']:\n        if ch=='-': continue\n        white=ch.isupper(); rank='1' if white else '8'\n        R='R' if white else 'r'; K='K' if white else 'k'\n        kfs=[s[0] for s,v in b.items() if v==K and s[1]==rank]\n        if not kfs: continue\n        kf=kfs[0]\n        rooks=sorted(s[0] for s,v in b.items() if v==R and s[1]==rank)\n        if ch.upper()=='K':\n            side=[f for f in rooks if f>kf]\n            if side: out.append(side[-1]+rank)\n        elif ch.upper()=='Q':\n            side=[f for f in rooks if f<kf]\n            if side: out.append(side[0]+rank)\n        elif ch.lower() in 'abcdefgh' and ch.lower() in rooks:\n            out.append(ch.lower()+rank)\n    return sorted(set(out))\ndef check(label, actual, expected):\n    observations.append({\"check\": label, \"actual\": actual, \"expected\": expected, \"passed\": actual == expected})\nfixtures = [[('standard KQkq',\n   {'board': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'}, 'rights': 'KQkq'},\n   ['a1', 'a8', 'h1', 'h8']),\n  ('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('black file letters', {'board': {'b8': 'r', 'e1': 'K', 'g8': 'k', 'h8': 'r'}, 'rights': 'bh'},\n   ['b8', 'h8']),\n  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('file letter without rook', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'A'}, [])],\n [('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('file letter without rook', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'A'}, []),\n  ('dash', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': '-'}, []),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8']),\n  ('black king on white back rank',\n   {'board': {'a1': 'R', 'b8': 'K', 'd1': 'k', 'h8': 'r'}, 'rights': 'k'}, []),\n  ('black king on rank one', {'board': {'d1': 'k', 'e8': 'K', 'h1': 'r', 'h8': 'R'}, 'rights': 'k'},\n   [])],\n [('standard KQkq',\n   {'board': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'}, 'rights': 'KQkq'},\n   ['a1', 'a8', 'h1', 'h8']),\n  ('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('dash', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': '-'}, []),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8']),\n  ('black king on white back rank',\n   {'board': {'a1': 'R', 'b8': 'K', 'd1': 'k', 'h8': 'r'}, 'rights': 'k'}, []),\n  ('black king on rank one', {'board': {'d1': 'k', 'e8': 'K', 'h1': 'r', 'h8': 'R'}, 'rights': 'k'},\n   [])],\n [('standard KQkq',\n   {'board': {'a1': 'R', 'a8': 'r', 'e1': 'K', 'e8': 'k', 'h1': 'R', 'h8': 'r'}, 'rights': 'KQkq'},\n   ['a1', 'a8', 'h1', 'h8']),\n  ('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('black file letters', {'board': {'b8': 'r', 'e1': 'K', 'g8': 'k', 'h8': 'r'}, 'rights': 'bh'},\n   ['b8', 'h8']),\n  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8'])],\n [('two rooks on h-side', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'},\n   ['h1']),\n  ('file letter inner rook', {'board': {'c1': 'K', 'e1': 'R', 'e8': 'k', 'h1': 'R'}, 'rights': 'E'},\n   ['e1']),\n  ('black file letters', {'board': {'b8': 'r', 'e1': 'K', 'g8': 'k', 'h8': 'r'}, 'rights': 'bh'},\n   ['b8', 'h8']),\n  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\n  ('king off back rank', {'board': {'e2': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'K'}, []),\n  ('duplicate K and H', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'KH'}, ['h1']),\n  ('file letter without rook', {'board': {'e1': 'K', 'e8': 'k', 'h1': 'R'}, 'rights': 'A'}, []),\n  ('black kq', {'board': {'a8': 'r', 'd8': 'k', 'e1': 'K', 'f8': 'r', 'g8': 'r'}, 'rights': 'kq'},\n   ['a8', 'g8'])]]\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; boards are {square: piece} with white upper-case and black lower-case pieces; no claim of full FIDE Laws conformance. 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-chess_move_legality-xfen-castling-rook-files-distinct-rook-squares","generated_at":"2026-09-29T14:50:15.287843+00:00","license":"CC0-1.0","python":"3.12.14","seed":1,"split":"open-access"},"relevance":"Chess960 and X-FEN positions encode castling by rook file; a wrong mapping castles with the wrong rook.","repair":"Return the sorted set of rook squares.","root_cause":"The rook squares are not de-duplicated.","sha256":"9dcec798ec04fe646dec2658cab6ec4112b4403a35f414a815269cb98ad57e3e","title":"Same rook listed twice for K and H · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":39.639,"exit_code":1,"observations":[{"actual":["h1","a1","h8","a8"],"check":"standard KQkq","expected":["a1","a8","h1","h8"],"passed":false},{"actual":["h1"],"check":"two rooks on h-side","expected":["h1"],"passed":true},{"actual":["e1"],"check":"file letter inner rook","expected":["e1"],"passed":true},{"actual":["b8","h8"],"check":"black file letters","expected":["b8","h8"],"passed":true},{"actual":[],"check":"K right but only a-side rook","expected":[],"passed":true},{"actual":[],"check":"king off back rank","expected":[],"passed":true},{"actual":["h1","h1"],"check":"duplicate K and H","expected":["h1"],"passed":false},{"actual":[],"check":"file letter without rook","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"standard KQkq\", \"actual\": [\"h1\", \"a1\", \"h8\", \"a8\"], \"expected\": [\"a1\", \"a8\", \"h1\", \"h8\"], \"passed\": false}, {\"check\": \"two rooks on h-side\", \"actual\": [\"h1\"], \"expected\": [\"h1\"], \"passed\": true}, {\"check\": \"file letter inner rook\", \"actual\": [\"e1\"], \"expected\": [\"e1\"], \"passed\": true}, {\"check\": \"black file letters\", \"actual\": [\"b8\", \"h8\"], \"expected\": [\"b8\", \"h8\"], \"passed\": true}, {\"check\": \"K right but only a-side rook\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"king off back rank\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"duplicate K and H\", \"actual\": [\"h1\", \"h1\"], \"expected\": [\"h1\"], \"passed\": false}, {\"check\": \"file letter without rook\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":45.823,"exit_code":1,"observations":[{"actual":["a1","a8","h1","h8"],"check":"standard KQkq","expected":["a1","a8","h1","h8"],"passed":true},{"actual":["h1"],"check":"two rooks on h-side","expected":["h1"],"passed":true},{"actual":["e1"],"check":"file letter inner rook","expected":["e1"],"passed":true},{"actual":["b8","h8"],"check":"black file letters","expected":["b8","h8"],"passed":true},{"actual":[],"check":"K right but only a-side rook","expected":[],"passed":true},{"actual":[],"check":"king off back rank","expected":[],"passed":true},{"actual":["h1","h1"],"check":"duplicate K and H","expected":["h1"],"passed":false},{"actual":[],"check":"file letter without rook","expected":[],"passed":true}],"passed":false,"stderr":"","stdout":"{\"observations\": [{\"check\": \"standard KQkq\", \"actual\": [\"a1\", \"a8\", \"h1\", \"h8\"], \"expected\": [\"a1\", \"a8\", \"h1\", \"h8\"], \"passed\": true}, {\"check\": \"two rooks on h-side\", \"actual\": [\"h1\"], \"expected\": [\"h1\"], \"passed\": true}, {\"check\": \"file letter inner rook\", \"actual\": [\"e1\"], \"expected\": [\"e1\"], \"passed\": true}, {\"check\": \"black file letters\", \"actual\": [\"b8\", \"h8\"], \"expected\": [\"b8\", \"h8\"], \"passed\": true}, {\"check\": \"K right but only a-side rook\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"king off back rank\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"duplicate K and H\", \"actual\": [\"h1\", \"h1\"], \"expected\": [\"h1\"], \"passed\": false}, {\"check\": \"file letter without rook\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": false}\n"},"fixed":{"elapsed_ms":42.156,"exit_code":0,"observations":[{"actual":["a1","a8","h1","h8"],"check":"standard KQkq","expected":["a1","a8","h1","h8"],"passed":true},{"actual":["h1"],"check":"two rooks on h-side","expected":["h1"],"passed":true},{"actual":["e1"],"check":"file letter inner rook","expected":["e1"],"passed":true},{"actual":["b8","h8"],"check":"black file letters","expected":["b8","h8"],"passed":true},{"actual":[],"check":"K right but only a-side rook","expected":[],"passed":true},{"actual":[],"check":"king off back rank","expected":[],"passed":true},{"actual":["h1"],"check":"duplicate K and H","expected":["h1"],"passed":true},{"actual":[],"check":"file letter without rook","expected":[],"passed":true}],"passed":true,"stderr":"","stdout":"{\"observations\": [{\"check\": \"standard KQkq\", \"actual\": [\"a1\", \"a8\", \"h1\", \"h8\"], \"expected\": [\"a1\", \"a8\", \"h1\", \"h8\"], \"passed\": true}, {\"check\": \"two rooks on h-side\", \"actual\": [\"h1\"], \"expected\": [\"h1\"], \"passed\": true}, {\"check\": \"file letter inner rook\", \"actual\": [\"e1\"], \"expected\": [\"e1\"], \"passed\": true}, {\"check\": \"black file letters\", \"actual\": [\"b8\", \"h8\"], \"expected\": [\"b8\", \"h8\"], \"passed\": true}, {\"check\": \"K right but only a-side rook\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"king off back rank\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"duplicate K and H\", \"actual\": [\"h1\"], \"expected\": [\"h1\"], \"passed\": true}, {\"check\": \"file letter without rook\", \"actual\": [], \"expected\": [], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}