Skip to content

The first exam for code agents in the physical world: frozen robot tasks from many benchmark suites, each answered with a program and verified in a separate sandbox. Runs on Harbor.

665 B
Raw Blame
"""Resolve task-owned offline object assets in authoring and frozen copies."""

from pathlib import Path


def asset_dir(spec):
    here = Path(__file__).resolve().parent
    authoring = here.parent / "task_library" / spec["id"] / "assets"
    if authoring.is_dir():
        return authoring
    return here / "object_assets" / spec["id"]


def asset_path(spec, filename):
    relative = Path(filename)
    if relative.is_absolute() or ".." in relative.parts:
        raise ValueError("Object assets must use task-relative paths")
    path = asset_dir(spec) / relative
    if not path.is_file():
        raise FileNotFoundError(path)
    return str(path.resolve())