"""controller / worktree / external-workspace 경로 해석 + 결정론적 run-id. worktree(=arm 코드, clean)와 workspace(=산출물)를 물리 분리한다.""" import hashlib import os ROOT = os.environ.get("CLAUDE_PROJECT_DIR", os.getcwd()) _EXEC_BASE = "/tmp/cascade-benchmark" def controller_dir(): return os.path.join(ROOT, "benchmark", "cascade") def run_id(seed): return "run-" + hashlib.sha256(str(seed).encode()).hexdigest()[:12] def run_dir(rid): return os.path.join(controller_dir(), "runs", rid) def arm_run_dir(rid, arm): return os.path.join(run_dir(rid), arm) def candidates_dir(rid): return os.path.join(controller_dir(), "candidates", rid) def judgments_path(): return os.path.join(controller_dir(), "judgments.jsonl") def exec_root(rid): return os.path.join(_EXEC_BASE, rid) def worktree_dir(rid, arm): return os.path.join(exec_root(rid), "worktrees", arm) def workspace_dir(rid, arm): return os.path.join(exec_root(rid), "workspaces", arm)