{"record":{"id":"78a93679eb28e62b","repo":"abhigyanpatwari/GitNexus","slug":"transcript-artifact-size-does-not-match-its-result","errorCode":null,"errorMessage":"transcript artifact size does not match its results row: {path}","messagePattern":"transcript artifact size does not match its results row: (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/evolve.py","lineNumber":398,"sourceCode":"            seen_paths.add(normalized)\n        artifacts_by_row.append(artifacts)\n    return artifacts_by_row\n\n\ndef _bound_transcript_artifact(root: Path, metadata: Any) -> str:\n    relative, expected_digest, expected_size = _transcript_artifact_metadata(metadata)\n\n    path = _results_artifact_path(root, relative, transcript=True)\n    try:\n        before = path.lstat()\n    except OSError as exc:\n        raise SandboxError(f\"transcript artifact is unavailable: {path}: {exc}\") from exc\n    if stat.S_ISLNK(before.st_mode) or not stat.S_ISREG(before.st_mode):\n        raise SandboxError(f\"transcript artifact must be a regular non-symlink file: {path}\")\n    if stat.S_IMODE(before.st_mode) & 0o077:\n        raise SandboxError(f\"transcript artifact must be owner-only: {path}\")\n    if before.st_size != expected_size:\n        raise SandboxError(f\"transcript artifact size does not match its results row: {path}\")\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 SandboxError(f\"transcript artifact changed while opening: {path}\")\n        digest = hashlib.sha256()\n        content = bytearray()\n        while chunk := os.read(descriptor, 64 * 1024):\n            digest.update(chunk)\n            content.extend(chunk)\n            if len(content) > MAX_EVIDENCE_FILE_BYTES:\n                del content[: len(content) - MAX_EVIDENCE_FILE_BYTES]\n        after = os.fstat(descriptor)\n        if (opened.st_size, opened.st_mtime_ns) != (after.st_size, after.st_mtime_ns):\n            raise SandboxError(f\"transcript artifact changed while reading: {path}\")\n    finally:\n        os.close(descriptor)","sourceCodeStart":380,"sourceCodeEnd":416,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/evolve.py#L380-L416","documentation":"Raised by `_bound_transcript_artifact` when the transcript file's actual byte size does not equal the `bytes` field recorded in its evidence metadata. The size is pinned in results.jsonl and checked against the file on disk.","triggerScenarios":"`proposer_evidence_entries` reads a results dir whose transcript file was truncated, appended to, or replaced with a different-sized copy after results.jsonl was written.","commonSituations":"A partial file copy, a log-rotation tool truncating transcripts, or a results dir from a re-run whose results.jsonl still references the old sizes.","solutions":["Recompute each transcript's size and compare to results.jsonl's `bytes` field.","Regenerate the whole results dir so results.jsonl and transcripts/ are consistent.","If only one file drifted, restore it from a trusted copy with the exact bytes."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"mismatches = []\nfor r in evidence:\n    for a in r.get('transcript_artifacts', []):\n        actual = (results_dir / a['path']).stat().st_size\n        if actual != a['bytes']:\n            mismatches.append((a['path'], a['bytes'], actual))\nif mismatches:\n    raise ValueError(f'size mismatches (expected, actual): {mismatches}')","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Regenerate results.jsonl and transcripts together; never edit one without the other."],"tags":["python","workflow-bench","evidence","integrity","sandbox"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}