diff --git a/tasks/0130_334_130334137_qa_2/tests/grader.py b/tasks/0130_334_130334137_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_334_130334137_qa_2/tests/grader.py +++ b/tasks/0130_334_130334137_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/0130_334_130334137_qa_3/tests/grader.py b/tasks/0130_334_130334137_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_334_130334137_qa_3/tests/grader.py +++ b/tasks/0130_334_130334137_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/0130_347_130347840_qa_4/tests/grader.py b/tasks/0130_347_130347840_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_347_130347840_qa_4/tests/grader.py +++ b/tasks/0130_347_130347840_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/0130_588_130588060_qa_1/tests/grader.py b/tasks/0130_588_130588060_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_588_130588060_qa_1/tests/grader.py +++ b/tasks/0130_588_130588060_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/0130_615_130615633_qa_1/tests/grader.py b/tasks/0130_615_130615633_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_615_130615633_qa_1/tests/grader.py +++ b/tasks/0130_615_130615633_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/0130_615_130615633_qa_4/tests/grader.py b/tasks/0130_615_130615633_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_615_130615633_qa_4/tests/grader.py +++ b/tasks/0130_615_130615633_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/0130_710_130710766_qa_2/tests/grader.py b/tasks/0130_710_130710766_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_710_130710766_qa_2/tests/grader.py +++ b/tasks/0130_710_130710766_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/0130_713_130713633_qa_5/tests/grader.py b/tasks/0130_713_130713633_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_713_130713633_qa_5/tests/grader.py +++ b/tasks/0130_713_130713633_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/0130_740_130740848_qa_1/tests/grader.py b/tasks/0130_740_130740848_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_740_130740848_qa_1/tests/grader.py +++ b/tasks/0130_740_130740848_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/0130_751_130751962_qa_1/tests/grader.py b/tasks/0130_751_130751962_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_751_130751962_qa_1/tests/grader.py +++ b/tasks/0130_751_130751962_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/0130_870_130870201_qa_1/tests/grader.py b/tasks/0130_870_130870201_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_870_130870201_qa_1/tests/grader.py +++ b/tasks/0130_870_130870201_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/0130_890_130890369_qa_2/tests/grader.py b/tasks/0130_890_130890369_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_890_130890369_qa_2/tests/grader.py +++ b/tasks/0130_890_130890369_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/0130_890_130890369_qa_4/tests/grader.py b/tasks/0130_890_130890369_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_890_130890369_qa_4/tests/grader.py +++ b/tasks/0130_890_130890369_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/0130_998_130998781_qa_1/tests/grader.py b/tasks/0130_998_130998781_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0130_998_130998781_qa_1/tests/grader.py +++ b/tasks/0130_998_130998781_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/0131_072_131072256_qa_1/tests/grader.py b/tasks/0131_072_131072256_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_072_131072256_qa_1/tests/grader.py +++ b/tasks/0131_072_131072256_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/0131_072_131072256_qa_3/tests/grader.py b/tasks/0131_072_131072256_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_072_131072256_qa_3/tests/grader.py +++ b/tasks/0131_072_131072256_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/0131_224_131224079_qa_3/tests/grader.py b/tasks/0131_224_131224079_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_224_131224079_qa_3/tests/grader.py +++ b/tasks/0131_224_131224079_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/0131_249_131249802_qa_5/tests/grader.py b/tasks/0131_249_131249802_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_249_131249802_qa_5/tests/grader.py +++ b/tasks/0131_249_131249802_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/0131_258_131258497_qa_4/tests/grader.py b/tasks/0131_258_131258497_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_258_131258497_qa_4/tests/grader.py +++ b/tasks/0131_258_131258497_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/0131_341_131341778_qa_5/tests/grader.py b/tasks/0131_341_131341778_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_341_131341778_qa_5/tests/grader.py +++ b/tasks/0131_341_131341778_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/0131_433_131433565_qa_1/tests/grader.py b/tasks/0131_433_131433565_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_433_131433565_qa_1/tests/grader.py +++ b/tasks/0131_433_131433565_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/0131_433_131433565_qa_4/tests/grader.py b/tasks/0131_433_131433565_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_433_131433565_qa_4/tests/grader.py +++ b/tasks/0131_433_131433565_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/0131_438_131438357_qa_4/tests/grader.py b/tasks/0131_438_131438357_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_438_131438357_qa_4/tests/grader.py +++ b/tasks/0131_438_131438357_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/0131_454_131454088_qa_4/tests/grader.py b/tasks/0131_454_131454088_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_454_131454088_qa_4/tests/grader.py +++ b/tasks/0131_454_131454088_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/0131_454_131454088_qa_5/tests/grader.py b/tasks/0131_454_131454088_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_454_131454088_qa_5/tests/grader.py +++ b/tasks/0131_454_131454088_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/0131_458_131458182_qa_5/tests/grader.py b/tasks/0131_458_131458182_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_458_131458182_qa_5/tests/grader.py +++ b/tasks/0131_458_131458182_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/0131_552_131552856_qa_4/tests/grader.py b/tasks/0131_552_131552856_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_552_131552856_qa_4/tests/grader.py +++ b/tasks/0131_552_131552856_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/0131_609_131609730_qa_1/tests/grader.py b/tasks/0131_609_131609730_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_609_131609730_qa_1/tests/grader.py +++ b/tasks/0131_609_131609730_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/0131_609_131609730_qa_3/tests/grader.py b/tasks/0131_609_131609730_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_609_131609730_qa_3/tests/grader.py +++ b/tasks/0131_609_131609730_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/0131_609_131609730_qa_5/tests/grader.py b/tasks/0131_609_131609730_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_609_131609730_qa_5/tests/grader.py +++ b/tasks/0131_609_131609730_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/0131_622_131622026_qa_3/tests/grader.py b/tasks/0131_622_131622026_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_622_131622026_qa_3/tests/grader.py +++ b/tasks/0131_622_131622026_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/0131_624_131624769_qa_1/tests/grader.py b/tasks/0131_624_131624769_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_624_131624769_qa_1/tests/grader.py +++ b/tasks/0131_624_131624769_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/0131_667_131667789_qa_4/tests/grader.py b/tasks/0131_667_131667789_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_667_131667789_qa_4/tests/grader.py +++ b/tasks/0131_667_131667789_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/0131_731_131731169_qa_5/tests/grader.py b/tasks/0131_731_131731169_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_731_131731169_qa_5/tests/grader.py +++ b/tasks/0131_731_131731169_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/0131_767_131767840_qa_1/tests/grader.py b/tasks/0131_767_131767840_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_767_131767840_qa_1/tests/grader.py +++ b/tasks/0131_767_131767840_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/0131_767_131767840_qa_5/tests/grader.py b/tasks/0131_767_131767840_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_767_131767840_qa_5/tests/grader.py +++ b/tasks/0131_767_131767840_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/0131_881_131881806_qa_2/tests/grader.py b/tasks/0131_881_131881806_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_881_131881806_qa_2/tests/grader.py +++ b/tasks/0131_881_131881806_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/0131_881_131881806_qa_4/tests/grader.py b/tasks/0131_881_131881806_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0131_881_131881806_qa_4/tests/grader.py +++ b/tasks/0131_881_131881806_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/0132_089_132089829_qa_3/tests/grader.py b/tasks/0132_089_132089829_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_089_132089829_qa_3/tests/grader.py +++ b/tasks/0132_089_132089829_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/0132_099_132099772_qa_3/tests/grader.py b/tasks/0132_099_132099772_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_099_132099772_qa_3/tests/grader.py +++ b/tasks/0132_099_132099772_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/0132_138_132138987_qa_1/tests/grader.py b/tasks/0132_138_132138987_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_138_132138987_qa_1/tests/grader.py +++ b/tasks/0132_138_132138987_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/0132_151_132151183_qa_1/tests/grader.py b/tasks/0132_151_132151183_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_151_132151183_qa_1/tests/grader.py +++ b/tasks/0132_151_132151183_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/0132_151_132151183_qa_2/tests/grader.py b/tasks/0132_151_132151183_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_151_132151183_qa_2/tests/grader.py +++ b/tasks/0132_151_132151183_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/0132_169_132169068_qa_5/tests/grader.py b/tasks/0132_169_132169068_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_169_132169068_qa_5/tests/grader.py +++ b/tasks/0132_169_132169068_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/0132_236_132236539_qa_5/tests/grader.py b/tasks/0132_236_132236539_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_236_132236539_qa_5/tests/grader.py +++ b/tasks/0132_236_132236539_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/0132_270_132270430_qa_1/tests/grader.py b/tasks/0132_270_132270430_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_270_132270430_qa_1/tests/grader.py +++ b/tasks/0132_270_132270430_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/0132_270_132270430_qa_4/tests/grader.py b/tasks/0132_270_132270430_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_270_132270430_qa_4/tests/grader.py +++ b/tasks/0132_270_132270430_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/0132_290_132290375_qa_2/tests/grader.py b/tasks/0132_290_132290375_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_290_132290375_qa_2/tests/grader.py +++ b/tasks/0132_290_132290375_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/0132_422_132422220_qa_2/tests/grader.py b/tasks/0132_422_132422220_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_422_132422220_qa_2/tests/grader.py +++ b/tasks/0132_422_132422220_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/0132_434_132434308_qa_2/tests/grader.py b/tasks/0132_434_132434308_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_434_132434308_qa_2/tests/grader.py +++ b/tasks/0132_434_132434308_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/0132_444_132444361_qa_4/tests/grader.py b/tasks/0132_444_132444361_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_444_132444361_qa_4/tests/grader.py +++ b/tasks/0132_444_132444361_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/0132_459_132459719_qa_3/tests/grader.py b/tasks/0132_459_132459719_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_459_132459719_qa_3/tests/grader.py +++ b/tasks/0132_459_132459719_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/0132_471_132471120_qa_4/tests/grader.py b/tasks/0132_471_132471120_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_471_132471120_qa_4/tests/grader.py +++ b/tasks/0132_471_132471120_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/0132_538_132538004_qa_1/tests/grader.py b/tasks/0132_538_132538004_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_538_132538004_qa_1/tests/grader.py +++ b/tasks/0132_538_132538004_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/0132_538_132538004_qa_5/tests/grader.py b/tasks/0132_538_132538004_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_538_132538004_qa_5/tests/grader.py +++ b/tasks/0132_538_132538004_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/0132_564_132564402_qa_5/tests/grader.py b/tasks/0132_564_132564402_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_564_132564402_qa_5/tests/grader.py +++ b/tasks/0132_564_132564402_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/0132_566_132566728_qa_4/tests/grader.py b/tasks/0132_566_132566728_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_566_132566728_qa_4/tests/grader.py +++ b/tasks/0132_566_132566728_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/0132_576_132576525_qa_4/tests/grader.py b/tasks/0132_576_132576525_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_576_132576525_qa_4/tests/grader.py +++ b/tasks/0132_576_132576525_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/0132_596_132596500_qa_5/tests/grader.py b/tasks/0132_596_132596500_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_596_132596500_qa_5/tests/grader.py +++ b/tasks/0132_596_132596500_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/0132_623_132623331_qa_1/tests/grader.py b/tasks/0132_623_132623331_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_623_132623331_qa_1/tests/grader.py +++ b/tasks/0132_623_132623331_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/0132_624_132624870_qa_4/tests/grader.py b/tasks/0132_624_132624870_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_624_132624870_qa_4/tests/grader.py +++ b/tasks/0132_624_132624870_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/0132_624_132624870_qa_5/tests/grader.py b/tasks/0132_624_132624870_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_624_132624870_qa_5/tests/grader.py +++ b/tasks/0132_624_132624870_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/0132_642_132642166_qa_1/tests/grader.py b/tasks/0132_642_132642166_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_642_132642166_qa_1/tests/grader.py +++ b/tasks/0132_642_132642166_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/0132_642_132642166_qa_2/tests/grader.py b/tasks/0132_642_132642166_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_642_132642166_qa_2/tests/grader.py +++ b/tasks/0132_642_132642166_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/0132_642_132642166_qa_3/tests/grader.py b/tasks/0132_642_132642166_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_642_132642166_qa_3/tests/grader.py +++ b/tasks/0132_642_132642166_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/0132_665_132665003_qa_1/tests/grader.py b/tasks/0132_665_132665003_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_665_132665003_qa_1/tests/grader.py +++ b/tasks/0132_665_132665003_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/0132_672_132672509_qa_1/tests/grader.py b/tasks/0132_672_132672509_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_672_132672509_qa_1/tests/grader.py +++ b/tasks/0132_672_132672509_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/0132_672_132672509_qa_3/tests/grader.py b/tasks/0132_672_132672509_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_672_132672509_qa_3/tests/grader.py +++ b/tasks/0132_672_132672509_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/0132_865_132865792_qa_1/tests/grader.py b/tasks/0132_865_132865792_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_865_132865792_qa_1/tests/grader.py +++ b/tasks/0132_865_132865792_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/0132_865_132865792_qa_4/tests/grader.py b/tasks/0132_865_132865792_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_865_132865792_qa_4/tests/grader.py +++ b/tasks/0132_865_132865792_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/0132_903_132903502_qa_3/tests/grader.py b/tasks/0132_903_132903502_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_903_132903502_qa_3/tests/grader.py +++ b/tasks/0132_903_132903502_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/0132_903_132903502_qa_5/tests/grader.py b/tasks/0132_903_132903502_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_903_132903502_qa_5/tests/grader.py +++ b/tasks/0132_903_132903502_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/0132_967_132967098_qa_4/tests/grader.py b/tasks/0132_967_132967098_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_967_132967098_qa_4/tests/grader.py +++ b/tasks/0132_967_132967098_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/0132_967_132967098_qa_5/tests/grader.py b/tasks/0132_967_132967098_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_967_132967098_qa_5/tests/grader.py +++ b/tasks/0132_967_132967098_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/0132_989_132989870_qa_5/tests/grader.py b/tasks/0132_989_132989870_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0132_989_132989870_qa_5/tests/grader.py +++ b/tasks/0132_989_132989870_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/0133_024_133024285_qa_4/tests/grader.py b/tasks/0133_024_133024285_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_024_133024285_qa_4/tests/grader.py +++ b/tasks/0133_024_133024285_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/0133_040_133040358_qa_3/tests/grader.py b/tasks/0133_040_133040358_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_040_133040358_qa_3/tests/grader.py +++ b/tasks/0133_040_133040358_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/0133_047_133047390_qa_2/tests/grader.py b/tasks/0133_047_133047390_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_047_133047390_qa_2/tests/grader.py +++ b/tasks/0133_047_133047390_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/0133_078_133078833_qa_1/tests/grader.py b/tasks/0133_078_133078833_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_078_133078833_qa_1/tests/grader.py +++ b/tasks/0133_078_133078833_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/0133_079_133079906_qa_3/tests/grader.py b/tasks/0133_079_133079906_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_079_133079906_qa_3/tests/grader.py +++ b/tasks/0133_079_133079906_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/0133_079_133079906_qa_4/tests/grader.py b/tasks/0133_079_133079906_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_079_133079906_qa_4/tests/grader.py +++ b/tasks/0133_079_133079906_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/0133_089_133089049_qa_3/tests/grader.py b/tasks/0133_089_133089049_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_089_133089049_qa_3/tests/grader.py +++ b/tasks/0133_089_133089049_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/0133_196_133196028_qa_4/tests/grader.py b/tasks/0133_196_133196028_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_196_133196028_qa_4/tests/grader.py +++ b/tasks/0133_196_133196028_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/0133_423_133423579_qa_4/tests/grader.py b/tasks/0133_423_133423579_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_423_133423579_qa_4/tests/grader.py +++ b/tasks/0133_423_133423579_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/0133_522_133522334_qa_5/tests/grader.py b/tasks/0133_522_133522334_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_522_133522334_qa_5/tests/grader.py +++ b/tasks/0133_522_133522334_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/0133_533_133533460_qa_2/tests/grader.py b/tasks/0133_533_133533460_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_533_133533460_qa_2/tests/grader.py +++ b/tasks/0133_533_133533460_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/0133_533_133533460_qa_5/tests/grader.py b/tasks/0133_533_133533460_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_533_133533460_qa_5/tests/grader.py +++ b/tasks/0133_533_133533460_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/0133_561_133561697_qa_2/tests/grader.py b/tasks/0133_561_133561697_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_561_133561697_qa_2/tests/grader.py +++ b/tasks/0133_561_133561697_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/0133_586_133586216_qa_3/tests/grader.py b/tasks/0133_586_133586216_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_586_133586216_qa_3/tests/grader.py +++ b/tasks/0133_586_133586216_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/0133_586_133586216_qa_4/tests/grader.py b/tasks/0133_586_133586216_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_586_133586216_qa_4/tests/grader.py +++ b/tasks/0133_586_133586216_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/0133_586_133586216_qa_5/tests/grader.py b/tasks/0133_586_133586216_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_586_133586216_qa_5/tests/grader.py +++ b/tasks/0133_586_133586216_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/0133_597_133597962_qa_4/tests/grader.py b/tasks/0133_597_133597962_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_597_133597962_qa_4/tests/grader.py +++ b/tasks/0133_597_133597962_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/0133_615_133615287_qa_1/tests/grader.py b/tasks/0133_615_133615287_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_615_133615287_qa_1/tests/grader.py +++ b/tasks/0133_615_133615287_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/0133_615_133615287_qa_4/tests/grader.py b/tasks/0133_615_133615287_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_615_133615287_qa_4/tests/grader.py +++ b/tasks/0133_615_133615287_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/0133_625_133625301_qa_2/tests/grader.py b/tasks/0133_625_133625301_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_625_133625301_qa_2/tests/grader.py +++ b/tasks/0133_625_133625301_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/0133_688_133688260_qa_1/tests/grader.py b/tasks/0133_688_133688260_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_688_133688260_qa_1/tests/grader.py +++ b/tasks/0133_688_133688260_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/0133_688_133688260_qa_4/tests/grader.py b/tasks/0133_688_133688260_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_688_133688260_qa_4/tests/grader.py +++ b/tasks/0133_688_133688260_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/0133_909_133909373_qa_3/tests/grader.py b/tasks/0133_909_133909373_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_909_133909373_qa_3/tests/grader.py +++ b/tasks/0133_909_133909373_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/0133_918_133918365_qa_5/tests/grader.py b/tasks/0133_918_133918365_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_918_133918365_qa_5/tests/grader.py +++ b/tasks/0133_918_133918365_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/0133_985_133985861_qa_1/tests/grader.py b/tasks/0133_985_133985861_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_985_133985861_qa_1/tests/grader.py +++ b/tasks/0133_985_133985861_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/0133_988_133988312_qa_2/tests/grader.py b/tasks/0133_988_133988312_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_988_133988312_qa_2/tests/grader.py +++ b/tasks/0133_988_133988312_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/0133_988_133988312_qa_4/tests/grader.py b/tasks/0133_988_133988312_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0133_988_133988312_qa_4/tests/grader.py +++ b/tasks/0133_988_133988312_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/0134_109_134109927_qa_3/tests/grader.py b/tasks/0134_109_134109927_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0134_109_134109927_qa_3/tests/grader.py +++ b/tasks/0134_109_134109927_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/0134_377_134377308_qa_3/tests/grader.py b/tasks/0134_377_134377308_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0134_377_134377308_qa_3/tests/grader.py +++ b/tasks/0134_377_134377308_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/0134_445_134445739_qa_2/tests/grader.py b/tasks/0134_445_134445739_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0134_445_134445739_qa_2/tests/grader.py +++ b/tasks/0134_445_134445739_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/0134_484_134484147_qa_1/tests/grader.py b/tasks/0134_484_134484147_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0134_484_134484147_qa_1/tests/grader.py +++ b/tasks/0134_484_134484147_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/0134_657_134657302_qa_1/tests/grader.py b/tasks/0134_657_134657302_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0134_657_134657302_qa_1/tests/grader.py +++ b/tasks/0134_657_134657302_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/0134_683_134683130_qa_5/tests/grader.py b/tasks/0134_683_134683130_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0134_683_134683130_qa_5/tests/grader.py +++ b/tasks/0134_683_134683130_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/0134_878_134878027_qa_1/tests/grader.py b/tasks/0134_878_134878027_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0134_878_134878027_qa_1/tests/grader.py +++ b/tasks/0134_878_134878027_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/0134_878_134878027_qa_3/tests/grader.py b/tasks/0134_878_134878027_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0134_878_134878027_qa_3/tests/grader.py +++ b/tasks/0134_878_134878027_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/0134_941_134941943_qa_1/tests/grader.py b/tasks/0134_941_134941943_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0134_941_134941943_qa_1/tests/grader.py +++ b/tasks/0134_941_134941943_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/0135_043_135043306_qa_2/tests/grader.py b/tasks/0135_043_135043306_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_043_135043306_qa_2/tests/grader.py +++ b/tasks/0135_043_135043306_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/0135_064_135064960_qa_5/tests/grader.py b/tasks/0135_064_135064960_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_064_135064960_qa_5/tests/grader.py +++ b/tasks/0135_064_135064960_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/0135_081_135081430_qa_5/tests/grader.py b/tasks/0135_081_135081430_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_081_135081430_qa_5/tests/grader.py +++ b/tasks/0135_081_135081430_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/0135_081_135081694_qa_2/tests/grader.py b/tasks/0135_081_135081694_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_081_135081694_qa_2/tests/grader.py +++ b/tasks/0135_081_135081694_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/0135_081_135081694_qa_4/tests/grader.py b/tasks/0135_081_135081694_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_081_135081694_qa_4/tests/grader.py +++ b/tasks/0135_081_135081694_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/0135_081_135081694_qa_5/tests/grader.py b/tasks/0135_081_135081694_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_081_135081694_qa_5/tests/grader.py +++ b/tasks/0135_081_135081694_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/0135_081_135081983_qa_3/tests/grader.py b/tasks/0135_081_135081983_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_081_135081983_qa_3/tests/grader.py +++ b/tasks/0135_081_135081983_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/0135_170_135170219_qa_1/tests/grader.py b/tasks/0135_170_135170219_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_170_135170219_qa_1/tests/grader.py +++ b/tasks/0135_170_135170219_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/0135_170_135170219_qa_4/tests/grader.py b/tasks/0135_170_135170219_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_170_135170219_qa_4/tests/grader.py +++ b/tasks/0135_170_135170219_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/0135_174_135174197_qa_4/tests/grader.py b/tasks/0135_174_135174197_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_174_135174197_qa_4/tests/grader.py +++ b/tasks/0135_174_135174197_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/0135_324_135324126_qa_2/tests/grader.py b/tasks/0135_324_135324126_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_324_135324126_qa_2/tests/grader.py +++ b/tasks/0135_324_135324126_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/0135_324_135324126_qa_3/tests/grader.py b/tasks/0135_324_135324126_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_324_135324126_qa_3/tests/grader.py +++ b/tasks/0135_324_135324126_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/0135_324_135324126_qa_5/tests/grader.py b/tasks/0135_324_135324126_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_324_135324126_qa_5/tests/grader.py +++ b/tasks/0135_324_135324126_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/0135_355_135355749_qa_3/tests/grader.py b/tasks/0135_355_135355749_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_355_135355749_qa_3/tests/grader.py +++ b/tasks/0135_355_135355749_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/0135_364_135364354_qa_3/tests/grader.py b/tasks/0135_364_135364354_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_364_135364354_qa_3/tests/grader.py +++ b/tasks/0135_364_135364354_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/0135_364_135364354_qa_5/tests/grader.py b/tasks/0135_364_135364354_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_364_135364354_qa_5/tests/grader.py +++ b/tasks/0135_364_135364354_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/0135_380_135380627_qa_1/tests/grader.py b/tasks/0135_380_135380627_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_380_135380627_qa_1/tests/grader.py +++ b/tasks/0135_380_135380627_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/0135_380_135380654_qa_2/tests/grader.py b/tasks/0135_380_135380654_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_380_135380654_qa_2/tests/grader.py +++ b/tasks/0135_380_135380654_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/0135_380_135380654_qa_4/tests/grader.py b/tasks/0135_380_135380654_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_380_135380654_qa_4/tests/grader.py +++ b/tasks/0135_380_135380654_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/0135_427_135427128_qa_2/tests/grader.py b/tasks/0135_427_135427128_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_427_135427128_qa_2/tests/grader.py +++ b/tasks/0135_427_135427128_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/0135_485_135485471_qa_4/tests/grader.py b/tasks/0135_485_135485471_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_485_135485471_qa_4/tests/grader.py +++ b/tasks/0135_485_135485471_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/0135_538_135538507_qa_5/tests/grader.py b/tasks/0135_538_135538507_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_538_135538507_qa_5/tests/grader.py +++ b/tasks/0135_538_135538507_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/0135_541_135541718_qa_1/tests/grader.py b/tasks/0135_541_135541718_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_541_135541718_qa_1/tests/grader.py +++ b/tasks/0135_541_135541718_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/0135_616_135616199_qa_1/tests/grader.py b/tasks/0135_616_135616199_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_616_135616199_qa_1/tests/grader.py +++ b/tasks/0135_616_135616199_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/0135_616_135616199_qa_4/tests/grader.py b/tasks/0135_616_135616199_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_616_135616199_qa_4/tests/grader.py +++ b/tasks/0135_616_135616199_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/0135_616_135616199_qa_5/tests/grader.py b/tasks/0135_616_135616199_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_616_135616199_qa_5/tests/grader.py +++ b/tasks/0135_616_135616199_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/0135_674_135674700_qa_2/tests/grader.py b/tasks/0135_674_135674700_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_674_135674700_qa_2/tests/grader.py +++ b/tasks/0135_674_135674700_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/0135_674_135674700_qa_5/tests/grader.py b/tasks/0135_674_135674700_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_674_135674700_qa_5/tests/grader.py +++ b/tasks/0135_674_135674700_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/0135_716_135716121_qa_3/tests/grader.py b/tasks/0135_716_135716121_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_716_135716121_qa_3/tests/grader.py +++ b/tasks/0135_716_135716121_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/0135_720_135720396_qa_1/tests/grader.py b/tasks/0135_720_135720396_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_720_135720396_qa_1/tests/grader.py +++ b/tasks/0135_720_135720396_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/0135_720_135720396_qa_5/tests/grader.py b/tasks/0135_720_135720396_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_720_135720396_qa_5/tests/grader.py +++ b/tasks/0135_720_135720396_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/0135_734_135734200_qa_1/tests/grader.py b/tasks/0135_734_135734200_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_734_135734200_qa_1/tests/grader.py +++ b/tasks/0135_734_135734200_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/0135_735_135735954_qa_4/tests/grader.py b/tasks/0135_735_135735954_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_735_135735954_qa_4/tests/grader.py +++ b/tasks/0135_735_135735954_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/0135_740_135740732_qa_2/tests/grader.py b/tasks/0135_740_135740732_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_740_135740732_qa_2/tests/grader.py +++ b/tasks/0135_740_135740732_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/0135_740_135740732_qa_3/tests/grader.py b/tasks/0135_740_135740732_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_740_135740732_qa_3/tests/grader.py +++ b/tasks/0135_740_135740732_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/0135_920_135920645_qa_4/tests/grader.py b/tasks/0135_920_135920645_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_920_135920645_qa_4/tests/grader.py +++ b/tasks/0135_920_135920645_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/0135_920_135920645_qa_5/tests/grader.py b/tasks/0135_920_135920645_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_920_135920645_qa_5/tests/grader.py +++ b/tasks/0135_920_135920645_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/0135_926_135926873_qa_2/tests/grader.py b/tasks/0135_926_135926873_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_926_135926873_qa_2/tests/grader.py +++ b/tasks/0135_926_135926873_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/0135_926_135926873_qa_3/tests/grader.py b/tasks/0135_926_135926873_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_926_135926873_qa_3/tests/grader.py +++ b/tasks/0135_926_135926873_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/0135_926_135926873_qa_4/tests/grader.py b/tasks/0135_926_135926873_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_926_135926873_qa_4/tests/grader.py +++ b/tasks/0135_926_135926873_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/0135_931_135931499_qa_2/tests/grader.py b/tasks/0135_931_135931499_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_931_135931499_qa_2/tests/grader.py +++ b/tasks/0135_931_135931499_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/0135_931_135931499_qa_4/tests/grader.py b/tasks/0135_931_135931499_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_931_135931499_qa_4/tests/grader.py +++ b/tasks/0135_931_135931499_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/0135_968_135968027_qa_1/tests/grader.py b/tasks/0135_968_135968027_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_968_135968027_qa_1/tests/grader.py +++ b/tasks/0135_968_135968027_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/0135_968_135968027_qa_3/tests/grader.py b/tasks/0135_968_135968027_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0135_968_135968027_qa_3/tests/grader.py +++ b/tasks/0135_968_135968027_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/0136_044_136044627_qa_3/tests/grader.py b/tasks/0136_044_136044627_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_044_136044627_qa_3/tests/grader.py +++ b/tasks/0136_044_136044627_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/0136_044_136044627_qa_5/tests/grader.py b/tasks/0136_044_136044627_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_044_136044627_qa_5/tests/grader.py +++ b/tasks/0136_044_136044627_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/0136_053_136053251_qa_2/tests/grader.py b/tasks/0136_053_136053251_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_053_136053251_qa_2/tests/grader.py +++ b/tasks/0136_053_136053251_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/0136_053_136053251_qa_4/tests/grader.py b/tasks/0136_053_136053251_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_053_136053251_qa_4/tests/grader.py +++ b/tasks/0136_053_136053251_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/0136_157_136157860_qa_5/tests/grader.py b/tasks/0136_157_136157860_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_157_136157860_qa_5/tests/grader.py +++ b/tasks/0136_157_136157860_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/0136_175_136175034_qa_5/tests/grader.py b/tasks/0136_175_136175034_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_175_136175034_qa_5/tests/grader.py +++ b/tasks/0136_175_136175034_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/0136_198_136198797_qa_1/tests/grader.py b/tasks/0136_198_136198797_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_198_136198797_qa_1/tests/grader.py +++ b/tasks/0136_198_136198797_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/0136_198_136198797_qa_2/tests/grader.py b/tasks/0136_198_136198797_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_198_136198797_qa_2/tests/grader.py +++ b/tasks/0136_198_136198797_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/0136_198_136198797_qa_3/tests/grader.py b/tasks/0136_198_136198797_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_198_136198797_qa_3/tests/grader.py +++ b/tasks/0136_198_136198797_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/0136_199_136199196_qa_3/tests/grader.py b/tasks/0136_199_136199196_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_199_136199196_qa_3/tests/grader.py +++ b/tasks/0136_199_136199196_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/0136_242_136242885_qa_2/tests/grader.py b/tasks/0136_242_136242885_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_242_136242885_qa_2/tests/grader.py +++ b/tasks/0136_242_136242885_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/0136_395_136395303_qa_1/tests/grader.py b/tasks/0136_395_136395303_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_395_136395303_qa_1/tests/grader.py +++ b/tasks/0136_395_136395303_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/0136_396_136396252_qa_2/tests/grader.py b/tasks/0136_396_136396252_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_396_136396252_qa_2/tests/grader.py +++ b/tasks/0136_396_136396252_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/0136_483_136483047_qa_4/tests/grader.py b/tasks/0136_483_136483047_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_483_136483047_qa_4/tests/grader.py +++ b/tasks/0136_483_136483047_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/0136_604_136604936_qa_4/tests/grader.py b/tasks/0136_604_136604936_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_604_136604936_qa_4/tests/grader.py +++ b/tasks/0136_604_136604936_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/0136_646_136646417_qa_2/tests/grader.py b/tasks/0136_646_136646417_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_646_136646417_qa_2/tests/grader.py +++ b/tasks/0136_646_136646417_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/0136_646_136646417_qa_4/tests/grader.py b/tasks/0136_646_136646417_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_646_136646417_qa_4/tests/grader.py +++ b/tasks/0136_646_136646417_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/0136_656_136656176_qa_2/tests/grader.py b/tasks/0136_656_136656176_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_656_136656176_qa_2/tests/grader.py +++ b/tasks/0136_656_136656176_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/0136_677_136677870_qa_1/tests/grader.py b/tasks/0136_677_136677870_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_677_136677870_qa_1/tests/grader.py +++ b/tasks/0136_677_136677870_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/0136_683_136683073_qa_2/tests/grader.py b/tasks/0136_683_136683073_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_683_136683073_qa_2/tests/grader.py +++ b/tasks/0136_683_136683073_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/0136_683_136683073_qa_3/tests/grader.py b/tasks/0136_683_136683073_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_683_136683073_qa_3/tests/grader.py +++ b/tasks/0136_683_136683073_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/0136_770_136770905_qa_3/tests/grader.py b/tasks/0136_770_136770905_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_770_136770905_qa_3/tests/grader.py +++ b/tasks/0136_770_136770905_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/0136_825_136825945_qa_1/tests/grader.py b/tasks/0136_825_136825945_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_825_136825945_qa_1/tests/grader.py +++ b/tasks/0136_825_136825945_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/0136_825_136825945_qa_5/tests/grader.py b/tasks/0136_825_136825945_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_825_136825945_qa_5/tests/grader.py +++ b/tasks/0136_825_136825945_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/0136_845_136845893_qa_1/tests/grader.py b/tasks/0136_845_136845893_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_845_136845893_qa_1/tests/grader.py +++ b/tasks/0136_845_136845893_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/0136_845_136845893_qa_4/tests/grader.py b/tasks/0136_845_136845893_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_845_136845893_qa_4/tests/grader.py +++ b/tasks/0136_845_136845893_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/0136_874_136874999_qa_1/tests/grader.py b/tasks/0136_874_136874999_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_874_136874999_qa_1/tests/grader.py +++ b/tasks/0136_874_136874999_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/0136_874_136874999_qa_3/tests/grader.py b/tasks/0136_874_136874999_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_874_136874999_qa_3/tests/grader.py +++ b/tasks/0136_874_136874999_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/0136_961_136961156_qa_5/tests/grader.py b/tasks/0136_961_136961156_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0136_961_136961156_qa_5/tests/grader.py +++ b/tasks/0136_961_136961156_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/0137_028_137028436_qa_3/tests/grader.py b/tasks/0137_028_137028436_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_028_137028436_qa_3/tests/grader.py +++ b/tasks/0137_028_137028436_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/0137_061_137061428_qa_2/tests/grader.py b/tasks/0137_061_137061428_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_061_137061428_qa_2/tests/grader.py +++ b/tasks/0137_061_137061428_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/0137_091_137091910_qa_3/tests/grader.py b/tasks/0137_091_137091910_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_091_137091910_qa_3/tests/grader.py +++ b/tasks/0137_091_137091910_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/0137_091_137091910_qa_4/tests/grader.py b/tasks/0137_091_137091910_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_091_137091910_qa_4/tests/grader.py +++ b/tasks/0137_091_137091910_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/0137_213_137213710_qa_1/tests/grader.py b/tasks/0137_213_137213710_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_213_137213710_qa_1/tests/grader.py +++ b/tasks/0137_213_137213710_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/0137_314_137314470_qa_3/tests/grader.py b/tasks/0137_314_137314470_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_314_137314470_qa_3/tests/grader.py +++ b/tasks/0137_314_137314470_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/0137_338_137338171_qa_1/tests/grader.py b/tasks/0137_338_137338171_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_338_137338171_qa_1/tests/grader.py +++ b/tasks/0137_338_137338171_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/0137_398_137398822_qa_1/tests/grader.py b/tasks/0137_398_137398822_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_398_137398822_qa_1/tests/grader.py +++ b/tasks/0137_398_137398822_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/0137_398_137398822_qa_3/tests/grader.py b/tasks/0137_398_137398822_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_398_137398822_qa_3/tests/grader.py +++ b/tasks/0137_398_137398822_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/0137_398_137398822_qa_4/tests/grader.py b/tasks/0137_398_137398822_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_398_137398822_qa_4/tests/grader.py +++ b/tasks/0137_398_137398822_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/0137_519_137519596_qa_5/tests/grader.py b/tasks/0137_519_137519596_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_519_137519596_qa_5/tests/grader.py +++ b/tasks/0137_519_137519596_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/0137_571_137571277_qa_3/tests/grader.py b/tasks/0137_571_137571277_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_571_137571277_qa_3/tests/grader.py +++ b/tasks/0137_571_137571277_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/0137_586_137586595_qa_2/tests/grader.py b/tasks/0137_586_137586595_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_586_137586595_qa_2/tests/grader.py +++ b/tasks/0137_586_137586595_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/0137_619_137619562_qa_3/tests/grader.py b/tasks/0137_619_137619562_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_619_137619562_qa_3/tests/grader.py +++ b/tasks/0137_619_137619562_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/0137_660_137660235_qa_2/tests/grader.py b/tasks/0137_660_137660235_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_660_137660235_qa_2/tests/grader.py +++ b/tasks/0137_660_137660235_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/0137_745_137745793_qa_4/tests/grader.py b/tasks/0137_745_137745793_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_745_137745793_qa_4/tests/grader.py +++ b/tasks/0137_745_137745793_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/0137_754_137754074_qa_3/tests/grader.py b/tasks/0137_754_137754074_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_754_137754074_qa_3/tests/grader.py +++ b/tasks/0137_754_137754074_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/0137_769_137769141_qa_3/tests/grader.py b/tasks/0137_769_137769141_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_769_137769141_qa_3/tests/grader.py +++ b/tasks/0137_769_137769141_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/0137_769_137769141_qa_4/tests/grader.py b/tasks/0137_769_137769141_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_769_137769141_qa_4/tests/grader.py +++ b/tasks/0137_769_137769141_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/0137_769_137769141_qa_5/tests/grader.py b/tasks/0137_769_137769141_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_769_137769141_qa_5/tests/grader.py +++ b/tasks/0137_769_137769141_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/0137_818_137818878_qa_4/tests/grader.py b/tasks/0137_818_137818878_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_818_137818878_qa_4/tests/grader.py +++ b/tasks/0137_818_137818878_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/0137_970_137970410_qa_4/tests/grader.py b/tasks/0137_970_137970410_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0137_970_137970410_qa_4/tests/grader.py +++ b/tasks/0137_970_137970410_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/0138_103_138103420_qa_2/tests/grader.py b/tasks/0138_103_138103420_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_103_138103420_qa_2/tests/grader.py +++ b/tasks/0138_103_138103420_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/0138_103_138103420_qa_4/tests/grader.py b/tasks/0138_103_138103420_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_103_138103420_qa_4/tests/grader.py +++ b/tasks/0138_103_138103420_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/0138_107_138107886_qa_1/tests/grader.py b/tasks/0138_107_138107886_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_107_138107886_qa_1/tests/grader.py +++ b/tasks/0138_107_138107886_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/0138_107_138107886_qa_3/tests/grader.py b/tasks/0138_107_138107886_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_107_138107886_qa_3/tests/grader.py +++ b/tasks/0138_107_138107886_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/0138_141_138141265_qa_5/tests/grader.py b/tasks/0138_141_138141265_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_141_138141265_qa_5/tests/grader.py +++ b/tasks/0138_141_138141265_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/0138_147_138147004_qa_2/tests/grader.py b/tasks/0138_147_138147004_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_147_138147004_qa_2/tests/grader.py +++ b/tasks/0138_147_138147004_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/0138_147_138147004_qa_4/tests/grader.py b/tasks/0138_147_138147004_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_147_138147004_qa_4/tests/grader.py +++ b/tasks/0138_147_138147004_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/0138_302_138302934_qa_3/tests/grader.py b/tasks/0138_302_138302934_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_302_138302934_qa_3/tests/grader.py +++ b/tasks/0138_302_138302934_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/0138_344_138344760_qa_5/tests/grader.py b/tasks/0138_344_138344760_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_344_138344760_qa_5/tests/grader.py +++ b/tasks/0138_344_138344760_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/0138_435_138435541_qa_5/tests/grader.py b/tasks/0138_435_138435541_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_435_138435541_qa_5/tests/grader.py +++ b/tasks/0138_435_138435541_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/0138_488_138488828_qa_2/tests/grader.py b/tasks/0138_488_138488828_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_488_138488828_qa_2/tests/grader.py +++ b/tasks/0138_488_138488828_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/0138_488_138488828_qa_4/tests/grader.py b/tasks/0138_488_138488828_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_488_138488828_qa_4/tests/grader.py +++ b/tasks/0138_488_138488828_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/0138_488_138488828_qa_5/tests/grader.py b/tasks/0138_488_138488828_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_488_138488828_qa_5/tests/grader.py +++ b/tasks/0138_488_138488828_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/0138_490_138490152_qa_3/tests/grader.py b/tasks/0138_490_138490152_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_490_138490152_qa_3/tests/grader.py +++ b/tasks/0138_490_138490152_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/0138_500_138500399_qa_5/tests/grader.py b/tasks/0138_500_138500399_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_500_138500399_qa_5/tests/grader.py +++ b/tasks/0138_500_138500399_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/0138_500_138500445_qa_4/tests/grader.py b/tasks/0138_500_138500445_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_500_138500445_qa_4/tests/grader.py +++ b/tasks/0138_500_138500445_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/0138_573_138573264_qa_3/tests/grader.py b/tasks/0138_573_138573264_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_573_138573264_qa_3/tests/grader.py +++ b/tasks/0138_573_138573264_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/0138_684_138684554_qa_1/tests/grader.py b/tasks/0138_684_138684554_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_684_138684554_qa_1/tests/grader.py +++ b/tasks/0138_684_138684554_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/0138_684_138684554_qa_2/tests/grader.py b/tasks/0138_684_138684554_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_684_138684554_qa_2/tests/grader.py +++ b/tasks/0138_684_138684554_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/0138_697_138697027_qa_1/tests/grader.py b/tasks/0138_697_138697027_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_697_138697027_qa_1/tests/grader.py +++ b/tasks/0138_697_138697027_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/0138_755_138755530_qa_1/tests/grader.py b/tasks/0138_755_138755530_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_755_138755530_qa_1/tests/grader.py +++ b/tasks/0138_755_138755530_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/0138_755_138755530_qa_2/tests/grader.py b/tasks/0138_755_138755530_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_755_138755530_qa_2/tests/grader.py +++ b/tasks/0138_755_138755530_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/0138_777_138777709_qa_1/tests/grader.py b/tasks/0138_777_138777709_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_777_138777709_qa_1/tests/grader.py +++ b/tasks/0138_777_138777709_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/0138_787_138787148_qa_2/tests/grader.py b/tasks/0138_787_138787148_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_787_138787148_qa_2/tests/grader.py +++ b/tasks/0138_787_138787148_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/0138_791_138791955_qa_4/tests/grader.py b/tasks/0138_791_138791955_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_791_138791955_qa_4/tests/grader.py +++ b/tasks/0138_791_138791955_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/0138_791_138791955_qa_5/tests/grader.py b/tasks/0138_791_138791955_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_791_138791955_qa_5/tests/grader.py +++ b/tasks/0138_791_138791955_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/0138_805_138805260_qa_1/tests/grader.py b/tasks/0138_805_138805260_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_805_138805260_qa_1/tests/grader.py +++ b/tasks/0138_805_138805260_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/0138_805_138805260_qa_2/tests/grader.py b/tasks/0138_805_138805260_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_805_138805260_qa_2/tests/grader.py +++ b/tasks/0138_805_138805260_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/0138_930_138930992_qa_1/tests/grader.py b/tasks/0138_930_138930992_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_930_138930992_qa_1/tests/grader.py +++ b/tasks/0138_930_138930992_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/0138_984_138984324_qa_4/tests/grader.py b/tasks/0138_984_138984324_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0138_984_138984324_qa_4/tests/grader.py +++ b/tasks/0138_984_138984324_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/0139_066_139066922_qa_2/tests/grader.py b/tasks/0139_066_139066922_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_066_139066922_qa_2/tests/grader.py +++ b/tasks/0139_066_139066922_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/0139_066_139066922_qa_3/tests/grader.py b/tasks/0139_066_139066922_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_066_139066922_qa_3/tests/grader.py +++ b/tasks/0139_066_139066922_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/0139_071_139071391_qa_3/tests/grader.py b/tasks/0139_071_139071391_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_071_139071391_qa_3/tests/grader.py +++ b/tasks/0139_071_139071391_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/0139_071_139071391_qa_4/tests/grader.py b/tasks/0139_071_139071391_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_071_139071391_qa_4/tests/grader.py +++ b/tasks/0139_071_139071391_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/0139_103_139103748_qa_4/tests/grader.py b/tasks/0139_103_139103748_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_103_139103748_qa_4/tests/grader.py +++ b/tasks/0139_103_139103748_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/0139_112_139112787_qa_2/tests/grader.py b/tasks/0139_112_139112787_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_112_139112787_qa_2/tests/grader.py +++ b/tasks/0139_112_139112787_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/0139_117_139117477_qa_2/tests/grader.py b/tasks/0139_117_139117477_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_117_139117477_qa_2/tests/grader.py +++ b/tasks/0139_117_139117477_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/0139_117_139117477_qa_5/tests/grader.py b/tasks/0139_117_139117477_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_117_139117477_qa_5/tests/grader.py +++ b/tasks/0139_117_139117477_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/0139_173_139173112_qa_5/tests/grader.py b/tasks/0139_173_139173112_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_173_139173112_qa_5/tests/grader.py +++ b/tasks/0139_173_139173112_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/0139_181_139181470_qa_3/tests/grader.py b/tasks/0139_181_139181470_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_181_139181470_qa_3/tests/grader.py +++ b/tasks/0139_181_139181470_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/0139_186_139186690_qa_1/tests/grader.py b/tasks/0139_186_139186690_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_186_139186690_qa_1/tests/grader.py +++ b/tasks/0139_186_139186690_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/0139_186_139186690_qa_5/tests/grader.py b/tasks/0139_186_139186690_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_186_139186690_qa_5/tests/grader.py +++ b/tasks/0139_186_139186690_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/0139_196_139196764_qa_4/tests/grader.py b/tasks/0139_196_139196764_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_196_139196764_qa_4/tests/grader.py +++ b/tasks/0139_196_139196764_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/0139_223_139223525_qa_1/tests/grader.py b/tasks/0139_223_139223525_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0139_223_139223525_qa_1/tests/grader.py +++ b/tasks/0139_223_139223525_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