{"record":{"id":"c6f2359251ed4c8a","repo":"abhigyanpatwari/GitNexus","slug":"task-task-id-oracle-exceeds-the-total-byte-li","errorCode":null,"errorMessage":"task {task['id']} oracle exceeds the total byte limit","messagePattern":"task (.+?) oracle exceeds the total byte limit","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/oracle_assets.py","lineNumber":195,"sourceCode":"        os.close(descriptor)\n\n\ndef capture_task_oracle(task: dict[str, Any], *, root: Path = ORACLE_ROOT) -> TaskOracleSnapshot:\n    \"\"\"Capture and digest one task's hidden oracle before a model session.\"\"\"\n\n    validate_oracle_declaration(task)\n    oracle_root = _real_oracle_root(root)\n    oracle = task[\"oracle\"]\n    command = str(oracle[\"command\"])\n    snapshots: list[OracleFileSnapshot] = []\n    total = 0\n    for declaration in oracle[\"files\"]:\n        source = _bounded_relative_path(declaration[\"source\"], label=\"oracle source\")\n        target = _bounded_relative_path(declaration[\"target\"], label=\"oracle target\").as_posix()\n        payload = _read_oracle_file(oracle_root, source)\n        total += len(payload)\n        if total > MAX_ORACLE_TOTAL_BYTES:\n            raise ValueError(f\"task {task['id']} oracle exceeds the total byte limit\")\n        snapshots.append(\n            OracleFileSnapshot(\n                target=target,\n                payload=payload,\n                sha256=hashlib.sha256(payload).hexdigest(),\n            )\n        )\n    snapshots.sort(key=lambda item: item.target)\n    command_digest = hashlib.sha256(command.encode()).hexdigest()\n    manifest_frames = [\n        frame\n        for item in snapshots\n        for frame in (item.target.encode(), item.sha256.encode(), str(len(item.payload)).encode())\n    ]\n    manifest_digest = _hash_frames(*manifest_frames)\n    digest_frames = [command.encode()]\n    for item in snapshots:\n        digest_frames.extend((item.target.encode(), item.payload))","sourceCodeStart":177,"sourceCodeEnd":213,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/oracle_assets.py#L177-L213","documentation":"Raised by capture_task_oracle when the running total of captured oracle file payloads exceeds MAX_ORACLE_TOTAL_BYTES (2 MiB). Even if each individual file passes the 512 KiB per-file limit, the sum across all 1–8 files must stay under 2 MiB so the oracle manifest and digest stay bounded and deterministic.","triggerScenarios":"A task whose combined oracle file sizes exceed 2,097,152 bytes; e.g. four 600 KiB files individually pass the per-file check but sum past the total cap.","commonSituations":"Large expected-output fixtures (big JSON, snapshots, binaries); accumulating many near-cap files; growing an oracle over time without re-checking the total.","solutions":["Reduce the combined size of all oracle files to ≤ 2 MiB.","Drop or trim the largest files; compress or downsample fixture data.","Split the task into multiple tasks each with a smaller oracle, if the benchmark semantics allow."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"from pathlib import Path\nfrom eval.workflow_bench.oracle_assets import MAX_ORACLE_TOTAL_BYTES\n\ndef assert_total_size(root, files) -> None:\n    total = sum((root / Path(d['source']).parts).__fspath__ and Path(root).joinpath(*Path(d['source']).parts).stat().st_size for d in files)\n    if total > MAX_ORACLE_TOTAL_BYTES:\n        raise ValueError(f\"oracle total {total} > {MAX_ORACLE_TOTAL_BYTES}\")","typeGuard":"def total_within_limit(root, files) -> bool:\n    from pathlib import Path\n    from eval.workflow_bench.oracle_assets import MAX_ORACLE_TOTAL_BYTES\n    try:\n        total = sum(Path(root).joinpath(*Path(d['source']).parts).stat().st_size for d in files)\n    except OSError:\n        return False\n    return total <= MAX_ORACLE_TOTAL_BYTES","tryCatchPattern":"try:\n    snap = capture_task_oracle(task, root=root)\nexcept ValueError as exc:\n    if \"exceeds the total byte limit\" in str(exc):\n        raise SystemExit(\"Trim combined oracle files to <= 2 MiB\") from exc\n    raise","preventionTips":["Keep the sum of oracle file sizes well under 2 MiB during authoring.","Compress or downsample large fixtures before adding them to the oracle.","Add a CI check summing oracle file sizes per task."],"tags":["python","benchmark","oracle","input-bounds","validation"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}