Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions scripts/native_eval/runtime.py
Original file line number Diff line number Diff line change
Expand Up @@ -103,14 +103,17 @@ def verifier_dir(self) -> Path:
def artifacts_dir(self) -> Path:
return self.trial_dir / "artifacts"

async def start(self) -> CommandResult:
def prepare_trial_dirs(self) -> None:
for path in (
self.agent_dir,
self.verifier_dir,
self.artifacts_dir / "logs" / "artifacts",
):
path.mkdir(parents=True, exist_ok=True)
path.chmod(0o777)
path.chmod(0o755)

async def start(self) -> CommandResult:
self.prepare_trial_dirs()

started_at = utc_now()
try:
Expand Down
21 changes: 21 additions & 0 deletions tests/test_native_eval_runner.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

import asyncio
import json
import stat
import subprocess
import sys
import tarfile
Expand Down Expand Up @@ -1260,6 +1261,26 @@ async def fake_capture(command: list[str]) -> str:
)


def test_prepare_trial_dirs_are_owner_writable_only(tmp_path: Path) -> None:
environment = DockerTaskEnvironment(
task=object(), # type: ignore[arg-type]
trial_dir=tmp_path,
container_name="trial",
project_name="trial",
toolchain_root=tmp_path,
)

environment.prepare_trial_dirs()

for path in (
environment.agent_dir,
environment.verifier_dir,
environment.artifacts_dir / "logs" / "artifacts",
):
assert path.is_dir()
assert stat.S_IMODE(path.stat().st_mode) == 0o755


def test_claude_code_selects_canonical_model_explicitly() -> None:
run = RunSpec(
run_label="claude-code-test",
Expand Down