{"record":{"id":"bc8efb0288dc2995","repo":"abhigyanpatwari/GitNexus","slug":"label-exceeds-the-bounded-evidence-limit","errorCode":null,"errorMessage":"{label} exceeds the bounded evidence limit","messagePattern":"(.+?) exceeds the bounded evidence limit","errorType":"exception","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/evolution.py","lineNumber":96,"sourceCode":"    current = root\n    for part in relative.parts:\n        if part in {\"\", \".\", \"..\"}:\n            raise ValueError(f\"{label} contains an unsafe path component: {relative}\")\n        current /= part\n        _require_real_directory(current, label=label)\n\n\ndef _bounded_regular_bytes(path: Path, *, limit: int, label: str) -> bytes:\n    \"\"\"Read one bounded regular file without following its leaf link.\"\"\"\n\n    try:\n        before = path.lstat()\n    except OSError as exc:\n        raise ValueError(f\"{label} is unreadable: {path}: {exc}\") from exc\n    if stat.S_ISLNK(before.st_mode) or not stat.S_ISREG(before.st_mode):\n        raise ValueError(f\"{label} must be a regular non-symlink file: {path}\")\n    if before.st_size > limit:\n        raise ValueError(f\"{label} exceeds the bounded evidence limit\")\n\n    descriptor = os.open(path, os.O_RDONLY | getattr(os, \"O_NOFOLLOW\", 0))\n    try:\n        opened = os.fstat(descriptor)\n        if not stat.S_ISREG(opened.st_mode) or opened.st_dev != before.st_dev or opened.st_ino != before.st_ino:\n            raise ValueError(f\"{label} changed while opening: {path}\")\n        chunks: list[bytes] = []\n        remaining = limit + 1\n        while remaining > 0:\n            chunk = os.read(descriptor, min(64 * 1024, remaining))\n            if not chunk:\n                break\n            chunks.append(chunk)\n            remaining -= len(chunk)\n        content = b\"\".join(chunks)\n        if len(content) > limit:\n            raise ValueError(f\"{label} exceeds the bounded evidence limit\")\n        after = os.fstat(descriptor)","sourceCodeStart":78,"sourceCodeEnd":114,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/evolution.py#L78-L114","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Split or shrink the offending file(s) so the total overlay stays under MAX_CANDIDATE_OVERLAY_BYTES (4 MiB).","Exclude large/generated artifacts from the overlay (add to ignore list, drop node_modules/dist).","If a legitimately large evidence file is required, raise MAX_CANDIDATE_OVERLAY_BYTES in evolution.py and document the reason.","If the file grew between size-check and read (concurrent writer), freeze the overlay (chmod -R a-w / cp -rL) before the run."],"exampleFix":"# before: overlay includes a 6 MiB bundle\ncandidate_overlay_payload(Path('/tmp/ov'))\n# ValueError: candidate overlay file exceeds the bounded evidence limit\n\n# after\nrm /tmp/ov/dist/bundle.js   # or split the file\ncandidate_overlay_payload(Path('/tmp/ov'))","handlingStrategy":"validation","validationCode":"from pathlib import Path\nMAX_OVERLAY = 4 * 1024 * 1024\ndef check_overlay_size(root: Path) -> None:\n    total = sum(f.stat().st_size for f in root.rglob('*') if f.is_file())\n    if total > MAX_OVERLAY:\n        raise SystemExit(f'overlay {total}B exceeds {MAX_OVERLAY}B budget')\n# call before candidate_overlay_payload","typeGuard":"def is_size_limit_error(exc: ValueError) -> bool:\n    return 'exceeds the bounded evidence limit' in str(exc)","tryCatchPattern":"try:\n    candidate_overlay_payload(overlay)\nexcept ValueError as e:\n    if is_size_limit_error(e):\n        # drop large files (node_modules/dist) and retry\n        raise\n    raise","preventionTips":["Keep skill overlays well under 4 MiB total; exclude generated/binary artifacts.","Measure total overlay size before invoking the bench.","Split very large evidence across multiple overlays if legitimate."],"tags":["workflow-bench","validation","size-limit","sandbox","evolution"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}