init: company-haness 설계
This commit is contained in:
@@ -0,0 +1,43 @@
|
||||
"""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)
|
||||
Reference in New Issue
Block a user