diff --git a/tasks/0000_886_886039_qa_5/tests/grader.py b/tasks/0000_886_886039_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_886_886039_qa_5/tests/grader.py +++ b/tasks/0000_886_886039_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_901_901543_qa_2/tests/grader.py b/tasks/0000_901_901543_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_901_901543_qa_2/tests/grader.py +++ b/tasks/0000_901_901543_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_901_901543_qa_3/tests/grader.py b/tasks/0000_901_901543_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_901_901543_qa_3/tests/grader.py +++ b/tasks/0000_901_901543_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_903_903504_qa_1/tests/grader.py b/tasks/0000_903_903504_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_903_903504_qa_1/tests/grader.py +++ b/tasks/0000_903_903504_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_939_939639_qa_2/tests/grader.py b/tasks/0000_939_939639_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_939_939639_qa_2/tests/grader.py +++ b/tasks/0000_939_939639_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_939_939639_qa_3/tests/grader.py b/tasks/0000_939_939639_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_939_939639_qa_3/tests/grader.py +++ b/tasks/0000_939_939639_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_949_949403_qa_3/tests/grader.py b/tasks/0000_949_949403_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_949_949403_qa_3/tests/grader.py +++ b/tasks/0000_949_949403_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_975_975906_qa_1/tests/grader.py b/tasks/0000_975_975906_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_975_975906_qa_1/tests/grader.py +++ b/tasks/0000_975_975906_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_986_986420_qa_2/tests/grader.py b/tasks/0000_986_986420_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_986_986420_qa_2/tests/grader.py +++ b/tasks/0000_986_986420_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_986_986420_qa_4/tests/grader.py b/tasks/0000_986_986420_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_986_986420_qa_4/tests/grader.py +++ b/tasks/0000_986_986420_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_988_988342_qa_4/tests/grader.py b/tasks/0000_988_988342_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_988_988342_qa_4/tests/grader.py +++ b/tasks/0000_988_988342_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_988_988657_qa_4/tests/grader.py b/tasks/0000_988_988657_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_988_988657_qa_4/tests/grader.py +++ b/tasks/0000_988_988657_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_991_991010_qa_1/tests/grader.py b/tasks/0000_991_991010_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_991_991010_qa_1/tests/grader.py +++ b/tasks/0000_991_991010_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_991_991010_qa_2/tests/grader.py b/tasks/0000_991_991010_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_991_991010_qa_2/tests/grader.py +++ b/tasks/0000_991_991010_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_991_991010_qa_3/tests/grader.py b/tasks/0000_991_991010_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_991_991010_qa_3/tests/grader.py +++ b/tasks/0000_991_991010_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_994_994384_qa_5/tests/grader.py b/tasks/0000_994_994384_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_994_994384_qa_5/tests/grader.py +++ b/tasks/0000_994_994384_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0000_994_994443_qa_4/tests/grader.py b/tasks/0000_994_994443_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0000_994_994443_qa_4/tests/grader.py +++ b/tasks/0000_994_994443_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_004_1004716_qa_2/tests/grader.py b/tasks/0001_004_1004716_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_004_1004716_qa_2/tests/grader.py +++ b/tasks/0001_004_1004716_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_024_1024990_qa_2/tests/grader.py b/tasks/0001_024_1024990_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_024_1024990_qa_2/tests/grader.py +++ b/tasks/0001_024_1024990_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_027_1027372_qa_2/tests/grader.py b/tasks/0001_027_1027372_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_027_1027372_qa_2/tests/grader.py +++ b/tasks/0001_027_1027372_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_029_1029150_qa_2/tests/grader.py b/tasks/0001_029_1029150_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_029_1029150_qa_2/tests/grader.py +++ b/tasks/0001_029_1029150_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_036_1036744_qa_1/tests/grader.py b/tasks/0001_036_1036744_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_036_1036744_qa_1/tests/grader.py +++ b/tasks/0001_036_1036744_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_042_1042725_qa_2/tests/grader.py b/tasks/0001_042_1042725_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_042_1042725_qa_2/tests/grader.py +++ b/tasks/0001_042_1042725_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_044_1044175_qa_3/tests/grader.py b/tasks/0001_044_1044175_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_044_1044175_qa_3/tests/grader.py +++ b/tasks/0001_044_1044175_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_062_1062946_qa_2/tests/grader.py b/tasks/0001_062_1062946_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_062_1062946_qa_2/tests/grader.py +++ b/tasks/0001_062_1062946_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_065_1065379_qa_3/tests/grader.py b/tasks/0001_065_1065379_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_065_1065379_qa_3/tests/grader.py +++ b/tasks/0001_065_1065379_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_067_1067596_qa_5/tests/grader.py b/tasks/0001_067_1067596_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_067_1067596_qa_5/tests/grader.py +++ b/tasks/0001_067_1067596_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_068_1068916_qa_1/tests/grader.py b/tasks/0001_068_1068916_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_068_1068916_qa_1/tests/grader.py +++ b/tasks/0001_068_1068916_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_068_1068916_qa_5/tests/grader.py b/tasks/0001_068_1068916_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_068_1068916_qa_5/tests/grader.py +++ b/tasks/0001_068_1068916_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_078_1078204_qa_2/tests/grader.py b/tasks/0001_078_1078204_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_078_1078204_qa_2/tests/grader.py +++ b/tasks/0001_078_1078204_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_079_1079149_qa_2/tests/grader.py b/tasks/0001_079_1079149_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_079_1079149_qa_2/tests/grader.py +++ b/tasks/0001_079_1079149_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_082_1082305_qa_1/tests/grader.py b/tasks/0001_082_1082305_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_082_1082305_qa_1/tests/grader.py +++ b/tasks/0001_082_1082305_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_083_1083006_qa_5/tests/grader.py b/tasks/0001_083_1083006_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_083_1083006_qa_5/tests/grader.py +++ b/tasks/0001_083_1083006_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_091_1091047_qa_4/tests/grader.py b/tasks/0001_091_1091047_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_091_1091047_qa_4/tests/grader.py +++ b/tasks/0001_091_1091047_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_091_1091047_qa_5/tests/grader.py b/tasks/0001_091_1091047_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_091_1091047_qa_5/tests/grader.py +++ b/tasks/0001_091_1091047_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_095_1095486_qa_2/tests/grader.py b/tasks/0001_095_1095486_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_095_1095486_qa_2/tests/grader.py +++ b/tasks/0001_095_1095486_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_102_1102505_qa_2/tests/grader.py b/tasks/0001_102_1102505_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_102_1102505_qa_2/tests/grader.py +++ b/tasks/0001_102_1102505_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_104_1104901_qa_2/tests/grader.py b/tasks/0001_104_1104901_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_104_1104901_qa_2/tests/grader.py +++ b/tasks/0001_104_1104901_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_104_1104901_qa_3/tests/grader.py b/tasks/0001_104_1104901_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_104_1104901_qa_3/tests/grader.py +++ b/tasks/0001_104_1104901_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_104_1104959_qa_2/tests/grader.py b/tasks/0001_104_1104959_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_104_1104959_qa_2/tests/grader.py +++ b/tasks/0001_104_1104959_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_105_1105529_qa_5/tests/grader.py b/tasks/0001_105_1105529_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_105_1105529_qa_5/tests/grader.py +++ b/tasks/0001_105_1105529_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_105_1105892_qa_3/tests/grader.py b/tasks/0001_105_1105892_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_105_1105892_qa_3/tests/grader.py +++ b/tasks/0001_105_1105892_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_105_1105892_qa_5/tests/grader.py b/tasks/0001_105_1105892_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_105_1105892_qa_5/tests/grader.py +++ b/tasks/0001_105_1105892_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_116_1116342_qa_3/tests/grader.py b/tasks/0001_116_1116342_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_116_1116342_qa_3/tests/grader.py +++ b/tasks/0001_116_1116342_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_116_1116342_qa_5/tests/grader.py b/tasks/0001_116_1116342_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_116_1116342_qa_5/tests/grader.py +++ b/tasks/0001_116_1116342_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_123_1123075_qa_4/tests/grader.py b/tasks/0001_123_1123075_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_123_1123075_qa_4/tests/grader.py +++ b/tasks/0001_123_1123075_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_124_1124736_qa_1/tests/grader.py b/tasks/0001_124_1124736_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_124_1124736_qa_1/tests/grader.py +++ b/tasks/0001_124_1124736_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_124_1124736_qa_2/tests/grader.py b/tasks/0001_124_1124736_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_124_1124736_qa_2/tests/grader.py +++ b/tasks/0001_124_1124736_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_133_1133224_qa_4/tests/grader.py b/tasks/0001_133_1133224_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_133_1133224_qa_4/tests/grader.py +++ b/tasks/0001_133_1133224_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_133_1133625_qa_3/tests/grader.py b/tasks/0001_133_1133625_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_133_1133625_qa_3/tests/grader.py +++ b/tasks/0001_133_1133625_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_134_1134780_qa_3/tests/grader.py b/tasks/0001_134_1134780_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_134_1134780_qa_3/tests/grader.py +++ b/tasks/0001_134_1134780_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_134_1134780_qa_5/tests/grader.py b/tasks/0001_134_1134780_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_134_1134780_qa_5/tests/grader.py +++ b/tasks/0001_134_1134780_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_548_1548552_qa_1/tests/grader.py b/tasks/0001_548_1548552_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_548_1548552_qa_1/tests/grader.py +++ b/tasks/0001_548_1548552_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_551_1551019_qa_3/tests/grader.py b/tasks/0001_551_1551019_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_551_1551019_qa_3/tests/grader.py +++ b/tasks/0001_551_1551019_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_573_1573460_qa_3/tests/grader.py b/tasks/0001_573_1573460_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_573_1573460_qa_3/tests/grader.py +++ b/tasks/0001_573_1573460_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_574_1574525_qa_2/tests/grader.py b/tasks/0001_574_1574525_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_574_1574525_qa_2/tests/grader.py +++ b/tasks/0001_574_1574525_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_583_1583897_qa_5/tests/grader.py b/tasks/0001_583_1583897_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_583_1583897_qa_5/tests/grader.py +++ b/tasks/0001_583_1583897_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_586_1586397_qa_4/tests/grader.py b/tasks/0001_586_1586397_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_586_1586397_qa_4/tests/grader.py +++ b/tasks/0001_586_1586397_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_594_1594994_qa_1/tests/grader.py b/tasks/0001_594_1594994_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_594_1594994_qa_1/tests/grader.py +++ b/tasks/0001_594_1594994_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_598_1598064_qa_2/tests/grader.py b/tasks/0001_598_1598064_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_598_1598064_qa_2/tests/grader.py +++ b/tasks/0001_598_1598064_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_613_1613977_qa_3/tests/grader.py b/tasks/0001_613_1613977_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_613_1613977_qa_3/tests/grader.py +++ b/tasks/0001_613_1613977_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_649_1649151_qa_1/tests/grader.py b/tasks/0001_649_1649151_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_649_1649151_qa_1/tests/grader.py +++ b/tasks/0001_649_1649151_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_666_1666101_qa_2/tests/grader.py b/tasks/0001_666_1666101_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_666_1666101_qa_2/tests/grader.py +++ b/tasks/0001_666_1666101_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_672_1672543_qa_4/tests/grader.py b/tasks/0001_672_1672543_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_672_1672543_qa_4/tests/grader.py +++ b/tasks/0001_672_1672543_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_683_1683832_qa_5/tests/grader.py b/tasks/0001_683_1683832_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_683_1683832_qa_5/tests/grader.py +++ b/tasks/0001_683_1683832_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_689_1689474_qa_2/tests/grader.py b/tasks/0001_689_1689474_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_689_1689474_qa_2/tests/grader.py +++ b/tasks/0001_689_1689474_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_736_1736876_qa_1/tests/grader.py b/tasks/0001_736_1736876_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_736_1736876_qa_1/tests/grader.py +++ b/tasks/0001_736_1736876_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_756_1756499_qa_1/tests/grader.py b/tasks/0001_756_1756499_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_756_1756499_qa_1/tests/grader.py +++ b/tasks/0001_756_1756499_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_830_1830390_qa_5/tests/grader.py b/tasks/0001_830_1830390_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_830_1830390_qa_5/tests/grader.py +++ b/tasks/0001_830_1830390_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_850_1850034_qa_4/tests/grader.py b/tasks/0001_850_1850034_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_850_1850034_qa_4/tests/grader.py +++ b/tasks/0001_850_1850034_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_860_1860651_qa_2/tests/grader.py b/tasks/0001_860_1860651_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_860_1860651_qa_2/tests/grader.py +++ b/tasks/0001_860_1860651_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_868_1868953_qa_3/tests/grader.py b/tasks/0001_868_1868953_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_868_1868953_qa_3/tests/grader.py +++ b/tasks/0001_868_1868953_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_875_1875604_qa_4/tests/grader.py b/tasks/0001_875_1875604_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_875_1875604_qa_4/tests/grader.py +++ b/tasks/0001_875_1875604_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0001_955_1955907_qa_1/tests/grader.py b/tasks/0001_955_1955907_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_955_1955907_qa_1/tests/grader.py +++ b/tasks/0001_955_1955907_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0002_094_2094844_qa_2/tests/grader.py b/tasks/0002_094_2094844_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_094_2094844_qa_2/tests/grader.py +++ b/tasks/0002_094_2094844_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0002_152_2152188_qa_1/tests/grader.py b/tasks/0002_152_2152188_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_152_2152188_qa_1/tests/grader.py +++ b/tasks/0002_152_2152188_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0002_157_2157761_qa_4/tests/grader.py b/tasks/0002_157_2157761_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_157_2157761_qa_4/tests/grader.py +++ b/tasks/0002_157_2157761_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0002_219_2219893_qa_1/tests/grader.py b/tasks/0002_219_2219893_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_219_2219893_qa_1/tests/grader.py +++ b/tasks/0002_219_2219893_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0002_238_2238090_qa_4/tests/grader.py b/tasks/0002_238_2238090_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_238_2238090_qa_4/tests/grader.py +++ b/tasks/0002_238_2238090_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0002_248_2248246_qa_1/tests/grader.py b/tasks/0002_248_2248246_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_248_2248246_qa_1/tests/grader.py +++ b/tasks/0002_248_2248246_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0002_264_2264461_qa_2/tests/grader.py b/tasks/0002_264_2264461_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_264_2264461_qa_2/tests/grader.py +++ b/tasks/0002_264_2264461_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0002_335_2335686_qa_2/tests/grader.py b/tasks/0002_335_2335686_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_335_2335686_qa_2/tests/grader.py +++ b/tasks/0002_335_2335686_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0002_350_2350400_qa_1/tests/grader.py b/tasks/0002_350_2350400_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_350_2350400_qa_1/tests/grader.py +++ b/tasks/0002_350_2350400_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0010_256_10256782_qa_1/tests/grader.py b/tasks/0010_256_10256782_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_256_10256782_qa_1/tests/grader.py +++ b/tasks/0010_256_10256782_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0010_306_10306280_qa_2/tests/grader.py b/tasks/0010_306_10306280_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_306_10306280_qa_2/tests/grader.py +++ b/tasks/0010_306_10306280_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0010_307_10307949_qa_1/tests/grader.py b/tasks/0010_307_10307949_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_307_10307949_qa_1/tests/grader.py +++ b/tasks/0010_307_10307949_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0010_397_10397139_qa_1/tests/grader.py b/tasks/0010_397_10397139_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_397_10397139_qa_1/tests/grader.py +++ b/tasks/0010_397_10397139_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0010_397_10397139_qa_4/tests/grader.py b/tasks/0010_397_10397139_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_397_10397139_qa_4/tests/grader.py +++ b/tasks/0010_397_10397139_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0010_908_10908139_qa_1/tests/grader.py b/tasks/0010_908_10908139_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_908_10908139_qa_1/tests/grader.py +++ b/tasks/0010_908_10908139_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_000_11000770_qa_4/tests/grader.py b/tasks/0011_000_11000770_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_000_11000770_qa_4/tests/grader.py +++ b/tasks/0011_000_11000770_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_000_11000770_qa_5/tests/grader.py b/tasks/0011_000_11000770_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_000_11000770_qa_5/tests/grader.py +++ b/tasks/0011_000_11000770_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_045_11045524_qa_1/tests/grader.py b/tasks/0011_045_11045524_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_045_11045524_qa_1/tests/grader.py +++ b/tasks/0011_045_11045524_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_045_11045524_qa_3/tests/grader.py b/tasks/0011_045_11045524_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_045_11045524_qa_3/tests/grader.py +++ b/tasks/0011_045_11045524_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_045_11045524_qa_5/tests/grader.py b/tasks/0011_045_11045524_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_045_11045524_qa_5/tests/grader.py +++ b/tasks/0011_045_11045524_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_081_11081921_qa_1/tests/grader.py b/tasks/0011_081_11081921_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_081_11081921_qa_1/tests/grader.py +++ b/tasks/0011_081_11081921_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_088_11088784_qa_5/tests/grader.py b/tasks/0011_088_11088784_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_088_11088784_qa_5/tests/grader.py +++ b/tasks/0011_088_11088784_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_089_11089643_qa_3/tests/grader.py b/tasks/0011_089_11089643_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_089_11089643_qa_3/tests/grader.py +++ b/tasks/0011_089_11089643_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_121_11121152_qa_3/tests/grader.py b/tasks/0011_121_11121152_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_121_11121152_qa_3/tests/grader.py +++ b/tasks/0011_121_11121152_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_222_11222401_qa_5/tests/grader.py b/tasks/0011_222_11222401_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_222_11222401_qa_5/tests/grader.py +++ b/tasks/0011_222_11222401_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_355_11355842_qa_1/tests/grader.py b/tasks/0011_355_11355842_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_355_11355842_qa_1/tests/grader.py +++ b/tasks/0011_355_11355842_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_412_11412178_qa_1/tests/grader.py b/tasks/0011_412_11412178_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_412_11412178_qa_1/tests/grader.py +++ b/tasks/0011_412_11412178_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_508_11508075_qa_5/tests/grader.py b/tasks/0011_508_11508075_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_508_11508075_qa_5/tests/grader.py +++ b/tasks/0011_508_11508075_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_587_11587142_qa_2/tests/grader.py b/tasks/0011_587_11587142_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_587_11587142_qa_2/tests/grader.py +++ b/tasks/0011_587_11587142_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_587_11587142_qa_5/tests/grader.py b/tasks/0011_587_11587142_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_587_11587142_qa_5/tests/grader.py +++ b/tasks/0011_587_11587142_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_723_11723635_qa_4/tests/grader.py b/tasks/0011_723_11723635_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_723_11723635_qa_4/tests/grader.py +++ b/tasks/0011_723_11723635_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_754_11754124_qa_4/tests/grader.py b/tasks/0011_754_11754124_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_754_11754124_qa_4/tests/grader.py +++ b/tasks/0011_754_11754124_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_820_11820848_qa_3/tests/grader.py b/tasks/0011_820_11820848_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_820_11820848_qa_3/tests/grader.py +++ b/tasks/0011_820_11820848_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_843_11843765_qa_5/tests/grader.py b/tasks/0011_843_11843765_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_843_11843765_qa_5/tests/grader.py +++ b/tasks/0011_843_11843765_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0011_869_11869966_qa_4/tests/grader.py b/tasks/0011_869_11869966_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_869_11869966_qa_4/tests/grader.py +++ b/tasks/0011_869_11869966_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0012_222_12222108_qa_5/tests/grader.py b/tasks/0012_222_12222108_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_222_12222108_qa_5/tests/grader.py +++ b/tasks/0012_222_12222108_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0012_330_12330544_qa_2/tests/grader.py b/tasks/0012_330_12330544_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_330_12330544_qa_2/tests/grader.py +++ b/tasks/0012_330_12330544_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0012_337_12337856_qa_2/tests/grader.py b/tasks/0012_337_12337856_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_337_12337856_qa_2/tests/grader.py +++ b/tasks/0012_337_12337856_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0012_556_12556896_qa_3/tests/grader.py b/tasks/0012_556_12556896_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_556_12556896_qa_3/tests/grader.py +++ b/tasks/0012_556_12556896_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0012_692_12692192_qa_3/tests/grader.py b/tasks/0012_692_12692192_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_692_12692192_qa_3/tests/grader.py +++ b/tasks/0012_692_12692192_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0012_953_12953382_qa_3/tests/grader.py b/tasks/0012_953_12953382_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_953_12953382_qa_3/tests/grader.py +++ b/tasks/0012_953_12953382_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0013_243_13243838_qa_3/tests/grader.py b/tasks/0013_243_13243838_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_243_13243838_qa_3/tests/grader.py +++ b/tasks/0013_243_13243838_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0013_355_13355821_qa_3/tests/grader.py b/tasks/0013_355_13355821_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_355_13355821_qa_3/tests/grader.py +++ b/tasks/0013_355_13355821_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0013_695_13695761_qa_1/tests/grader.py b/tasks/0013_695_13695761_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_695_13695761_qa_1/tests/grader.py +++ b/tasks/0013_695_13695761_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0013_706_13706047_qa_5/tests/grader.py b/tasks/0013_706_13706047_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_706_13706047_qa_5/tests/grader.py +++ b/tasks/0013_706_13706047_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0013_718_13718057_qa_3/tests/grader.py b/tasks/0013_718_13718057_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_718_13718057_qa_3/tests/grader.py +++ b/tasks/0013_718_13718057_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0013_791_13791869_qa_4/tests/grader.py b/tasks/0013_791_13791869_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_791_13791869_qa_4/tests/grader.py +++ b/tasks/0013_791_13791869_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0013_884_13884693_qa_3/tests/grader.py b/tasks/0013_884_13884693_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_884_13884693_qa_3/tests/grader.py +++ b/tasks/0013_884_13884693_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0013_884_13884693_qa_4/tests/grader.py b/tasks/0013_884_13884693_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_884_13884693_qa_4/tests/grader.py +++ b/tasks/0013_884_13884693_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0014_516_14516985_qa_2/tests/grader.py b/tasks/0014_516_14516985_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0014_516_14516985_qa_2/tests/grader.py +++ b/tasks/0014_516_14516985_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0014_516_14516985_qa_5/tests/grader.py b/tasks/0014_516_14516985_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0014_516_14516985_qa_5/tests/grader.py +++ b/tasks/0014_516_14516985_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0014_594_14594724_qa_2/tests/grader.py b/tasks/0014_594_14594724_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0014_594_14594724_qa_2/tests/grader.py +++ b/tasks/0014_594_14594724_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0014_594_14594724_qa_5/tests/grader.py b/tasks/0014_594_14594724_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0014_594_14594724_qa_5/tests/grader.py +++ b/tasks/0014_594_14594724_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0014_681_14681789_qa_3/tests/grader.py b/tasks/0014_681_14681789_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0014_681_14681789_qa_3/tests/grader.py +++ b/tasks/0014_681_14681789_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0014_938_14938015_qa_3/tests/grader.py b/tasks/0014_938_14938015_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0014_938_14938015_qa_3/tests/grader.py +++ b/tasks/0014_938_14938015_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0015_124_15124276_qa_2/tests/grader.py b/tasks/0015_124_15124276_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0015_124_15124276_qa_2/tests/grader.py +++ b/tasks/0015_124_15124276_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0015_168_15168316_qa_2/tests/grader.py b/tasks/0015_168_15168316_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0015_168_15168316_qa_2/tests/grader.py +++ b/tasks/0015_168_15168316_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0015_168_15168316_qa_4/tests/grader.py b/tasks/0015_168_15168316_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0015_168_15168316_qa_4/tests/grader.py +++ b/tasks/0015_168_15168316_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0015_288_15288932_qa_4/tests/grader.py b/tasks/0015_288_15288932_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0015_288_15288932_qa_4/tests/grader.py +++ b/tasks/0015_288_15288932_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0015_525_15525489_qa_2/tests/grader.py b/tasks/0015_525_15525489_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0015_525_15525489_qa_2/tests/grader.py +++ b/tasks/0015_525_15525489_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0015_628_15628139_qa_5/tests/grader.py b/tasks/0015_628_15628139_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0015_628_15628139_qa_5/tests/grader.py +++ b/tasks/0015_628_15628139_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0015_628_15628586_qa_3/tests/grader.py b/tasks/0015_628_15628586_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0015_628_15628586_qa_3/tests/grader.py +++ b/tasks/0015_628_15628586_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0015_693_15693594_qa_5/tests/grader.py b/tasks/0015_693_15693594_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0015_693_15693594_qa_5/tests/grader.py +++ b/tasks/0015_693_15693594_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0016_039_16039611_qa_3/tests/grader.py b/tasks/0016_039_16039611_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0016_039_16039611_qa_3/tests/grader.py +++ b/tasks/0016_039_16039611_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0016_567_16567793_qa_4/tests/grader.py b/tasks/0016_567_16567793_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0016_567_16567793_qa_4/tests/grader.py +++ b/tasks/0016_567_16567793_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0016_567_16567793_qa_5/tests/grader.py b/tasks/0016_567_16567793_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0016_567_16567793_qa_5/tests/grader.py +++ b/tasks/0016_567_16567793_qa_5/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0016_613_16613084_qa_1/tests/grader.py b/tasks/0016_613_16613084_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0016_613_16613084_qa_1/tests/grader.py +++ b/tasks/0016_613_16613084_qa_1/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0016_734_16734421_qa_3/tests/grader.py b/tasks/0016_734_16734421_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0016_734_16734421_qa_3/tests/grader.py +++ b/tasks/0016_734_16734421_qa_3/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0016_971_16971389_qa_2/tests/grader.py b/tasks/0016_971_16971389_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0016_971_16971389_qa_2/tests/grader.py +++ b/tasks/0016_971_16971389_qa_2/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0 diff --git a/tasks/0017_436_17436469_qa_4/tests/grader.py b/tasks/0017_436_17436469_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0017_436_17436469_qa_4/tests/grader.py +++ b/tasks/0017_436_17436469_qa_4/tests/grader.py @@ -106,28 +106,20 @@ def grade(gold: str, candidate: str, *, question: str = "", reward_mode: str = " return GradeResult(0.0, "miss") -def _tool_calls(): - try: - with open("/workdir/.n_tool_calls") as fh: - return int(fh.read().strip()) - except (OSError, ValueError): - pass - raw = os.environ.get("N_TOOL_CALLS") - if raw is not None: - try: - return int(str(raw).strip()) - except ValueError: - return None - return None - - -def _tool_efficiency(n): - if n is None: - return None - budget = float(os.environ.get("TOOL_BUDGET", "15") or "15") - if budget <= 0: - return None - return max(0.0, min(1.0, 1.0 - n / budget)) +# TOOL EFFICIENCY IS NOT COMPUTED HERE, AND CANNOT BE. +# +# This grader used to emit a `tool_efficiency` key derived from a tool-call count it read from +# `/workdir/.n_tool_calls` or `$N_TOOL_CALLS`. Nothing writes that file and no task.toml sets that +# variable, so the count was always None, the key was always null, and Harbor's reward model +# (`dict[str, float | int]`) rejected the WHOLE dict -- taking `correctness` down with it. The only +# path that survived was the empty-submission branch below, so the suite graded failures correctly +# and crashed on every successful answer. That silently removed 86 of 250 tasks from scoring. +# +# The count is not the sandbox's to know: it lives in the capture proxy, which sees every model call. +# A reward belongs in the verifier only if the sandbox is what makes it computable. Correctness needs +# the data, the gold answer and the tolerances -- it belongs here. Tool efficiency needs a trace -- +# it belongs to whoever holds the trace, and it is computed there as a shaping term, gated on +# correctness so that "made no tool calls" can never outscore solving the task. def _tols(): @@ -156,12 +148,11 @@ def main_json() -> int: question = (os.environ.get("QUESTION") or "").strip() candidate = sys.stdin.read().strip() if not candidate: - print(json.dumps({"correctness": 0.0, "submission": 0.0, "tool_efficiency": 0.0})) + print(json.dumps({"correctness": 0.0, "submission": 0.0})) return 0 at, rt = _tols() r = grade(gold, candidate, question=question, reward_mode=os.environ.get("REWARD_MODE", "") or "", abs_tol=at, rel_tol=rt) - n = _tool_calls() - print(json.dumps({"correctness": float(r.reward), "submission": 1.0, "tool_efficiency": _tool_efficiency(n)})) + print(json.dumps({"correctness": float(r.reward), "submission": 1.0})) print(f"[grader] gold={gold!r} pred={candidate[:80]!r} correctness={r.reward} method={r.method}", file=sys.stderr) return 0