{"abstract":"With rooks on e1 and h1 and the king on c1, the K right maps to e1.","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":"Taking the outermost rook overall can pick a rook on the a-side.","family":"w2-chess_move_legality-xfen-castling-rook-files-outermost-kingside-rook","id":"FA-82751","implementations":{"attempt":{"sha256":"1863c849cdf0e2f1f0cbde74b00f659c843d355089997595024a86bc5b31a212","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 rooks: out.append(rooks[-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  ('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  ('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 [('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  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\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 [('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'])]]\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":"5c56e83db614cc8c589120091ae301bc57160de83746723ab1aba8dd9dc1e58f","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[0]+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  ('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  ('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 [('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  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\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 [('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'])]]\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":"5855aadc1fe68a94f26180a14c1eea34859ddf2921f38f4fc605e2c75711e729","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  ('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  ('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 [('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  ('K right but only a-side rook', {'board': {'a1': 'R', 'e8': 'k', 'g1': 'K'}, 'rights': 'K'}, []),\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 [('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'])]]\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-outermost-kingside-rook","generated_at":"2026-09-29T14:50:15.121250+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":"K denotes the outermost rook on the king's h-side.","root_cause":"The first rook beyond the king is chosen instead of the outermost one.","sha256":"7363ccdd4de6083d01b70cba4dfb7ea64043a0b71e69fcd2facf38c96c721d88","title":"K right assigned to the inner rook · case 01","variant":1,"variant_policy":"Five numbered records share a model and may reuse boundary fixtures.","verification":{"attempt":{"elapsed_ms":41.247,"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":["a1"],"check":"K right but only a-side rook","expected":[],"passed":false},{"actual":[],"check":"king off back rank","expected":[],"passed":true},{"actual":["h1"],"check":"duplicate K and H","expected":["h1"],"passed":true},{"actual":["a8","g8"],"check":"black kq","expected":["a8","g8"],"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\": [\"a1\"], \"expected\": [], \"passed\": false}, {\"check\": \"king off back rank\", \"actual\": [], \"expected\": [], \"passed\": true}, {\"check\": \"duplicate K and H\", \"actual\": [\"h1\"], \"expected\": [\"h1\"], \"passed\": true}, {\"check\": \"black kq\", \"actual\": [\"a8\", \"g8\"], \"expected\": [\"a8\", \"g8\"], \"passed\": true}], \"passed\": false}\n"},"broken":{"elapsed_ms":39.474,"exit_code":1,"observations":[{"actual":["a1","a8","h1","h8"],"check":"standard KQkq","expected":["a1","a8","h1","h8"],"passed":true},{"actual":["e1"],"check":"two rooks on h-side","expected":["h1"],"passed":false},{"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":["a8","f8"],"check":"black kq","expected":["a8","g8"],"passed":false}],"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\": [\"e1\"], \"expected\": [\"h1\"], \"passed\": false}, {\"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\": \"black kq\", \"actual\": [\"a8\", \"f8\"], \"expected\": [\"a8\", \"g8\"], \"passed\": false}], \"passed\": false}\n"},"fixed":{"elapsed_ms":41.649,"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":["a8","g8"],"check":"black kq","expected":["a8","g8"],"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\": \"black kq\", \"actual\": [\"a8\", \"g8\"], \"expected\": [\"a8\", \"g8\"], \"passed\": true}], \"passed\": true}\n"}},"verified":true,"visibility":"public"}