Skip to content

abc_runner.config

WARNING

This documentation is almost entirely "vibe coded"; while a helpful resource for humans and agents to understand this codebase, it should not be considered a source of ground truth in the way documentation normally is, and the user is responsible for verifying that all instructions given here are safe.

abc_runner.config

Configuration loading and management for ABC Runner.

ABC Runner builds on :class:automaton.AutomatonConfig, which owns the provider/model/agent/harness configuration and sandbox execution defaults. This module extends it with benchmark-orchestration concerns: locating the package root (harnesses/ and container base/harness templates) and the results directory, and building the task-group resolver.

Task groups themselves are not part of the package root; they are discovered via :class:abc_runner.groups.GroupResolver (CLI --task-dir > TASK_PATH

the installed ~/.abc-runner/tasks root populated by abc-runner install).

Config

Config(config_path: Path | None = None)

Bases: AutomatonConfig

ABC Runner configuration.

Extends :class:automaton.AutomatonConfig (providers/models/agents/harnesses and sandbox defaults) with package-root and results-directory resolution and task-group resolver construction.

Examples:

>>> config = Config()
>>> model = config.get_model("example-model")
>>> model["provider"]
'example'

Load configuration from file or use the ABC Runner default location.

Source code in abc_runner/config.py
def __init__(self, config_path: Path | None = None):
    """Load configuration from file or use the ABC Runner default location."""
    if config_path is None:
        config_path = initialize_user_config()
    super().__init__(config_path)

results_dir property

results_dir: Path

Get results directory path.

memory_cgroup property

memory_cgroup: bool

Whether runs are memory-capped with a cgroup rather than ulimit -v.

package_root property

package_root: Path

Root containing harnesses/ and containers/.

installed_root property

installed_root: Path

Installed task-group root (~/.abc-runner/tasks).

group_resolver

group_resolver(task_dir: Path | None = None, warn: bool = True) -> GroupResolver

Build a task-group resolver honoring CLI > TASK_PATH > installed.

Source code in abc_runner/config.py
def group_resolver(self, task_dir: Path | None = None, warn: bool = True) -> GroupResolver:
    """Build a task-group resolver honoring CLI > TASK_PATH > installed."""
    return GroupResolver(
        task_dir=task_dir,
        installed_root=self.installed_root,
        warn=warn,
    )

get_package_root

get_package_root() -> Path

Return the root holding harnesses/ and containers/.

These are ABC Runner-owned runtime assets (not benchmarks). abc_runner is not a published package, so these always live in a checkout. Resolution order:

  1. ABC_RUNNER_PACKAGE_ROOT environment variable
  2. Parent directory of the abc_runner package (editable/checkout install)
Source code in abc_runner/config.py
def get_package_root() -> Path:
    """Return the root holding ``harnesses/`` and ``containers/``.

    These are ABC Runner-owned runtime assets (not benchmarks). abc_runner is not
    a published package, so these always live in a checkout. Resolution order:

    1. ``ABC_RUNNER_PACKAGE_ROOT`` environment variable
    2. Parent directory of the ``abc_runner`` package (editable/checkout install)
    """
    env_root = os.environ.get("ABC_RUNNER_PACKAGE_ROOT")
    if env_root:
        root = Path(env_root).expanduser().resolve()
        if (root / "harnesses").is_dir() and (root / "containers").is_dir():
            return root

    repo_root = _repo_root_package_root()
    if repo_root is not None:
        return repo_root

    return Path.cwd()

initialize_user_config

initialize_user_config() -> Path

Create the default ABC Runner user config directory and template if missing.

Returns:

Type Description
Path

Path to the created config file

Source code in abc_runner/config.py
def initialize_user_config() -> Path:
    """Create the default ABC Runner user config directory and template if missing.

    Returns
    -------
    Path
        Path to the created config file
    """
    config_dir = DEFAULT_CONFIG_DIR.expanduser()
    config_path = DEFAULT_CONFIG_PATH.expanduser()

    config_dir.mkdir(parents=True, exist_ok=True)
    if not config_path.exists():
        config_path.write_text(DEFAULT_CONFIG_TEMPLATE)

    return config_path