diff --git a/tasks/0001_741_1741873_qa_4/tests/grader.py b/tasks/0001_741_1741873_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_741_1741873_qa_4/tests/grader.py +++ b/tasks/0001_741_1741873_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_746_1746593_qa_2/tests/grader.py b/tasks/0001_746_1746593_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_746_1746593_qa_2/tests/grader.py +++ b/tasks/0001_746_1746593_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_750_1750005_qa_1/tests/grader.py b/tasks/0001_750_1750005_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_750_1750005_qa_1/tests/grader.py +++ b/tasks/0001_750_1750005_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_754_1754320_qa_2/tests/grader.py b/tasks/0001_754_1754320_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_754_1754320_qa_2/tests/grader.py +++ b/tasks/0001_754_1754320_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_755_1755036_qa_1/tests/grader.py b/tasks/0001_755_1755036_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_755_1755036_qa_1/tests/grader.py +++ b/tasks/0001_755_1755036_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_755_1755036_qa_2/tests/grader.py b/tasks/0001_755_1755036_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_755_1755036_qa_2/tests/grader.py +++ b/tasks/0001_755_1755036_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_761_1761668_qa_2/tests/grader.py b/tasks/0001_761_1761668_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_761_1761668_qa_2/tests/grader.py +++ b/tasks/0001_761_1761668_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_761_1761668_qa_3/tests/grader.py b/tasks/0001_761_1761668_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_761_1761668_qa_3/tests/grader.py +++ b/tasks/0001_761_1761668_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_781_1781985_qa_1/tests/grader.py b/tasks/0001_781_1781985_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_781_1781985_qa_1/tests/grader.py +++ b/tasks/0001_781_1781985_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_784_1784765_qa_5/tests/grader.py b/tasks/0001_784_1784765_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_784_1784765_qa_5/tests/grader.py +++ b/tasks/0001_784_1784765_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_789_1789575_qa_1/tests/grader.py b/tasks/0001_789_1789575_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_789_1789575_qa_1/tests/grader.py +++ b/tasks/0001_789_1789575_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_789_1789575_qa_2/tests/grader.py b/tasks/0001_789_1789575_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_789_1789575_qa_2/tests/grader.py +++ b/tasks/0001_789_1789575_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_825_1825877_qa_3/tests/grader.py b/tasks/0001_825_1825877_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_825_1825877_qa_3/tests/grader.py +++ b/tasks/0001_825_1825877_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_825_1825877_qa_5/tests/grader.py b/tasks/0001_825_1825877_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_825_1825877_qa_5/tests/grader.py +++ b/tasks/0001_825_1825877_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_840_1840182_qa_2/tests/grader.py b/tasks/0001_840_1840182_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_840_1840182_qa_2/tests/grader.py +++ b/tasks/0001_840_1840182_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_840_1840182_qa_3/tests/grader.py b/tasks/0001_840_1840182_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_840_1840182_qa_3/tests/grader.py +++ b/tasks/0001_840_1840182_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_840_1840182_qa_4/tests/grader.py b/tasks/0001_840_1840182_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_840_1840182_qa_4/tests/grader.py +++ b/tasks/0001_840_1840182_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_850_1850034_qa_2/tests/grader.py b/tasks/0001_850_1850034_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_850_1850034_qa_2/tests/grader.py +++ b/tasks/0001_850_1850034_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_850_1850034_qa_5/tests/grader.py b/tasks/0001_850_1850034_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_850_1850034_qa_5/tests/grader.py +++ b/tasks/0001_850_1850034_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_860_1860651_qa_4/tests/grader.py b/tasks/0001_860_1860651_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_860_1860651_qa_4/tests/grader.py +++ b/tasks/0001_860_1860651_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_864_1864781_qa_3/tests/grader.py b/tasks/0001_864_1864781_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_864_1864781_qa_3/tests/grader.py +++ b/tasks/0001_864_1864781_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_864_1864781_qa_4/tests/grader.py b/tasks/0001_864_1864781_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_864_1864781_qa_4/tests/grader.py +++ b/tasks/0001_864_1864781_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_866_1866353_qa_1/tests/grader.py b/tasks/0001_866_1866353_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_866_1866353_qa_1/tests/grader.py +++ b/tasks/0001_866_1866353_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_866_1866353_qa_2/tests/grader.py b/tasks/0001_866_1866353_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_866_1866353_qa_2/tests/grader.py +++ b/tasks/0001_866_1866353_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_869_1869308_qa_4/tests/grader.py b/tasks/0001_869_1869308_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_869_1869308_qa_4/tests/grader.py +++ b/tasks/0001_869_1869308_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_869_1869526_qa_5/tests/grader.py b/tasks/0001_869_1869526_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_869_1869526_qa_5/tests/grader.py +++ b/tasks/0001_869_1869526_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_869_1869604_qa_2/tests/grader.py b/tasks/0001_869_1869604_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_869_1869604_qa_2/tests/grader.py +++ b/tasks/0001_869_1869604_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_871_1871102_qa_2/tests/grader.py b/tasks/0001_871_1871102_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_871_1871102_qa_2/tests/grader.py +++ b/tasks/0001_871_1871102_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_875_1875604_qa_1/tests/grader.py b/tasks/0001_875_1875604_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_875_1875604_qa_1/tests/grader.py +++ b/tasks/0001_875_1875604_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_876_1876377_qa_2/tests/grader.py b/tasks/0001_876_1876377_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_876_1876377_qa_2/tests/grader.py +++ b/tasks/0001_876_1876377_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_878_1878667_qa_2/tests/grader.py b/tasks/0001_878_1878667_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_878_1878667_qa_2/tests/grader.py +++ b/tasks/0001_878_1878667_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_878_1878667_qa_5/tests/grader.py b/tasks/0001_878_1878667_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_878_1878667_qa_5/tests/grader.py +++ b/tasks/0001_878_1878667_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_878_1878746_qa_1/tests/grader.py b/tasks/0001_878_1878746_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_878_1878746_qa_1/tests/grader.py +++ b/tasks/0001_878_1878746_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_878_1878746_qa_2/tests/grader.py b/tasks/0001_878_1878746_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_878_1878746_qa_2/tests/grader.py +++ b/tasks/0001_878_1878746_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_878_1878746_qa_4/tests/grader.py b/tasks/0001_878_1878746_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_878_1878746_qa_4/tests/grader.py +++ b/tasks/0001_878_1878746_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_882_1882893_qa_3/tests/grader.py b/tasks/0001_882_1882893_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_882_1882893_qa_3/tests/grader.py +++ b/tasks/0001_882_1882893_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_885_1885477_qa_5/tests/grader.py b/tasks/0001_885_1885477_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_885_1885477_qa_5/tests/grader.py +++ b/tasks/0001_885_1885477_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_888_1888068_qa_2/tests/grader.py b/tasks/0001_888_1888068_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_888_1888068_qa_2/tests/grader.py +++ b/tasks/0001_888_1888068_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_892_1892691_qa_2/tests/grader.py b/tasks/0001_892_1892691_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_892_1892691_qa_2/tests/grader.py +++ b/tasks/0001_892_1892691_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_892_1892691_qa_3/tests/grader.py b/tasks/0001_892_1892691_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_892_1892691_qa_3/tests/grader.py +++ b/tasks/0001_892_1892691_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_892_1892776_qa_1/tests/grader.py b/tasks/0001_892_1892776_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_892_1892776_qa_1/tests/grader.py +++ b/tasks/0001_892_1892776_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_892_1892776_qa_2/tests/grader.py b/tasks/0001_892_1892776_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_892_1892776_qa_2/tests/grader.py +++ b/tasks/0001_892_1892776_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_892_1892776_qa_4/tests/grader.py b/tasks/0001_892_1892776_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_892_1892776_qa_4/tests/grader.py +++ b/tasks/0001_892_1892776_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_893_1893246_qa_3/tests/grader.py b/tasks/0001_893_1893246_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_893_1893246_qa_3/tests/grader.py +++ b/tasks/0001_893_1893246_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_894_1894014_qa_2/tests/grader.py b/tasks/0001_894_1894014_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_894_1894014_qa_2/tests/grader.py +++ b/tasks/0001_894_1894014_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_897_1897174_qa_5/tests/grader.py b/tasks/0001_897_1897174_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_897_1897174_qa_5/tests/grader.py +++ b/tasks/0001_897_1897174_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_898_1898542_qa_4/tests/grader.py b/tasks/0001_898_1898542_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_898_1898542_qa_4/tests/grader.py +++ b/tasks/0001_898_1898542_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_902_1902242_qa_4/tests/grader.py b/tasks/0001_902_1902242_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_902_1902242_qa_4/tests/grader.py +++ b/tasks/0001_902_1902242_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_902_1902890_qa_5/tests/grader.py b/tasks/0001_902_1902890_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_902_1902890_qa_5/tests/grader.py +++ b/tasks/0001_902_1902890_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_903_1903160_qa_2/tests/grader.py b/tasks/0001_903_1903160_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_903_1903160_qa_2/tests/grader.py +++ b/tasks/0001_903_1903160_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_903_1903160_qa_3/tests/grader.py b/tasks/0001_903_1903160_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_903_1903160_qa_3/tests/grader.py +++ b/tasks/0001_903_1903160_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_904_1904660_qa_4/tests/grader.py b/tasks/0001_904_1904660_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_904_1904660_qa_4/tests/grader.py +++ b/tasks/0001_904_1904660_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_906_1906064_qa_4/tests/grader.py b/tasks/0001_906_1906064_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_906_1906064_qa_4/tests/grader.py +++ b/tasks/0001_906_1906064_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_908_1908198_qa_1/tests/grader.py b/tasks/0001_908_1908198_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_908_1908198_qa_1/tests/grader.py +++ b/tasks/0001_908_1908198_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_909_1909933_qa_4/tests/grader.py b/tasks/0001_909_1909933_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_909_1909933_qa_4/tests/grader.py +++ b/tasks/0001_909_1909933_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_916_1916491_qa_4/tests/grader.py b/tasks/0001_916_1916491_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_916_1916491_qa_4/tests/grader.py +++ b/tasks/0001_916_1916491_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_918_1918012_qa_2/tests/grader.py b/tasks/0001_918_1918012_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_918_1918012_qa_2/tests/grader.py +++ b/tasks/0001_918_1918012_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_918_1918012_qa_3/tests/grader.py b/tasks/0001_918_1918012_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_918_1918012_qa_3/tests/grader.py +++ b/tasks/0001_918_1918012_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_918_1918012_qa_5/tests/grader.py b/tasks/0001_918_1918012_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_918_1918012_qa_5/tests/grader.py +++ b/tasks/0001_918_1918012_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_918_1918045_qa_2/tests/grader.py b/tasks/0001_918_1918045_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_918_1918045_qa_2/tests/grader.py +++ b/tasks/0001_918_1918045_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_918_1918045_qa_4/tests/grader.py b/tasks/0001_918_1918045_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_918_1918045_qa_4/tests/grader.py +++ b/tasks/0001_918_1918045_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_930_1930122_qa_2/tests/grader.py b/tasks/0001_930_1930122_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_930_1930122_qa_2/tests/grader.py +++ b/tasks/0001_930_1930122_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_930_1930899_qa_1/tests/grader.py b/tasks/0001_930_1930899_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_930_1930899_qa_1/tests/grader.py +++ b/tasks/0001_930_1930899_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_930_1930899_qa_5/tests/grader.py b/tasks/0001_930_1930899_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_930_1930899_qa_5/tests/grader.py +++ b/tasks/0001_930_1930899_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_935_1935106_qa_2/tests/grader.py b/tasks/0001_935_1935106_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_935_1935106_qa_2/tests/grader.py +++ b/tasks/0001_935_1935106_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_937_1937476_qa_1/tests/grader.py b/tasks/0001_937_1937476_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_937_1937476_qa_1/tests/grader.py +++ b/tasks/0001_937_1937476_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_937_1937476_qa_2/tests/grader.py b/tasks/0001_937_1937476_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_937_1937476_qa_2/tests/grader.py +++ b/tasks/0001_937_1937476_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_938_1938182_qa_3/tests/grader.py b/tasks/0001_938_1938182_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_938_1938182_qa_3/tests/grader.py +++ b/tasks/0001_938_1938182_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_938_1938182_qa_5/tests/grader.py b/tasks/0001_938_1938182_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_938_1938182_qa_5/tests/grader.py +++ b/tasks/0001_938_1938182_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_955_1955907_qa_3/tests/grader.py b/tasks/0001_955_1955907_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_955_1955907_qa_3/tests/grader.py +++ b/tasks/0001_955_1955907_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_955_1955907_qa_5/tests/grader.py b/tasks/0001_955_1955907_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_955_1955907_qa_5/tests/grader.py +++ b/tasks/0001_955_1955907_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_956_1956536_qa_4/tests/grader.py b/tasks/0001_956_1956536_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_956_1956536_qa_4/tests/grader.py +++ b/tasks/0001_956_1956536_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_959_1959663_qa_3/tests/grader.py b/tasks/0001_959_1959663_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_959_1959663_qa_3/tests/grader.py +++ b/tasks/0001_959_1959663_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_969_1969476_qa_2/tests/grader.py b/tasks/0001_969_1969476_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_969_1969476_qa_2/tests/grader.py +++ b/tasks/0001_969_1969476_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_969_1969476_qa_3/tests/grader.py b/tasks/0001_969_1969476_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_969_1969476_qa_3/tests/grader.py +++ b/tasks/0001_969_1969476_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_973_1973830_qa_4/tests/grader.py b/tasks/0001_973_1973830_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_973_1973830_qa_4/tests/grader.py +++ b/tasks/0001_973_1973830_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_975_1975169_qa_3/tests/grader.py b/tasks/0001_975_1975169_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_975_1975169_qa_3/tests/grader.py +++ b/tasks/0001_975_1975169_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_975_1975497_qa_3/tests/grader.py b/tasks/0001_975_1975497_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_975_1975497_qa_3/tests/grader.py +++ b/tasks/0001_975_1975497_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_975_1975497_qa_4/tests/grader.py b/tasks/0001_975_1975497_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_975_1975497_qa_4/tests/grader.py +++ b/tasks/0001_975_1975497_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_989_1989309_qa_2/tests/grader.py b/tasks/0001_989_1989309_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_989_1989309_qa_2/tests/grader.py +++ b/tasks/0001_989_1989309_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_990_1990392_qa_4/tests/grader.py b/tasks/0001_990_1990392_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_990_1990392_qa_4/tests/grader.py +++ b/tasks/0001_990_1990392_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_990_1990794_qa_2/tests/grader.py b/tasks/0001_990_1990794_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_990_1990794_qa_2/tests/grader.py +++ b/tasks/0001_990_1990794_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_990_1990794_qa_3/tests/grader.py b/tasks/0001_990_1990794_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_990_1990794_qa_3/tests/grader.py +++ b/tasks/0001_990_1990794_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_990_1990794_qa_5/tests/grader.py b/tasks/0001_990_1990794_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_990_1990794_qa_5/tests/grader.py +++ b/tasks/0001_990_1990794_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_991_1991376_qa_4/tests/grader.py b/tasks/0001_991_1991376_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_991_1991376_qa_4/tests/grader.py +++ b/tasks/0001_991_1991376_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_998_1998202_qa_2/tests/grader.py b/tasks/0001_998_1998202_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0001_998_1998202_qa_2/tests/grader.py +++ b/tasks/0001_998_1998202_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_081_2081941_qa_2/tests/grader.py b/tasks/0002_081_2081941_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_081_2081941_qa_2/tests/grader.py +++ b/tasks/0002_081_2081941_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_081_2081941_qa_4/tests/grader.py b/tasks/0002_081_2081941_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_081_2081941_qa_4/tests/grader.py +++ b/tasks/0002_081_2081941_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_084_2084371_qa_5/tests/grader.py b/tasks/0002_084_2084371_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_084_2084371_qa_5/tests/grader.py +++ b/tasks/0002_084_2084371_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/0002_092_2092240_qa_1/tests/grader.py b/tasks/0002_092_2092240_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_092_2092240_qa_1/tests/grader.py +++ b/tasks/0002_092_2092240_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_092_2092240_qa_4/tests/grader.py b/tasks/0002_092_2092240_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_092_2092240_qa_4/tests/grader.py +++ b/tasks/0002_092_2092240_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_092_2092240_qa_5/tests/grader.py b/tasks/0002_092_2092240_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_092_2092240_qa_5/tests/grader.py +++ b/tasks/0002_092_2092240_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/0002_093_2093580_qa_1/tests/grader.py b/tasks/0002_093_2093580_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_093_2093580_qa_1/tests/grader.py +++ b/tasks/0002_093_2093580_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_2094789_qa_1/tests/grader.py b/tasks/0002_094_2094789_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_094_2094789_qa_1/tests/grader.py +++ b/tasks/0002_094_2094789_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_2094789_qa_3/tests/grader.py b/tasks/0002_094_2094789_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_094_2094789_qa_3/tests/grader.py +++ b/tasks/0002_094_2094789_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/0002_094_2094844_qa_1/tests/grader.py b/tasks/0002_094_2094844_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_094_2094844_qa_1/tests/grader.py +++ b/tasks/0002_094_2094844_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_3/tests/grader.py b/tasks/0002_094_2094844_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_094_2094844_qa_3/tests/grader.py +++ b/tasks/0002_094_2094844_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/0002_105_2105396_qa_1/tests/grader.py b/tasks/0002_105_2105396_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_105_2105396_qa_1/tests/grader.py +++ b/tasks/0002_105_2105396_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_105_2105769_qa_3/tests/grader.py b/tasks/0002_105_2105769_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_105_2105769_qa_3/tests/grader.py +++ b/tasks/0002_105_2105769_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/0002_109_2109152_qa_1/tests/grader.py b/tasks/0002_109_2109152_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_109_2109152_qa_1/tests/grader.py +++ b/tasks/0002_109_2109152_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_128_2128926_qa_4/tests/grader.py b/tasks/0002_128_2128926_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_128_2128926_qa_4/tests/grader.py +++ b/tasks/0002_128_2128926_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_133_2133400_qa_2/tests/grader.py b/tasks/0002_133_2133400_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_133_2133400_qa_2/tests/grader.py +++ b/tasks/0002_133_2133400_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_144_2144947_qa_1/tests/grader.py b/tasks/0002_144_2144947_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_144_2144947_qa_1/tests/grader.py +++ b/tasks/0002_144_2144947_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_152_2152103_qa_1/tests/grader.py b/tasks/0002_152_2152103_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_152_2152103_qa_1/tests/grader.py +++ b/tasks/0002_152_2152103_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_156_2156667_qa_2/tests/grader.py b/tasks/0002_156_2156667_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_156_2156667_qa_2/tests/grader.py +++ b/tasks/0002_156_2156667_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_157_2157761_qa_1/tests/grader.py b/tasks/0002_157_2157761_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_157_2157761_qa_1/tests/grader.py +++ b/tasks/0002_157_2157761_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_158_2158528_qa_4/tests/grader.py b/tasks/0002_158_2158528_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_158_2158528_qa_4/tests/grader.py +++ b/tasks/0002_158_2158528_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_163_2163197_qa_3/tests/grader.py b/tasks/0002_163_2163197_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_163_2163197_qa_3/tests/grader.py +++ b/tasks/0002_163_2163197_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/0002_163_2163197_qa_5/tests/grader.py b/tasks/0002_163_2163197_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_163_2163197_qa_5/tests/grader.py +++ b/tasks/0002_163_2163197_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/0002_170_2170781_qa_1/tests/grader.py b/tasks/0002_170_2170781_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_170_2170781_qa_1/tests/grader.py +++ b/tasks/0002_170_2170781_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_182_2182549_qa_3/tests/grader.py b/tasks/0002_182_2182549_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_182_2182549_qa_3/tests/grader.py +++ b/tasks/0002_182_2182549_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/0002_203_2203836_qa_3/tests/grader.py b/tasks/0002_203_2203836_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_203_2203836_qa_3/tests/grader.py +++ b/tasks/0002_203_2203836_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/0002_203_2203836_qa_4/tests/grader.py b/tasks/0002_203_2203836_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_203_2203836_qa_4/tests/grader.py +++ b/tasks/0002_203_2203836_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_203_2203836_qa_5/tests/grader.py b/tasks/0002_203_2203836_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_203_2203836_qa_5/tests/grader.py +++ b/tasks/0002_203_2203836_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/0002_203_2203940_qa_1/tests/grader.py b/tasks/0002_203_2203940_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_203_2203940_qa_1/tests/grader.py +++ b/tasks/0002_203_2203940_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_203_2203940_qa_5/tests/grader.py b/tasks/0002_203_2203940_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_203_2203940_qa_5/tests/grader.py +++ b/tasks/0002_203_2203940_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/0002_211_2211506_qa_1/tests/grader.py b/tasks/0002_211_2211506_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_211_2211506_qa_1/tests/grader.py +++ b/tasks/0002_211_2211506_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_217_2217508_qa_3/tests/grader.py b/tasks/0002_217_2217508_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_217_2217508_qa_3/tests/grader.py +++ b/tasks/0002_217_2217508_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/0002_217_2217977_qa_1/tests/grader.py b/tasks/0002_217_2217977_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_217_2217977_qa_1/tests/grader.py +++ b/tasks/0002_217_2217977_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_219_2219893_qa_3/tests/grader.py b/tasks/0002_219_2219893_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_219_2219893_qa_3/tests/grader.py +++ b/tasks/0002_219_2219893_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/0002_234_2234436_qa_1/tests/grader.py b/tasks/0002_234_2234436_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_234_2234436_qa_1/tests/grader.py +++ b/tasks/0002_234_2234436_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_240_2240465_qa_4/tests/grader.py b/tasks/0002_240_2240465_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_240_2240465_qa_4/tests/grader.py +++ b/tasks/0002_240_2240465_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_246_2246634_qa_4/tests/grader.py b/tasks/0002_246_2246634_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_246_2246634_qa_4/tests/grader.py +++ b/tasks/0002_246_2246634_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_253_2253632_qa_1/tests/grader.py b/tasks/0002_253_2253632_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_253_2253632_qa_1/tests/grader.py +++ b/tasks/0002_253_2253632_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_253_2253838_qa_5/tests/grader.py b/tasks/0002_253_2253838_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_253_2253838_qa_5/tests/grader.py +++ b/tasks/0002_253_2253838_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/0002_264_2264461_qa_1/tests/grader.py b/tasks/0002_264_2264461_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_264_2264461_qa_1/tests/grader.py +++ b/tasks/0002_264_2264461_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_276_2276545_qa_2/tests/grader.py b/tasks/0002_276_2276545_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_276_2276545_qa_2/tests/grader.py +++ b/tasks/0002_276_2276545_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_325_2325668_qa_5/tests/grader.py b/tasks/0002_325_2325668_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_325_2325668_qa_5/tests/grader.py +++ b/tasks/0002_325_2325668_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/0002_349_2349296_qa_2/tests/grader.py b/tasks/0002_349_2349296_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_349_2349296_qa_2/tests/grader.py +++ b/tasks/0002_349_2349296_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_349_2349296_qa_3/tests/grader.py b/tasks/0002_349_2349296_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_349_2349296_qa_3/tests/grader.py +++ b/tasks/0002_349_2349296_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/0002_350_2350400_qa_3/tests/grader.py b/tasks/0002_350_2350400_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_350_2350400_qa_3/tests/grader.py +++ b/tasks/0002_350_2350400_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/0002_351_2351047_qa_1/tests/grader.py b/tasks/0002_351_2351047_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_351_2351047_qa_1/tests/grader.py +++ b/tasks/0002_351_2351047_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_375_2375931_qa_1/tests/grader.py b/tasks/0002_375_2375931_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_375_2375931_qa_1/tests/grader.py +++ b/tasks/0002_375_2375931_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_375_2375931_qa_3/tests/grader.py b/tasks/0002_375_2375931_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_375_2375931_qa_3/tests/grader.py +++ b/tasks/0002_375_2375931_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/0002_376_2376035_qa_1/tests/grader.py b/tasks/0002_376_2376035_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0002_376_2376035_qa_1/tests/grader.py +++ b/tasks/0002_376_2376035_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_098_10098449_qa_1/tests/grader.py b/tasks/0010_098_10098449_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_098_10098449_qa_1/tests/grader.py +++ b/tasks/0010_098_10098449_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_191_10191909_qa_1/tests/grader.py b/tasks/0010_191_10191909_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_191_10191909_qa_1/tests/grader.py +++ b/tasks/0010_191_10191909_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_191_10191909_qa_4/tests/grader.py b/tasks/0010_191_10191909_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_191_10191909_qa_4/tests/grader.py +++ b/tasks/0010_191_10191909_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_361_10361003_qa_5/tests/grader.py b/tasks/0010_361_10361003_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_361_10361003_qa_5/tests/grader.py +++ b/tasks/0010_361_10361003_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/0010_376_10376491_qa_3/tests/grader.py b/tasks/0010_376_10376491_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_376_10376491_qa_3/tests/grader.py +++ b/tasks/0010_376_10376491_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/0010_391_10391673_qa_1/tests/grader.py b/tasks/0010_391_10391673_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_391_10391673_qa_1/tests/grader.py +++ b/tasks/0010_391_10391673_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_482_10482813_qa_1/tests/grader.py b/tasks/0010_482_10482813_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_482_10482813_qa_1/tests/grader.py +++ b/tasks/0010_482_10482813_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_489_10489077_qa_1/tests/grader.py b/tasks/0010_489_10489077_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_489_10489077_qa_1/tests/grader.py +++ b/tasks/0010_489_10489077_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_489_10489077_qa_4/tests/grader.py b/tasks/0010_489_10489077_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_489_10489077_qa_4/tests/grader.py +++ b/tasks/0010_489_10489077_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_506_10506952_qa_2/tests/grader.py b/tasks/0010_506_10506952_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_506_10506952_qa_2/tests/grader.py +++ b/tasks/0010_506_10506952_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_506_10506952_qa_4/tests/grader.py b/tasks/0010_506_10506952_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_506_10506952_qa_4/tests/grader.py +++ b/tasks/0010_506_10506952_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_515_10515511_qa_1/tests/grader.py b/tasks/0010_515_10515511_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_515_10515511_qa_1/tests/grader.py +++ b/tasks/0010_515_10515511_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_614_10614011_qa_1/tests/grader.py b/tasks/0010_614_10614011_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_614_10614011_qa_1/tests/grader.py +++ b/tasks/0010_614_10614011_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_624_10624322_qa_3/tests/grader.py b/tasks/0010_624_10624322_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_624_10624322_qa_3/tests/grader.py +++ b/tasks/0010_624_10624322_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/0010_624_10624322_qa_4/tests/grader.py b/tasks/0010_624_10624322_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_624_10624322_qa_4/tests/grader.py +++ b/tasks/0010_624_10624322_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_631_10631903_qa_1/tests/grader.py b/tasks/0010_631_10631903_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_631_10631903_qa_1/tests/grader.py +++ b/tasks/0010_631_10631903_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_637_10637554_qa_1/tests/grader.py b/tasks/0010_637_10637554_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_637_10637554_qa_1/tests/grader.py +++ b/tasks/0010_637_10637554_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_708_10708335_qa_2/tests/grader.py b/tasks/0010_708_10708335_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_708_10708335_qa_2/tests/grader.py +++ b/tasks/0010_708_10708335_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_821_10821945_qa_3/tests/grader.py b/tasks/0010_821_10821945_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_821_10821945_qa_3/tests/grader.py +++ b/tasks/0010_821_10821945_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/0010_841_10841985_qa_3/tests/grader.py b/tasks/0010_841_10841985_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_841_10841985_qa_3/tests/grader.py +++ b/tasks/0010_841_10841985_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/0010_842_10842977_qa_3/tests/grader.py b/tasks/0010_842_10842977_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_842_10842977_qa_3/tests/grader.py +++ b/tasks/0010_842_10842977_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/0010_842_10842977_qa_4/tests/grader.py b/tasks/0010_842_10842977_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_842_10842977_qa_4/tests/grader.py +++ b/tasks/0010_842_10842977_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_843_10843239_qa_1/tests/grader.py b/tasks/0010_843_10843239_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_843_10843239_qa_1/tests/grader.py +++ b/tasks/0010_843_10843239_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_843_10843239_qa_2/tests/grader.py b/tasks/0010_843_10843239_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_843_10843239_qa_2/tests/grader.py +++ b/tasks/0010_843_10843239_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_860_10860955_qa_1/tests/grader.py b/tasks/0010_860_10860955_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_860_10860955_qa_1/tests/grader.py +++ b/tasks/0010_860_10860955_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_909_10909980_qa_3/tests/grader.py b/tasks/0010_909_10909980_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0010_909_10909980_qa_3/tests/grader.py +++ b/tasks/0010_909_10909980_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_015_11015604_qa_2/tests/grader.py b/tasks/0011_015_11015604_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_015_11015604_qa_2/tests/grader.py +++ b/tasks/0011_015_11015604_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_015_11015604_qa_4/tests/grader.py b/tasks/0011_015_11015604_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_015_11015604_qa_4/tests/grader.py +++ b/tasks/0011_015_11015604_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_015_11015604_qa_5/tests/grader.py b/tasks/0011_015_11015604_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_015_11015604_qa_5/tests/grader.py +++ b/tasks/0011_015_11015604_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_054_11054618_qa_1/tests/grader.py b/tasks/0011_054_11054618_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_054_11054618_qa_1/tests/grader.py +++ b/tasks/0011_054_11054618_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_054_11054618_qa_5/tests/grader.py b/tasks/0011_054_11054618_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_054_11054618_qa_5/tests/grader.py +++ b/tasks/0011_054_11054618_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_060_11060050_qa_4/tests/grader.py b/tasks/0011_060_11060050_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_060_11060050_qa_4/tests/grader.py +++ b/tasks/0011_060_11060050_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_088_11088784_qa_2/tests/grader.py b/tasks/0011_088_11088784_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_088_11088784_qa_2/tests/grader.py +++ b/tasks/0011_088_11088784_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_130_11130431_qa_2/tests/grader.py b/tasks/0011_130_11130431_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_130_11130431_qa_2/tests/grader.py +++ b/tasks/0011_130_11130431_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_130_11130431_qa_4/tests/grader.py b/tasks/0011_130_11130431_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_130_11130431_qa_4/tests/grader.py +++ b/tasks/0011_130_11130431_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_224_11224334_qa_1/tests/grader.py b/tasks/0011_224_11224334_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_224_11224334_qa_1/tests/grader.py +++ b/tasks/0011_224_11224334_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_271_11271761_qa_2/tests/grader.py b/tasks/0011_271_11271761_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_271_11271761_qa_2/tests/grader.py +++ b/tasks/0011_271_11271761_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_355_11355842_qa_3/tests/grader.py b/tasks/0011_355_11355842_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_355_11355842_qa_3/tests/grader.py +++ b/tasks/0011_355_11355842_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_355_11355842_qa_4/tests/grader.py b/tasks/0011_355_11355842_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_355_11355842_qa_4/tests/grader.py +++ b/tasks/0011_355_11355842_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_450_11450569_qa_4/tests/grader.py b/tasks/0011_450_11450569_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_450_11450569_qa_4/tests/grader.py +++ b/tasks/0011_450_11450569_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_506_11506450_qa_4/tests/grader.py b/tasks/0011_506_11506450_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_506_11506450_qa_4/tests/grader.py +++ b/tasks/0011_506_11506450_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_508_11508075_qa_1/tests/grader.py b/tasks/0011_508_11508075_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_508_11508075_qa_1/tests/grader.py +++ b/tasks/0011_508_11508075_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_544_11544512_qa_4/tests/grader.py b/tasks/0011_544_11544512_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_544_11544512_qa_4/tests/grader.py +++ b/tasks/0011_544_11544512_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_548_11548867_qa_2/tests/grader.py b/tasks/0011_548_11548867_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_548_11548867_qa_2/tests/grader.py +++ b/tasks/0011_548_11548867_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_11587305_qa_5/tests/grader.py b/tasks/0011_587_11587305_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_587_11587305_qa_5/tests/grader.py +++ b/tasks/0011_587_11587305_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_637_11637182_qa_3/tests/grader.py b/tasks/0011_637_11637182_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_637_11637182_qa_3/tests/grader.py +++ b/tasks/0011_637_11637182_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_654_11654148_qa_3/tests/grader.py b/tasks/0011_654_11654148_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_654_11654148_qa_3/tests/grader.py +++ b/tasks/0011_654_11654148_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_763_11763257_qa_1/tests/grader.py b/tasks/0011_763_11763257_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_763_11763257_qa_1/tests/grader.py +++ b/tasks/0011_763_11763257_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_763_11763257_qa_2/tests/grader.py b/tasks/0011_763_11763257_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_763_11763257_qa_2/tests/grader.py +++ b/tasks/0011_763_11763257_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_763_11763257_qa_4/tests/grader.py b/tasks/0011_763_11763257_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_763_11763257_qa_4/tests/grader.py +++ b/tasks/0011_763_11763257_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_821_11821121_qa_2/tests/grader.py b/tasks/0011_821_11821121_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_821_11821121_qa_2/tests/grader.py +++ b/tasks/0011_821_11821121_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_842_11842614_qa_1/tests/grader.py b/tasks/0011_842_11842614_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_842_11842614_qa_1/tests/grader.py +++ b/tasks/0011_842_11842614_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_842_11842614_qa_2/tests/grader.py b/tasks/0011_842_11842614_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_842_11842614_qa_2/tests/grader.py +++ b/tasks/0011_842_11842614_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_954_11954276_qa_3/tests/grader.py b/tasks/0011_954_11954276_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_954_11954276_qa_3/tests/grader.py +++ b/tasks/0011_954_11954276_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_970_11970593_qa_2/tests/grader.py b/tasks/0011_970_11970593_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_970_11970593_qa_2/tests/grader.py +++ b/tasks/0011_970_11970593_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_998_11998157_qa_3/tests/grader.py b/tasks/0011_998_11998157_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_998_11998157_qa_3/tests/grader.py +++ b/tasks/0011_998_11998157_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_998_11998157_qa_4/tests/grader.py b/tasks/0011_998_11998157_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_998_11998157_qa_4/tests/grader.py +++ b/tasks/0011_998_11998157_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_998_11998157_qa_5/tests/grader.py b/tasks/0011_998_11998157_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0011_998_11998157_qa_5/tests/grader.py +++ b/tasks/0011_998_11998157_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_075_12075481_qa_1/tests/grader.py b/tasks/0012_075_12075481_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_075_12075481_qa_1/tests/grader.py +++ b/tasks/0012_075_12075481_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/0012_075_12075481_qa_2/tests/grader.py b/tasks/0012_075_12075481_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_075_12075481_qa_2/tests/grader.py +++ b/tasks/0012_075_12075481_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_075_12075481_qa_5/tests/grader.py b/tasks/0012_075_12075481_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_075_12075481_qa_5/tests/grader.py +++ b/tasks/0012_075_12075481_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_101_12101308_qa_2/tests/grader.py b/tasks/0012_101_12101308_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_101_12101308_qa_2/tests/grader.py +++ b/tasks/0012_101_12101308_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_101_12101336_qa_5/tests/grader.py b/tasks/0012_101_12101336_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_101_12101336_qa_5/tests/grader.py +++ b/tasks/0012_101_12101336_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_112_12112066_qa_4/tests/grader.py b/tasks/0012_112_12112066_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_112_12112066_qa_4/tests/grader.py +++ b/tasks/0012_112_12112066_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_112_12112975_qa_1/tests/grader.py b/tasks/0012_112_12112975_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_112_12112975_qa_1/tests/grader.py +++ b/tasks/0012_112_12112975_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/0012_112_12112975_qa_3/tests/grader.py b/tasks/0012_112_12112975_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_112_12112975_qa_3/tests/grader.py +++ b/tasks/0012_112_12112975_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_161_12161282_qa_4/tests/grader.py b/tasks/0012_161_12161282_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_161_12161282_qa_4/tests/grader.py +++ b/tasks/0012_161_12161282_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_179_12179865_qa_4/tests/grader.py b/tasks/0012_179_12179865_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_179_12179865_qa_4/tests/grader.py +++ b/tasks/0012_179_12179865_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_2/tests/grader.py b/tasks/0012_222_12222108_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_222_12222108_qa_2/tests/grader.py +++ b/tasks/0012_222_12222108_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_330_12330544_qa_3/tests/grader.py b/tasks/0012_330_12330544_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_330_12330544_qa_3/tests/grader.py +++ b/tasks/0012_330_12330544_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_556_12556896_qa_1/tests/grader.py b/tasks/0012_556_12556896_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_556_12556896_qa_1/tests/grader.py +++ b/tasks/0012_556_12556896_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/0012_556_12556896_qa_5/tests/grader.py b/tasks/0012_556_12556896_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_556_12556896_qa_5/tests/grader.py +++ b/tasks/0012_556_12556896_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_593_12593899_qa_2/tests/grader.py b/tasks/0012_593_12593899_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_593_12593899_qa_2/tests/grader.py +++ b/tasks/0012_593_12593899_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_689_12689524_qa_2/tests/grader.py b/tasks/0012_689_12689524_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_689_12689524_qa_2/tests/grader.py +++ b/tasks/0012_689_12689524_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_689_12689524_qa_4/tests/grader.py b/tasks/0012_689_12689524_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_689_12689524_qa_4/tests/grader.py +++ b/tasks/0012_689_12689524_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_748_12748314_qa_1/tests/grader.py b/tasks/0012_748_12748314_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_748_12748314_qa_1/tests/grader.py +++ b/tasks/0012_748_12748314_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/0012_748_12748314_qa_3/tests/grader.py b/tasks/0012_748_12748314_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_748_12748314_qa_3/tests/grader.py +++ b/tasks/0012_748_12748314_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_748_12748314_qa_4/tests/grader.py b/tasks/0012_748_12748314_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_748_12748314_qa_4/tests/grader.py +++ b/tasks/0012_748_12748314_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_761_12761066_qa_2/tests/grader.py b/tasks/0012_761_12761066_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_761_12761066_qa_2/tests/grader.py +++ b/tasks/0012_761_12761066_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_834_12834655_qa_4/tests/grader.py b/tasks/0012_834_12834655_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_834_12834655_qa_4/tests/grader.py +++ b/tasks/0012_834_12834655_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_840_12840531_qa_5/tests/grader.py b/tasks/0012_840_12840531_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_840_12840531_qa_5/tests/grader.py +++ b/tasks/0012_840_12840531_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_856_12856368_qa_3/tests/grader.py b/tasks/0012_856_12856368_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_856_12856368_qa_3/tests/grader.py +++ b/tasks/0012_856_12856368_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_920_12920904_qa_2/tests/grader.py b/tasks/0012_920_12920904_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_920_12920904_qa_2/tests/grader.py +++ b/tasks/0012_920_12920904_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_920_12920904_qa_4/tests/grader.py b/tasks/0012_920_12920904_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_920_12920904_qa_4/tests/grader.py +++ b/tasks/0012_920_12920904_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_920_12920904_qa_5/tests/grader.py b/tasks/0012_920_12920904_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_920_12920904_qa_5/tests/grader.py +++ b/tasks/0012_920_12920904_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_941_12941575_qa_2/tests/grader.py b/tasks/0012_941_12941575_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_941_12941575_qa_2/tests/grader.py +++ b/tasks/0012_941_12941575_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_949_12949007_qa_3/tests/grader.py b/tasks/0012_949_12949007_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_949_12949007_qa_3/tests/grader.py +++ b/tasks/0012_949_12949007_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_949_12949007_qa_4/tests/grader.py b/tasks/0012_949_12949007_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_949_12949007_qa_4/tests/grader.py +++ b/tasks/0012_949_12949007_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_972_12972339_qa_3/tests/grader.py b/tasks/0012_972_12972339_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_972_12972339_qa_3/tests/grader.py +++ b/tasks/0012_972_12972339_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_992_12992267_qa_3/tests/grader.py b/tasks/0012_992_12992267_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_992_12992267_qa_3/tests/grader.py +++ b/tasks/0012_992_12992267_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_992_12992267_qa_5/tests/grader.py b/tasks/0012_992_12992267_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0012_992_12992267_qa_5/tests/grader.py +++ b/tasks/0012_992_12992267_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_067_13067540_qa_4/tests/grader.py b/tasks/0013_067_13067540_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_067_13067540_qa_4/tests/grader.py +++ b/tasks/0013_067_13067540_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_072_13072460_qa_4/tests/grader.py b/tasks/0013_072_13072460_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_072_13072460_qa_4/tests/grader.py +++ b/tasks/0013_072_13072460_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_081_13081151_qa_1/tests/grader.py b/tasks/0013_081_13081151_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_081_13081151_qa_1/tests/grader.py +++ b/tasks/0013_081_13081151_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_081_13081725_qa_3/tests/grader.py b/tasks/0013_081_13081725_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_081_13081725_qa_3/tests/grader.py +++ b/tasks/0013_081_13081725_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_126_13126909_qa_2/tests/grader.py b/tasks/0013_126_13126909_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_126_13126909_qa_2/tests/grader.py +++ b/tasks/0013_126_13126909_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/0013_126_13126909_qa_3/tests/grader.py b/tasks/0013_126_13126909_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_126_13126909_qa_3/tests/grader.py +++ b/tasks/0013_126_13126909_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_126_13126909_qa_4/tests/grader.py b/tasks/0013_126_13126909_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_126_13126909_qa_4/tests/grader.py +++ b/tasks/0013_126_13126909_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_169_13169934_qa_5/tests/grader.py b/tasks/0013_169_13169934_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_169_13169934_qa_5/tests/grader.py +++ b/tasks/0013_169_13169934_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_170_13170004_qa_5/tests/grader.py b/tasks/0013_170_13170004_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_170_13170004_qa_5/tests/grader.py +++ b/tasks/0013_170_13170004_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_225_13225334_qa_2/tests/grader.py b/tasks/0013_225_13225334_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_225_13225334_qa_2/tests/grader.py +++ b/tasks/0013_225_13225334_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/0013_310_13310368_qa_1/tests/grader.py b/tasks/0013_310_13310368_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_310_13310368_qa_1/tests/grader.py +++ b/tasks/0013_310_13310368_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_355_13355821_qa_2/tests/grader.py b/tasks/0013_355_13355821_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_355_13355821_qa_2/tests/grader.py +++ b/tasks/0013_355_13355821_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/0013_408_13408860_qa_5/tests/grader.py b/tasks/0013_408_13408860_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_408_13408860_qa_5/tests/grader.py +++ b/tasks/0013_408_13408860_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_444_13444633_qa_2/tests/grader.py b/tasks/0013_444_13444633_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_444_13444633_qa_2/tests/grader.py +++ b/tasks/0013_444_13444633_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/0013_444_13444633_qa_4/tests/grader.py b/tasks/0013_444_13444633_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_444_13444633_qa_4/tests/grader.py +++ b/tasks/0013_444_13444633_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_457_13457318_qa_3/tests/grader.py b/tasks/0013_457_13457318_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_457_13457318_qa_3/tests/grader.py +++ b/tasks/0013_457_13457318_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_462_13462877_qa_1/tests/grader.py b/tasks/0013_462_13462877_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_462_13462877_qa_1/tests/grader.py +++ b/tasks/0013_462_13462877_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_523_13523088_qa_4/tests/grader.py b/tasks/0013_523_13523088_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_523_13523088_qa_4/tests/grader.py +++ b/tasks/0013_523_13523088_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_523_13523088_qa_5/tests/grader.py b/tasks/0013_523_13523088_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_523_13523088_qa_5/tests/grader.py +++ b/tasks/0013_523_13523088_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_604_13604091_qa_2/tests/grader.py b/tasks/0013_604_13604091_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_604_13604091_qa_2/tests/grader.py +++ b/tasks/0013_604_13604091_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/0013_613_13613426_qa_5/tests/grader.py b/tasks/0013_613_13613426_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_613_13613426_qa_5/tests/grader.py +++ b/tasks/0013_613_13613426_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_655_13655596_qa_1/tests/grader.py b/tasks/0013_655_13655596_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_655_13655596_qa_1/tests/grader.py +++ b/tasks/0013_655_13655596_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_708_13708498_qa_4/tests/grader.py b/tasks/0013_708_13708498_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_708_13708498_qa_4/tests/grader.py +++ b/tasks/0013_708_13708498_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_733_13733964_qa_1/tests/grader.py b/tasks/0013_733_13733964_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0013_733_13733964_qa_1/tests/grader.py +++ b/tasks/0013_733_13733964_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