{"record":{"id":"d9e37fbf02eebd47","repo":"abhigyanpatwari/GitNexus","slug":"results-artifact-parent-is-unavailable-current","errorCode":null,"errorMessage":"results artifact parent is unavailable: {current}: {exc}","messagePattern":"results artifact parent is unavailable: (.+?): (.+?)","errorType":"exception","errorClass":"SandboxError","httpStatus":null,"severity":"error","filePath":"eval/workflow_bench/evolve.py","lineNumber":317,"sourceCode":"\n\ndef _results_artifact_path(root: Path, relative_value: str, *, transcript: bool) -> Path:\n    relative = PurePosixPath(relative_value)\n    expected_parts = 2 if transcript else 1\n    if (\n        relative.is_absolute()\n        or len(relative.parts) != expected_parts\n        or any(part in {\"\", \".\", \"..\"} for part in relative.parts)\n        or (transcript and relative.parts[0] != \"transcripts\")\n    ):\n        raise SandboxError(f\"unsafe results artifact path: {relative_value!r}\")\n    current = root\n    for part in relative.parts[:-1]:\n        current /= part\n        try:\n            metadata = current.lstat()\n        except OSError as exc:\n            raise SandboxError(f\"results artifact parent is unavailable: {current}: {exc}\") from exc\n        if stat.S_ISLNK(metadata.st_mode) or not stat.S_ISDIR(metadata.st_mode):\n            raise SandboxError(f\"results artifact parent must be a real directory: {current}\")\n        if transcript and stat.S_IMODE(metadata.st_mode) & 0o077:\n            raise SandboxError(f\"transcript artifact parent must be owner-only: {current}\")\n    return root / Path(*relative.parts)\n\n\ndef _transcript_artifact_metadata(metadata: Any) -> tuple[str, str, int]:\n    \"\"\"Validate transcript metadata without touching any host path.\"\"\"\n\n    if not isinstance(metadata, dict) or set(metadata) != {\"path\", \"sha256\", \"bytes\", \"source\"}:\n        raise SandboxError(\"transcript artifact metadata must contain only path, sha256, bytes, and source\")\n    relative = metadata[\"path\"]\n    expected_digest = metadata[\"sha256\"]\n    expected_size = metadata[\"bytes\"]\n    if metadata[\"source\"] != runner_sessions.PARENT_EVENT_STREAM_SOURCE:\n        raise SandboxError(\"transcript artifact source is not the parent event stream\")\n    if not isinstance(relative, str) or not re.fullmatch(r\"[0-9a-f]{64}\", str(expected_digest)):","sourceCodeStart":299,"sourceCodeEnd":335,"githubUrl":"https://github.com/abhigyanpatwari/GitNexus/blob/d540b00184d71a896261ee02670da9a92d59d8f7/eval/workflow_bench/evolve.py#L299-L335","documentation":"While _results_artifact_path walks each parent component of a (shape-valid) artifact path, it lstat's every parent dir. An OSError on a parent becomes SandboxError. By this point the leaf shape is already validated, so a missing parent means the results tree is internally inconsistent.","triggerScenarios":"A transcript path 'transcripts/run-42.json' is recorded but the 'transcripts' directory does not exist or is unreadable; a parent was deleted between results.jsonl write and read.","commonSituations":"Partial/corrupted results writes; a cleanup job that removed transcript dirs; permissions changed between generations; results copied without preserving directory structure.","solutions":["Verify the printed parent path exists: `ls -ld <results_dir>/<parent>`.","Re-run the benchmark so the results tree and its rows are written together atomically.","Restore the missing parent from a backup or regenerate the results."],"exampleFix":"# before: results.jsonl references transcripts/run-42.json but transcripts/ was deleted\n\n# after: regenerate results so the dir and its rows agree\nrm -rf results/ && uv run workflow_bench  # rewrites results.jsonl + transcripts/ together","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ndef artifact_parents_available(root: Path, relative_value: str) -> bool:\n    current = root\n    for part in PurePosixPath(relative_value).parts[:-1]:\n        current /= part\n        try:\n            current.lstat()\n        except OSError:\n            return False\n    return True","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Write results.jsonl and the artifact dirs atomically (together) so they never disagree.","Don't delete transcript dirs between generations.","Regenerate results if any parent is missing rather than patching rows by hand."],"tags":["workflow-bench","sandbox","filesystem","results-dir","consistency"],"backgroundTag":null,"analyzedSha":"d540b00184d71a896261ee02670da9a92d59d8f7","analyzedAt":"2026-08-12T19:50:25.132Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}