File size: 664 Bytes
14954f2
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
from __future__ import annotations

from typing import Any


TASK_EXTENSION_REQUIREMENTS = frozenset(
    {
        "rubric",
        "failure_taxonomy",
        "sampling_policy",
        "cleaner_policy",
        "audit_policy",
        "export_schema",
    }
)


def validate_task_extension(task: str, artifacts: dict[str, Any]) -> dict[str, Any]:
    missing = sorted(requirement for requirement in TASK_EXTENSION_REQUIREMENTS if not artifacts.get(requirement))
    if missing:
        raise ValueError(f"Task extension {task} is blocked; missing artifacts: {missing}")
    return {"task": task, "status": "ready_for_controlled_pilot", "artifacts": artifacts}