-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmaterialize.py
More file actions
73 lines (42 loc) · 1.7 KB
/
Copy pathmaterialize.py
File metadata and controls
73 lines (42 loc) · 1.7 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
"""Resolve Terminal Wrench task paths and fixture locations."""
from __future__ import annotations
import os
from pathlib import Path
REPO_ROOT = Path(__file__).resolve().parents[3]
DEFAULT_TASK_ID = "mongodb-sales-aggregation-engine"
DEFAULT_MODEL = "gemini-3.1-pro"
PINNED_REVISION = "d8a29613235a0ef56a8b70b3142626a533da28c2"
def repo_root() -> Path:
return REPO_ROOT
def fixture_root(task_id: str = DEFAULT_TASK_ID) -> Path:
return repo_root() / "fixtures" / "forkproof" / task_id
def read_env(name: str, default: str) -> str:
return os.environ.get(name, default)
def terminal_wrench_root() -> Path:
return Path(read_env("H2F2H_TERMINAL_WRENCH_PATH", ".external/terminal-wrench")).resolve()
def task_id() -> str:
return read_env("H2F2H_TERMINAL_WRENCH_TASK_ID", DEFAULT_TASK_ID)
def task_model() -> str:
return read_env("H2F2H_TERMINAL_WRENCH_MODEL", DEFAULT_MODEL)
def original_task_dir() -> Path:
return (
terminal_wrench_root()
/ "tasks"
/ task_id()
/ task_model()
/ "original_task"
)
def grader_path() -> Path:
return original_task_dir() / "tests" / "test_outputs.py"
def verifier_harness_path() -> Path:
return original_task_dir() / "tests" / "test.sh"
def dockerfile_path() -> Path:
return original_task_dir() / "environment" / "Dockerfile"
def reference_solution_path() -> Path:
return original_task_dir() / "solution" / "solve.sh"
def hud_env_path() -> Path:
return repo_root() / "envs" / task_id() / "env.py"
def hud_grader_assets_dir() -> Path:
return repo_root() / "envs" / task_id() / "task_assets"
def solution_path(path_label: str) -> Path:
return fixture_root() / path_label / "query.py"