"""Row layout of the Jev Skills dataset: categories, `category/skill` ids, licence ids (shared by the release script and the rebuild check).""" import json CATEGORIES = ("agents", "rules", "games_spatial", "safety", "judging") # generator skill -> (category, public skill name), in dataset order SKILL_MAP = { "tools": ("agents", "tools"), "agent_action": ("agents", "agent_action"), "browser": ("agents", "browser"), "admission": ("rules", "admission"), "rental": ("rules", "rental"), "agent_rules": ("rules", "agent_rules"), "authority": ("rules", "authority"), "fraud_points": ("rules", "fraud_points"), "sharc": ("rules", "sharc"), "patent_phrases": ("rules", "patent_phrases"), "missing_facts": ("rules", "missing_facts"), "game_q": ("games_spatial", "game_moves_facts_in_question"), "game_s": ("games_spatial", "game_moves_facts_in_state"), "game_rule": ("games_spatial", "game_rules"), "spatial_coord": ("games_spatial", "spatial_coordinates"), "spatial_grid": ("games_spatial", "spatial_grids"), "chess": ("games_spatial", "chess"), "games_internal": ("games_spatial", "small_games"), "injection": ("safety", "prompt_injection"), "safety": ("safety", "content_safety"), "judging": ("judging", "response_judging"), "grounding": ("judging", "grounding"), } ORDER = {k: i for i, k in enumerate(SKILL_MAP)} LICENSES = { "CC0-1.0 (generated by code)": "CC0-1.0", "CC0-1.0": "CC0-1.0", "CC0-1.0 (Lichess puzzles; ChessBench test set, Apache-2.0)": "CC0-1.0", "CC-BY-SA-3.0 (ShARC)": "CC-BY-SA-3.0", "CC-BY-4.0 (USPTO PPM)": "CC-BY-4.0", "CC-BY-4.0 (When2Call)": "CC-BY-4.0", "Apache-2.0 (BFCL)": "Apache-2.0", "Apache-2.0": "Apache-2.0", "ODC-BY (RewardBench)": "ODC-BY-1.0", "MIT (OpenAI moderation evaluation set)": "MIT", "MIT": "MIT", "CC-BY-4.0": "CC-BY-4.0", "CC-BY-SA-4.0": "CC-BY-SA-4.0", "CC-BY-SA-3.0": "CC-BY-SA-3.0", "ODC-BY-1.0": "ODC-BY-1.0", } def to_row(x: dict) -> dict: cat, sk = SKILL_MAP[x["skill"]] return {"id": x["id"], "category": cat, "skill": f"{cat}/{sk}", "source": x["source"], "split": x.get("split", "public"), "state": x["state"], "questions": json.dumps(x["questions"], ensure_ascii=False), "targets": json.dumps(x["targets"], ensure_ascii=False), "license": LICENSES[x["license"]], "pick": bool(x.get("pick", False)), "variant": x.get("variant")} def sort_key(r: dict): return (CATEGORIES.index(r["category"]), ORDER[next(k for k, (c, s) in SKILL_MAP.items() if f"{c}/{s}" == r["skill"])], r["id"])