MCPcopy Create free account
hub / github.com/claw-bench/claw-bench / normalize_task_data

Function normalize_task_data

scripts/validate_all_tasks.py:97–110  ·  view source on GitHub ↗

Normalize task.toml into the same shape used by the runtime loader.

(raw: dict, task_dir: Path)

Source from the content-addressed store, hash-verified

95
96
97def normalize_task_data(raw: dict, task_dir: Path) -> dict:
98 """Normalize task.toml into the same shape used by the runtime loader."""
99 data = dict(raw)
100
101 # Current tasks may use either top-level keys or a [task] table.
102 # The runtime loader merges [task] into the top level, so CI should
103 # validate the same effective task definition.
104 task_section = data.pop("task", None)
105 if isinstance(task_section, dict):
106 for key, value in task_section.items():
107 data.setdefault(key, value)
108
109 data.setdefault("id", task_dir.name)
110 return data
111
112
113def validate_task_dir(task_dir: Path, schema: dict) -> list[str]:

Callers 1

validate_task_dirFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected