{"record":{"id":"9e755489f0f72a49","repo":"abhigyanpatwari/GitNexus","slug":"workspace-snapshot-exceeds-its-bounded-file-byte-l","errorCode":null,"errorMessage":"workspace snapshot exceeds its bounded file-byte limit","messagePattern":"workspace snapshot exceeds its bounded file-byte limit","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"warning","filePath":"eval/workflow_bench/runner_artifacts.py","lineNumber":166,"sourceCode":"            entry_count += 1\n            path_bytes += len(relative.as_posix().encode())\n            if entry_count > MAX_WORKSPACE_SNAPSHOT_ENTRIES or path_bytes > MAX_WORKSPACE_SNAPSHOT_PATH_BYTES:\n                raise ValueError(\"workspace snapshot exceeds its bounded entry or path limit\")\n            metadata = entry.stat(follow_symlinks=False)\n            permissions = stat.S_IMODE(metadata.st_mode)\n            if stat.S_ISDIR(metadata.st_mode):\n                snapshot[relative.as_posix()] = f\"d:{permissions:o}\"\n                pending.append((Path(entry.path), relative))\n                continue\n            if stat.S_ISLNK(metadata.st_mode):\n                snapshot[relative.as_posix()] = f\"l:{permissions:o}:{os.readlink(entry.path)}\"\n                continue\n            if not stat.S_ISREG(metadata.st_mode):\n                snapshot[relative.as_posix()] = f\"s:{metadata.st_mode}\"\n                continue\n            file_bytes += metadata.st_size\n            if file_bytes > MAX_WORKSPACE_SNAPSHOT_FILE_BYTES:\n                raise ValueError(\"workspace snapshot exceeds its bounded file-byte limit\")\n            descriptor = os.open(entry.path, os.O_RDONLY | nofollow)\n            try:\n                opened = os.fstat(descriptor)\n                if (\n                    not stat.S_ISREG(opened.st_mode)\n                    or opened.st_dev != metadata.st_dev\n                    or opened.st_ino != metadata.st_ino\n                ):\n                    raise ValueError(f\"workspace file changed while opening: {entry.path}\")\n                digest = hashlib.sha256()\n                while chunk := os.read(descriptor, 64 * 1024):\n                    digest.update(chunk)\n                after = os.fstat(descriptor)\n                if (opened.st_size, opened.st_mtime_ns) != (after.st_size, after.st_mtime_ns):\n                    raise ValueError(f\"workspace file changed while hashing: {entry.path}\")\n            finally:\n                os.close(descriptor)\n            snapshot[relative.as_posix()] = f\"f:{permissions:o}:{metadata.st_size}:{digest.hexdigest()}\"","sourceCodeStart":148,"sourceCodeEnd":184,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/runner_artifacts.py#L148-L184","documentation":"Raised in workspace_snapshot (runner_artifacts.py:166) when the cumulative size of regular files exceeds MAX_WORKSPACE_SNAPSHOT_FILE_BYTES (1 GiB). The byte budget prevents hashing an unbounded volume of file content during phase-boundary checks; once exceeded the snapshot aborts rather than return a partial hash.","triggerScenarios":"Sum of metadata.st_size across regular files in the walk passes 1 GiB before all files are hashed. Caused by large binary artifacts in the worktree: model weights, datasets, build outputs, or a vendored grammar prebuild.","commonSituations":"A task that downloads a multi-GB dataset into the worktree; a build step producing large .wasm/.so artifacts; checking in a model checkpoint; running against a repo with bundled media.","solutions":["Identify the largest files: du -ah <worktree> | sort -rh | head. Move or .gitignore them so they are not in the cloned worktree.","If large artifacts are inherent to the task, raise MAX_WORKSPACE_SNAPSHOT_FILE_BYTES in runner_artifacts.py and accept the longer snapshot time.","Keep bulky assets in a directory the snapshot excludes (e.g. under a bootstrap-noise path) or symlink them from outside the worktree (note the snapshot records symlinks, not their targets)."],"exampleFix":"# before: dataset lives inside the hashed worktree\nworktree/data/model.bin  # 2 GiB\n\n# after: move it out and symlink (snapshot records the link, not the target)\nmv worktree/data/model.bin /srv/models/model.bin\nln -s /srv/models/model.bin worktree/data/model.bin","handlingStrategy":"validation","validationCode":"from pathlib import Path\nfrom eval.workflow_bench.runner_artifacts import MAX_WORKSPACE_SNAPSHOT_FILE_BYTES\n\ndef estimate_file_bytes(root: Path) -> int:\n    total = 0\n    for p in Path(root).rglob(\"*\"):\n        if p.is_file() and not p.is_symlink():\n            total += p.stat().st_size\n    return total\n\ntotal = estimate_file_bytes(worktree)\nassert total <= MAX_WORKSPACE_SNAPSHOT_FILE_BYTES, f\"{total} file bytes > 1 GiB limit\"","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Exclude large binary assets (datasets, model weights, build outputs) from the worktree.","Symlink bulky assets from outside the worktree (the snapshot records the link, not the target).","Run `du -ah <worktree> | sort -rh | head` before benchmarking to spot size offenders."],"tags":["limits","workspace-snapshot","filesystem"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}