abhigyanpatwari/GitNexus · error · ValueError

promotion binding has no selected tasks

Error message

promotion binding has no selected tasks

What it means

Raised by `validate_promotion_for_apply` when `selected_tasks` is empty. Apply needs at least one digest-bound task to promote; an empty selection carries no evidence.

Source

Thrown at eval/workflow_bench/evolve.py:689

def validate_promotion_for_apply(
    promotion: dict[str, Any],
    *,
    overlay_digest: str,
    benchmark_model: str,
    proposer_model: str | None,
    selected_tasks: list[dict[str, Any]],
    target_base_digests: dict[str, str],
    required_candidate_arms: list[str],
    policy: dict[str, Any],
    now: datetime | None = None,
) -> list[dict[str, Any]]:
    """Require one complete, current, exact evidence binding before apply."""
    if promotion.get("schema_version") != 3:
        raise ValueError("promotion binding uses an unsupported schema")
    sha256_pattern = re.compile(r"[0-9a-f]{64}")
    if not selected_tasks:
        raise ValueError("promotion binding has no selected tasks")
    for task in selected_tasks:
        if not isinstance(task, dict) or any(
            not isinstance(task.get(field), str) or sha256_pattern.fullmatch(task[field]) is None
            for field in (
                "oracle_digest",
                "oracle_command_digest",
                "oracle_manifest_digest",
                "sandbox_dependency_content_digest",
                "sandbox_dependency_manifest_digest",
            )
        ):
            raise ValueError("promotion binding is missing hidden-oracle or dependency digests")
        oracle_files = task.get("oracle_files")
        if not isinstance(oracle_files, list) or not oracle_files:
            raise ValueError("promotion binding is missing hidden-oracle files")
        for item in oracle_files:
            if (
                not isinstance(item, dict)

View on GitHub (pinned to d540b00184)

Solutions

  1. Ensure the tasks file selects at least one task (check the 'selected N task(s)' log line).
  2. Re-run the benchmark with a non-empty task set so promotion.json contains real selected tasks.
  3. Do not call validate_promotion_for_apply unless there is at least one selected, promoted task.
Defensive patterns

Strategy: validation

Validate before calling

if not selected_tasks:
    raise ValueError('cannot apply a promotion with no selected tasks')

Type guard

def has_selected_tasks(tasks: list) -> bool:
    return len(tasks) > 0

Prevention

When it happens

Trigger: Calling `validate_promotion_for_apply(..., selected_tasks=[], ...)` — the caller passed an empty task binding list.

Common situations: A benchmark that selected zero tasks (empty/over-filtered tasks file), or a driver bug that built an empty selected_tasks list but still reached apply.

Related errors


AI-assisted analysis of abhigyanpatwari/GitNexus@d540b00184 (2026-08-12). Data as JSON: /api/errors/5af7c95d0ad82747. Report an issue: GitHub.