abhigyanpatwari/GitNexus · error · ValueError

{label} exceeds the bounded evidence limit

Error message

{label} exceeds the bounded evidence limit

What it means

Thrown by _bounded_regular_bytes() in eval/workflow_bench/evolution.py in two places: (1) if lstat reports st_size greater than the per-call limit (which is the remaining MAX_CANDIDATE_OVERLAY_BYTES budget at that point), and (2) if the bytes actually read exceed the limit (a defensive check in case the file grew between size check and read). The bound prevents a single evidence file from exhausting memory or the overall overlay budget.

Source

Thrown at eval/workflow_bench/evolution.py:96

    current = root
    for part in relative.parts:
        if part in {"", ".", ".."}:
            raise ValueError(f"{label} contains an unsafe path component: {relative}")
        current /= part
        _require_real_directory(current, label=label)


def _bounded_regular_bytes(path: Path, *, limit: int, label: str) -> bytes:
    """Read one bounded regular file without following its leaf link."""

    try:
        before = path.lstat()
    except OSError as exc:
        raise ValueError(f"{label} is unreadable: {path}: {exc}") from exc
    if stat.S_ISLNK(before.st_mode) or not stat.S_ISREG(before.st_mode):
        raise ValueError(f"{label} must be a regular non-symlink file: {path}")
    if before.st_size > limit:
        raise ValueError(f"{label} exceeds the bounded evidence limit")

    descriptor = os.open(path, os.O_RDONLY | getattr(os, "O_NOFOLLOW", 0))
    try:
        opened = os.fstat(descriptor)
        if not stat.S_ISREG(opened.st_mode) or opened.st_dev != before.st_dev or opened.st_ino != before.st_ino:
            raise ValueError(f"{label} changed while opening: {path}")
        chunks: list[bytes] = []
        remaining = limit + 1
        while remaining > 0:
            chunk = os.read(descriptor, min(64 * 1024, remaining))
            if not chunk:
                break
            chunks.append(chunk)
            remaining -= len(chunk)
        content = b"".join(chunks)
        if len(content) > limit:
            raise ValueError(f"{label} exceeds the bounded evidence limit")
        after = os.fstat(descriptor)

View on GitHub (pinned to d540b00184)

Solutions

  1. Split or shrink the offending file(s) so the total overlay stays under MAX_CANDIDATE_OVERLAY_BYTES (4 MiB).
  2. Exclude large/generated artifacts from the overlay (add to ignore list, drop node_modules/dist).
  3. If a legitimately large evidence file is required, raise MAX_CANDIDATE_OVERLAY_BYTES in evolution.py and document the reason.
  4. If the file grew between size-check and read (concurrent writer), freeze the overlay (chmod -R a-w / cp -rL) before the run.

Example fix

# before: overlay includes a 6 MiB bundle
candidate_overlay_payload(Path('/tmp/ov'))
# ValueError: candidate overlay file exceeds the bounded evidence limit

# after
rm /tmp/ov/dist/bundle.js   # or split the file
candidate_overlay_payload(Path('/tmp/ov'))
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path
MAX_OVERLAY = 4 * 1024 * 1024
def check_overlay_size(root: Path) -> None:
    total = sum(f.stat().st_size for f in root.rglob('*') if f.is_file())
    if total > MAX_OVERLAY:
        raise SystemExit(f'overlay {total}B exceeds {MAX_OVERLAY}B budget')
# call before candidate_overlay_payload

Type guard

def is_size_limit_error(exc: ValueError) -> bool:
    return 'exceeds the bounded evidence limit' in str(exc)

Try / catch

try:
    candidate_overlay_payload(overlay)
except ValueError as e:
    if is_size_limit_error(e):
        # drop large files (node_modules/dist) and retry
        raise
    raise

Prevention

When it happens

Trigger: A candidate file larger than the remaining overlay byte budget (MAX_CANDIDATE_OVERLAY_BYTES = 4 MiB total, shared across all files), or any single file larger than its current remaining slice. The pre-read size check fires first; the post-read size check catches files that grew during the read.

Common situations: Skill overlay that bundles a large binary, model weights, a big dataset, or minified bundle; accidentally included node_modules; an overlay that grew mid-run because of concurrent writes.

Related errors


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