diff --git a/tasks/0033_198_33198049_qa_4/tests/grader.py b/tasks/0033_198_33198049_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_198_33198049_qa_4/tests/grader.py +++ b/tasks/0033_198_33198049_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/0033_273_33273125_qa_1/tests/grader.py b/tasks/0033_273_33273125_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_273_33273125_qa_1/tests/grader.py +++ b/tasks/0033_273_33273125_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/0033_273_33273125_qa_3/tests/grader.py b/tasks/0033_273_33273125_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_273_33273125_qa_3/tests/grader.py +++ b/tasks/0033_273_33273125_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/0033_273_33273125_qa_5/tests/grader.py b/tasks/0033_273_33273125_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_273_33273125_qa_5/tests/grader.py +++ b/tasks/0033_273_33273125_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/0033_290_33290847_qa_1/tests/grader.py b/tasks/0033_290_33290847_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_290_33290847_qa_1/tests/grader.py +++ b/tasks/0033_290_33290847_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/0033_303_33303111_qa_3/tests/grader.py b/tasks/0033_303_33303111_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_303_33303111_qa_3/tests/grader.py +++ b/tasks/0033_303_33303111_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/0033_308_33308132_qa_3/tests/grader.py b/tasks/0033_308_33308132_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_308_33308132_qa_3/tests/grader.py +++ b/tasks/0033_308_33308132_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/0033_326_33326125_qa_3/tests/grader.py b/tasks/0033_326_33326125_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_326_33326125_qa_3/tests/grader.py +++ b/tasks/0033_326_33326125_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/0033_326_33326125_qa_4/tests/grader.py b/tasks/0033_326_33326125_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_326_33326125_qa_4/tests/grader.py +++ b/tasks/0033_326_33326125_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/0033_420_33420599_qa_1/tests/grader.py b/tasks/0033_420_33420599_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_420_33420599_qa_1/tests/grader.py +++ b/tasks/0033_420_33420599_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/0033_420_33420599_qa_5/tests/grader.py b/tasks/0033_420_33420599_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_420_33420599_qa_5/tests/grader.py +++ b/tasks/0033_420_33420599_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/0033_423_33423582_qa_4/tests/grader.py b/tasks/0033_423_33423582_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_423_33423582_qa_4/tests/grader.py +++ b/tasks/0033_423_33423582_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/0033_448_33448868_qa_2/tests/grader.py b/tasks/0033_448_33448868_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_448_33448868_qa_2/tests/grader.py +++ b/tasks/0033_448_33448868_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/0033_509_33509634_qa_1/tests/grader.py b/tasks/0033_509_33509634_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_509_33509634_qa_1/tests/grader.py +++ b/tasks/0033_509_33509634_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/0033_509_33509634_qa_4/tests/grader.py b/tasks/0033_509_33509634_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_509_33509634_qa_4/tests/grader.py +++ b/tasks/0033_509_33509634_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/0033_558_33558610_qa_3/tests/grader.py b/tasks/0033_558_33558610_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_558_33558610_qa_3/tests/grader.py +++ b/tasks/0033_558_33558610_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/0033_589_33589892_qa_1/tests/grader.py b/tasks/0033_589_33589892_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_589_33589892_qa_1/tests/grader.py +++ b/tasks/0033_589_33589892_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/0033_589_33589892_qa_4/tests/grader.py b/tasks/0033_589_33589892_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_589_33589892_qa_4/tests/grader.py +++ b/tasks/0033_589_33589892_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/0033_652_33652373_qa_2/tests/grader.py b/tasks/0033_652_33652373_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_652_33652373_qa_2/tests/grader.py +++ b/tasks/0033_652_33652373_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/0033_652_33652373_qa_3/tests/grader.py b/tasks/0033_652_33652373_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_652_33652373_qa_3/tests/grader.py +++ b/tasks/0033_652_33652373_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/0033_668_33668266_qa_2/tests/grader.py b/tasks/0033_668_33668266_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_668_33668266_qa_2/tests/grader.py +++ b/tasks/0033_668_33668266_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/0033_668_33668266_qa_3/tests/grader.py b/tasks/0033_668_33668266_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_668_33668266_qa_3/tests/grader.py +++ b/tasks/0033_668_33668266_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/0033_684_33684962_qa_2/tests/grader.py b/tasks/0033_684_33684962_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_684_33684962_qa_2/tests/grader.py +++ b/tasks/0033_684_33684962_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/0033_684_33684962_qa_3/tests/grader.py b/tasks/0033_684_33684962_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_684_33684962_qa_3/tests/grader.py +++ b/tasks/0033_684_33684962_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/0033_684_33684962_qa_5/tests/grader.py b/tasks/0033_684_33684962_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_684_33684962_qa_5/tests/grader.py +++ b/tasks/0033_684_33684962_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/0033_697_33697266_qa_2/tests/grader.py b/tasks/0033_697_33697266_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_697_33697266_qa_2/tests/grader.py +++ b/tasks/0033_697_33697266_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/0033_700_33700089_qa_1/tests/grader.py b/tasks/0033_700_33700089_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_700_33700089_qa_1/tests/grader.py +++ b/tasks/0033_700_33700089_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/0033_703_33703584_qa_3/tests/grader.py b/tasks/0033_703_33703584_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_703_33703584_qa_3/tests/grader.py +++ b/tasks/0033_703_33703584_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/0033_703_33703584_qa_5/tests/grader.py b/tasks/0033_703_33703584_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_703_33703584_qa_5/tests/grader.py +++ b/tasks/0033_703_33703584_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/0033_717_33717801_qa_3/tests/grader.py b/tasks/0033_717_33717801_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_717_33717801_qa_3/tests/grader.py +++ b/tasks/0033_717_33717801_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/0033_717_33717801_qa_5/tests/grader.py b/tasks/0033_717_33717801_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_717_33717801_qa_5/tests/grader.py +++ b/tasks/0033_717_33717801_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/0033_717_33717850_qa_2/tests/grader.py b/tasks/0033_717_33717850_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_717_33717850_qa_2/tests/grader.py +++ b/tasks/0033_717_33717850_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/0033_726_33726120_qa_2/tests/grader.py b/tasks/0033_726_33726120_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_726_33726120_qa_2/tests/grader.py +++ b/tasks/0033_726_33726120_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/0033_726_33726120_qa_4/tests/grader.py b/tasks/0033_726_33726120_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_726_33726120_qa_4/tests/grader.py +++ b/tasks/0033_726_33726120_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/0033_726_33726120_qa_5/tests/grader.py b/tasks/0033_726_33726120_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_726_33726120_qa_5/tests/grader.py +++ b/tasks/0033_726_33726120_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/0033_745_33745374_qa_2/tests/grader.py b/tasks/0033_745_33745374_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_745_33745374_qa_2/tests/grader.py +++ b/tasks/0033_745_33745374_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/0033_752_33752341_qa_4/tests/grader.py b/tasks/0033_752_33752341_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_752_33752341_qa_4/tests/grader.py +++ b/tasks/0033_752_33752341_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/0033_755_33755094_qa_3/tests/grader.py b/tasks/0033_755_33755094_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_755_33755094_qa_3/tests/grader.py +++ b/tasks/0033_755_33755094_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/0033_760_33760253_qa_4/tests/grader.py b/tasks/0033_760_33760253_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_760_33760253_qa_4/tests/grader.py +++ b/tasks/0033_760_33760253_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/0033_787_33787812_qa_1/tests/grader.py b/tasks/0033_787_33787812_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_787_33787812_qa_1/tests/grader.py +++ b/tasks/0033_787_33787812_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/0033_963_33963401_qa_1/tests/grader.py b/tasks/0033_963_33963401_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_963_33963401_qa_1/tests/grader.py +++ b/tasks/0033_963_33963401_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/0033_963_33963401_qa_3/tests/grader.py b/tasks/0033_963_33963401_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_963_33963401_qa_3/tests/grader.py +++ b/tasks/0033_963_33963401_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/0033_988_33988731_qa_4/tests/grader.py b/tasks/0033_988_33988731_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0033_988_33988731_qa_4/tests/grader.py +++ b/tasks/0033_988_33988731_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/0034_023_34023168_qa_1/tests/grader.py b/tasks/0034_023_34023168_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_023_34023168_qa_1/tests/grader.py +++ b/tasks/0034_023_34023168_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/0034_023_34023168_qa_2/tests/grader.py b/tasks/0034_023_34023168_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_023_34023168_qa_2/tests/grader.py +++ b/tasks/0034_023_34023168_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/0034_043_34043351_qa_3/tests/grader.py b/tasks/0034_043_34043351_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_043_34043351_qa_3/tests/grader.py +++ b/tasks/0034_043_34043351_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/0034_108_34108193_qa_1/tests/grader.py b/tasks/0034_108_34108193_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_108_34108193_qa_1/tests/grader.py +++ b/tasks/0034_108_34108193_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/0034_170_34170800_qa_2/tests/grader.py b/tasks/0034_170_34170800_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_170_34170800_qa_2/tests/grader.py +++ b/tasks/0034_170_34170800_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/0034_193_34193226_qa_2/tests/grader.py b/tasks/0034_193_34193226_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_193_34193226_qa_2/tests/grader.py +++ b/tasks/0034_193_34193226_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/0034_193_34193226_qa_3/tests/grader.py b/tasks/0034_193_34193226_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_193_34193226_qa_3/tests/grader.py +++ b/tasks/0034_193_34193226_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/0034_200_34200101_qa_1/tests/grader.py b/tasks/0034_200_34200101_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_200_34200101_qa_1/tests/grader.py +++ b/tasks/0034_200_34200101_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/0034_233_34233505_qa_1/tests/grader.py b/tasks/0034_233_34233505_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_233_34233505_qa_1/tests/grader.py +++ b/tasks/0034_233_34233505_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/0034_233_34233505_qa_2/tests/grader.py b/tasks/0034_233_34233505_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_233_34233505_qa_2/tests/grader.py +++ b/tasks/0034_233_34233505_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/0034_233_34233505_qa_4/tests/grader.py b/tasks/0034_233_34233505_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_233_34233505_qa_4/tests/grader.py +++ b/tasks/0034_233_34233505_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/0034_265_34265100_qa_1/tests/grader.py b/tasks/0034_265_34265100_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_265_34265100_qa_1/tests/grader.py +++ b/tasks/0034_265_34265100_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/0034_265_34265100_qa_2/tests/grader.py b/tasks/0034_265_34265100_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_265_34265100_qa_2/tests/grader.py +++ b/tasks/0034_265_34265100_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/0034_295_34295424_qa_1/tests/grader.py b/tasks/0034_295_34295424_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_295_34295424_qa_1/tests/grader.py +++ b/tasks/0034_295_34295424_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/0034_339_34339717_qa_1/tests/grader.py b/tasks/0034_339_34339717_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_339_34339717_qa_1/tests/grader.py +++ b/tasks/0034_339_34339717_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/0034_339_34339717_qa_3/tests/grader.py b/tasks/0034_339_34339717_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_339_34339717_qa_3/tests/grader.py +++ b/tasks/0034_339_34339717_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/0034_339_34339717_qa_5/tests/grader.py b/tasks/0034_339_34339717_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_339_34339717_qa_5/tests/grader.py +++ b/tasks/0034_339_34339717_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/0034_376_34376500_qa_4/tests/grader.py b/tasks/0034_376_34376500_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_376_34376500_qa_4/tests/grader.py +++ b/tasks/0034_376_34376500_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/0034_380_34380054_qa_1/tests/grader.py b/tasks/0034_380_34380054_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_380_34380054_qa_1/tests/grader.py +++ b/tasks/0034_380_34380054_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/0034_380_34380054_qa_2/tests/grader.py b/tasks/0034_380_34380054_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_380_34380054_qa_2/tests/grader.py +++ b/tasks/0034_380_34380054_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/0034_457_34457545_qa_2/tests/grader.py b/tasks/0034_457_34457545_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_457_34457545_qa_2/tests/grader.py +++ b/tasks/0034_457_34457545_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/0034_513_34513680_qa_5/tests/grader.py b/tasks/0034_513_34513680_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_513_34513680_qa_5/tests/grader.py +++ b/tasks/0034_513_34513680_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/0034_568_34568948_qa_3/tests/grader.py b/tasks/0034_568_34568948_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_568_34568948_qa_3/tests/grader.py +++ b/tasks/0034_568_34568948_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/0034_568_34568948_qa_5/tests/grader.py b/tasks/0034_568_34568948_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_568_34568948_qa_5/tests/grader.py +++ b/tasks/0034_568_34568948_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/0034_588_34588161_qa_5/tests/grader.py b/tasks/0034_588_34588161_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_588_34588161_qa_5/tests/grader.py +++ b/tasks/0034_588_34588161_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/0034_651_34651965_qa_2/tests/grader.py b/tasks/0034_651_34651965_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_651_34651965_qa_2/tests/grader.py +++ b/tasks/0034_651_34651965_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/0034_705_34705944_qa_4/tests/grader.py b/tasks/0034_705_34705944_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_705_34705944_qa_4/tests/grader.py +++ b/tasks/0034_705_34705944_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/0034_726_34726167_qa_2/tests/grader.py b/tasks/0034_726_34726167_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_726_34726167_qa_2/tests/grader.py +++ b/tasks/0034_726_34726167_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/0034_748_34748003_qa_1/tests/grader.py b/tasks/0034_748_34748003_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_748_34748003_qa_1/tests/grader.py +++ b/tasks/0034_748_34748003_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/0034_748_34748003_qa_3/tests/grader.py b/tasks/0034_748_34748003_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_748_34748003_qa_3/tests/grader.py +++ b/tasks/0034_748_34748003_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/0034_768_34768850_qa_2/tests/grader.py b/tasks/0034_768_34768850_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_768_34768850_qa_2/tests/grader.py +++ b/tasks/0034_768_34768850_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/0034_768_34768850_qa_3/tests/grader.py b/tasks/0034_768_34768850_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_768_34768850_qa_3/tests/grader.py +++ b/tasks/0034_768_34768850_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/0034_773_34773515_qa_1/tests/grader.py b/tasks/0034_773_34773515_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_773_34773515_qa_1/tests/grader.py +++ b/tasks/0034_773_34773515_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/0034_773_34773515_qa_2/tests/grader.py b/tasks/0034_773_34773515_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_773_34773515_qa_2/tests/grader.py +++ b/tasks/0034_773_34773515_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/0034_773_34773515_qa_3/tests/grader.py b/tasks/0034_773_34773515_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_773_34773515_qa_3/tests/grader.py +++ b/tasks/0034_773_34773515_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/0034_773_34773515_qa_5/tests/grader.py b/tasks/0034_773_34773515_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_773_34773515_qa_5/tests/grader.py +++ b/tasks/0034_773_34773515_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/0034_777_34777395_qa_3/tests/grader.py b/tasks/0034_777_34777395_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_777_34777395_qa_3/tests/grader.py +++ b/tasks/0034_777_34777395_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/0034_793_34793224_qa_1/tests/grader.py b/tasks/0034_793_34793224_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_793_34793224_qa_1/tests/grader.py +++ b/tasks/0034_793_34793224_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/0034_793_34793224_qa_3/tests/grader.py b/tasks/0034_793_34793224_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_793_34793224_qa_3/tests/grader.py +++ b/tasks/0034_793_34793224_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/0034_886_34886359_qa_3/tests/grader.py b/tasks/0034_886_34886359_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_886_34886359_qa_3/tests/grader.py +++ b/tasks/0034_886_34886359_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/0034_886_34886359_qa_5/tests/grader.py b/tasks/0034_886_34886359_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_886_34886359_qa_5/tests/grader.py +++ b/tasks/0034_886_34886359_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/0034_890_34890721_qa_3/tests/grader.py b/tasks/0034_890_34890721_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_890_34890721_qa_3/tests/grader.py +++ b/tasks/0034_890_34890721_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/0034_890_34890721_qa_4/tests/grader.py b/tasks/0034_890_34890721_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_890_34890721_qa_4/tests/grader.py +++ b/tasks/0034_890_34890721_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/0034_912_34912092_qa_3/tests/grader.py b/tasks/0034_912_34912092_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_912_34912092_qa_3/tests/grader.py +++ b/tasks/0034_912_34912092_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/0034_912_34912092_qa_5/tests/grader.py b/tasks/0034_912_34912092_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_912_34912092_qa_5/tests/grader.py +++ b/tasks/0034_912_34912092_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/0034_916_34916115_qa_2/tests/grader.py b/tasks/0034_916_34916115_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_916_34916115_qa_2/tests/grader.py +++ b/tasks/0034_916_34916115_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/0034_945_34945606_qa_2/tests/grader.py b/tasks/0034_945_34945606_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_945_34945606_qa_2/tests/grader.py +++ b/tasks/0034_945_34945606_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/0034_945_34945606_qa_5/tests/grader.py b/tasks/0034_945_34945606_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0034_945_34945606_qa_5/tests/grader.py +++ b/tasks/0034_945_34945606_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/0035_022_35022939_qa_2/tests/grader.py b/tasks/0035_022_35022939_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_022_35022939_qa_2/tests/grader.py +++ b/tasks/0035_022_35022939_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/0035_025_35025726_qa_2/tests/grader.py b/tasks/0035_025_35025726_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_025_35025726_qa_2/tests/grader.py +++ b/tasks/0035_025_35025726_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/0035_070_35070602_qa_2/tests/grader.py b/tasks/0035_070_35070602_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_070_35070602_qa_2/tests/grader.py +++ b/tasks/0035_070_35070602_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/0035_074_35074138_qa_2/tests/grader.py b/tasks/0035_074_35074138_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_074_35074138_qa_2/tests/grader.py +++ b/tasks/0035_074_35074138_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/0035_121_35121535_qa_1/tests/grader.py b/tasks/0035_121_35121535_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_121_35121535_qa_1/tests/grader.py +++ b/tasks/0035_121_35121535_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/0035_122_35122628_qa_1/tests/grader.py b/tasks/0035_122_35122628_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_122_35122628_qa_1/tests/grader.py +++ b/tasks/0035_122_35122628_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/0035_152_35152468_qa_2/tests/grader.py b/tasks/0035_152_35152468_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_152_35152468_qa_2/tests/grader.py +++ b/tasks/0035_152_35152468_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/0035_171_35171975_qa_3/tests/grader.py b/tasks/0035_171_35171975_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_171_35171975_qa_3/tests/grader.py +++ b/tasks/0035_171_35171975_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/0035_171_35171975_qa_4/tests/grader.py b/tasks/0035_171_35171975_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_171_35171975_qa_4/tests/grader.py +++ b/tasks/0035_171_35171975_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/0035_188_35188217_qa_4/tests/grader.py b/tasks/0035_188_35188217_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_188_35188217_qa_4/tests/grader.py +++ b/tasks/0035_188_35188217_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/0035_225_35225660_qa_3/tests/grader.py b/tasks/0035_225_35225660_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_225_35225660_qa_3/tests/grader.py +++ b/tasks/0035_225_35225660_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/0035_228_35228737_qa_5/tests/grader.py b/tasks/0035_228_35228737_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_228_35228737_qa_5/tests/grader.py +++ b/tasks/0035_228_35228737_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/0035_236_35236430_qa_3/tests/grader.py b/tasks/0035_236_35236430_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_236_35236430_qa_3/tests/grader.py +++ b/tasks/0035_236_35236430_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/0035_236_35236553_qa_1/tests/grader.py b/tasks/0035_236_35236553_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_236_35236553_qa_1/tests/grader.py +++ b/tasks/0035_236_35236553_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/0035_236_35236553_qa_4/tests/grader.py b/tasks/0035_236_35236553_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_236_35236553_qa_4/tests/grader.py +++ b/tasks/0035_236_35236553_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/0035_242_35242928_qa_2/tests/grader.py b/tasks/0035_242_35242928_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_242_35242928_qa_2/tests/grader.py +++ b/tasks/0035_242_35242928_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/0035_247_35247886_qa_1/tests/grader.py b/tasks/0035_247_35247886_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_247_35247886_qa_1/tests/grader.py +++ b/tasks/0035_247_35247886_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/0035_269_35269567_qa_1/tests/grader.py b/tasks/0035_269_35269567_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_269_35269567_qa_1/tests/grader.py +++ b/tasks/0035_269_35269567_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/0035_269_35269567_qa_2/tests/grader.py b/tasks/0035_269_35269567_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_269_35269567_qa_2/tests/grader.py +++ b/tasks/0035_269_35269567_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/0035_273_35273491_qa_3/tests/grader.py b/tasks/0035_273_35273491_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_273_35273491_qa_3/tests/grader.py +++ b/tasks/0035_273_35273491_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/0035_303_35303628_qa_1/tests/grader.py b/tasks/0035_303_35303628_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_303_35303628_qa_1/tests/grader.py +++ b/tasks/0035_303_35303628_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/0035_303_35303628_qa_2/tests/grader.py b/tasks/0035_303_35303628_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_303_35303628_qa_2/tests/grader.py +++ b/tasks/0035_303_35303628_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/0035_332_35332466_qa_2/tests/grader.py b/tasks/0035_332_35332466_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_332_35332466_qa_2/tests/grader.py +++ b/tasks/0035_332_35332466_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/0035_332_35332810_qa_3/tests/grader.py b/tasks/0035_332_35332810_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_332_35332810_qa_3/tests/grader.py +++ b/tasks/0035_332_35332810_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/0035_336_35336797_qa_5/tests/grader.py b/tasks/0035_336_35336797_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_336_35336797_qa_5/tests/grader.py +++ b/tasks/0035_336_35336797_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/0035_337_35337905_qa_1/tests/grader.py b/tasks/0035_337_35337905_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_337_35337905_qa_1/tests/grader.py +++ b/tasks/0035_337_35337905_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/0035_350_35350224_qa_5/tests/grader.py b/tasks/0035_350_35350224_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_350_35350224_qa_5/tests/grader.py +++ b/tasks/0035_350_35350224_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/0035_362_35362667_qa_4/tests/grader.py b/tasks/0035_362_35362667_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_362_35362667_qa_4/tests/grader.py +++ b/tasks/0035_362_35362667_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/0035_362_35362667_qa_5/tests/grader.py b/tasks/0035_362_35362667_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_362_35362667_qa_5/tests/grader.py +++ b/tasks/0035_362_35362667_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/0035_370_35370774_qa_3/tests/grader.py b/tasks/0035_370_35370774_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_370_35370774_qa_3/tests/grader.py +++ b/tasks/0035_370_35370774_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/0035_391_35391770_qa_1/tests/grader.py b/tasks/0035_391_35391770_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_391_35391770_qa_1/tests/grader.py +++ b/tasks/0035_391_35391770_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/0035_442_35442155_qa_2/tests/grader.py b/tasks/0035_442_35442155_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_442_35442155_qa_2/tests/grader.py +++ b/tasks/0035_442_35442155_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/0035_456_35456170_qa_5/tests/grader.py b/tasks/0035_456_35456170_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_456_35456170_qa_5/tests/grader.py +++ b/tasks/0035_456_35456170_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/0035_513_35513650_qa_5/tests/grader.py b/tasks/0035_513_35513650_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_513_35513650_qa_5/tests/grader.py +++ b/tasks/0035_513_35513650_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/0035_539_35539946_qa_3/tests/grader.py b/tasks/0035_539_35539946_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_539_35539946_qa_3/tests/grader.py +++ b/tasks/0035_539_35539946_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/0035_546_35546963_qa_4/tests/grader.py b/tasks/0035_546_35546963_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_546_35546963_qa_4/tests/grader.py +++ b/tasks/0035_546_35546963_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/0035_558_35558843_qa_1/tests/grader.py b/tasks/0035_558_35558843_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_558_35558843_qa_1/tests/grader.py +++ b/tasks/0035_558_35558843_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/0035_586_35586526_qa_2/tests/grader.py b/tasks/0035_586_35586526_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_586_35586526_qa_2/tests/grader.py +++ b/tasks/0035_586_35586526_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/0035_609_35609748_qa_1/tests/grader.py b/tasks/0035_609_35609748_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_609_35609748_qa_1/tests/grader.py +++ b/tasks/0035_609_35609748_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/0035_610_35610325_qa_3/tests/grader.py b/tasks/0035_610_35610325_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_610_35610325_qa_3/tests/grader.py +++ b/tasks/0035_610_35610325_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/0035_638_35638998_qa_1/tests/grader.py b/tasks/0035_638_35638998_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_638_35638998_qa_1/tests/grader.py +++ b/tasks/0035_638_35638998_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/0035_638_35638998_qa_4/tests/grader.py b/tasks/0035_638_35638998_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_638_35638998_qa_4/tests/grader.py +++ b/tasks/0035_638_35638998_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/0035_645_35645519_qa_3/tests/grader.py b/tasks/0035_645_35645519_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_645_35645519_qa_3/tests/grader.py +++ b/tasks/0035_645_35645519_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/0035_645_35645519_qa_4/tests/grader.py b/tasks/0035_645_35645519_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_645_35645519_qa_4/tests/grader.py +++ b/tasks/0035_645_35645519_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/0035_645_35645519_qa_5/tests/grader.py b/tasks/0035_645_35645519_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_645_35645519_qa_5/tests/grader.py +++ b/tasks/0035_645_35645519_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/0035_700_35700149_qa_1/tests/grader.py b/tasks/0035_700_35700149_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_700_35700149_qa_1/tests/grader.py +++ b/tasks/0035_700_35700149_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/0035_700_35700149_qa_3/tests/grader.py b/tasks/0035_700_35700149_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_700_35700149_qa_3/tests/grader.py +++ b/tasks/0035_700_35700149_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/0035_712_35712790_qa_3/tests/grader.py b/tasks/0035_712_35712790_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_712_35712790_qa_3/tests/grader.py +++ b/tasks/0035_712_35712790_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/0035_717_35717551_qa_2/tests/grader.py b/tasks/0035_717_35717551_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_717_35717551_qa_2/tests/grader.py +++ b/tasks/0035_717_35717551_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/0035_717_35717551_qa_4/tests/grader.py b/tasks/0035_717_35717551_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_717_35717551_qa_4/tests/grader.py +++ b/tasks/0035_717_35717551_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/0035_745_35745803_qa_1/tests/grader.py b/tasks/0035_745_35745803_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_745_35745803_qa_1/tests/grader.py +++ b/tasks/0035_745_35745803_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/0035_755_35755658_qa_3/tests/grader.py b/tasks/0035_755_35755658_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_755_35755658_qa_3/tests/grader.py +++ b/tasks/0035_755_35755658_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/0035_789_35789775_qa_3/tests/grader.py b/tasks/0035_789_35789775_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_789_35789775_qa_3/tests/grader.py +++ b/tasks/0035_789_35789775_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/0035_789_35789775_qa_5/tests/grader.py b/tasks/0035_789_35789775_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_789_35789775_qa_5/tests/grader.py +++ b/tasks/0035_789_35789775_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/0035_812_35812389_qa_2/tests/grader.py b/tasks/0035_812_35812389_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_812_35812389_qa_2/tests/grader.py +++ b/tasks/0035_812_35812389_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/0035_835_35835284_qa_2/tests/grader.py b/tasks/0035_835_35835284_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_835_35835284_qa_2/tests/grader.py +++ b/tasks/0035_835_35835284_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/0035_835_35835284_qa_3/tests/grader.py b/tasks/0035_835_35835284_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_835_35835284_qa_3/tests/grader.py +++ b/tasks/0035_835_35835284_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/0035_901_35901074_qa_5/tests/grader.py b/tasks/0035_901_35901074_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_901_35901074_qa_5/tests/grader.py +++ b/tasks/0035_901_35901074_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/0035_911_35911748_qa_2/tests/grader.py b/tasks/0035_911_35911748_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_911_35911748_qa_2/tests/grader.py +++ b/tasks/0035_911_35911748_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/0035_921_35921172_qa_1/tests/grader.py b/tasks/0035_921_35921172_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_921_35921172_qa_1/tests/grader.py +++ b/tasks/0035_921_35921172_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/0035_921_35921172_qa_4/tests/grader.py b/tasks/0035_921_35921172_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_921_35921172_qa_4/tests/grader.py +++ b/tasks/0035_921_35921172_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/0035_921_35921172_qa_5/tests/grader.py b/tasks/0035_921_35921172_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_921_35921172_qa_5/tests/grader.py +++ b/tasks/0035_921_35921172_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/0035_974_35974226_qa_4/tests/grader.py b/tasks/0035_974_35974226_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_974_35974226_qa_4/tests/grader.py +++ b/tasks/0035_974_35974226_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/0035_980_35980933_qa_5/tests/grader.py b/tasks/0035_980_35980933_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_980_35980933_qa_5/tests/grader.py +++ b/tasks/0035_980_35980933_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/0035_999_35999601_qa_3/tests/grader.py b/tasks/0035_999_35999601_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0035_999_35999601_qa_3/tests/grader.py +++ b/tasks/0035_999_35999601_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/0036_001_36001422_qa_1/tests/grader.py b/tasks/0036_001_36001422_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_001_36001422_qa_1/tests/grader.py +++ b/tasks/0036_001_36001422_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/0036_030_36030056_qa_2/tests/grader.py b/tasks/0036_030_36030056_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_030_36030056_qa_2/tests/grader.py +++ b/tasks/0036_030_36030056_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/0036_141_36141043_qa_2/tests/grader.py b/tasks/0036_141_36141043_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_141_36141043_qa_2/tests/grader.py +++ b/tasks/0036_141_36141043_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/0036_186_36186441_qa_2/tests/grader.py b/tasks/0036_186_36186441_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_186_36186441_qa_2/tests/grader.py +++ b/tasks/0036_186_36186441_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/0036_230_36230590_qa_1/tests/grader.py b/tasks/0036_230_36230590_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_230_36230590_qa_1/tests/grader.py +++ b/tasks/0036_230_36230590_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/0036_275_36275138_qa_4/tests/grader.py b/tasks/0036_275_36275138_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_275_36275138_qa_4/tests/grader.py +++ b/tasks/0036_275_36275138_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/0036_275_36275741_qa_5/tests/grader.py b/tasks/0036_275_36275741_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_275_36275741_qa_5/tests/grader.py +++ b/tasks/0036_275_36275741_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/0036_294_36294724_qa_1/tests/grader.py b/tasks/0036_294_36294724_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_294_36294724_qa_1/tests/grader.py +++ b/tasks/0036_294_36294724_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/0036_305_36305200_qa_3/tests/grader.py b/tasks/0036_305_36305200_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_305_36305200_qa_3/tests/grader.py +++ b/tasks/0036_305_36305200_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/0036_324_36324294_qa_1/tests/grader.py b/tasks/0036_324_36324294_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_324_36324294_qa_1/tests/grader.py +++ b/tasks/0036_324_36324294_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/0036_430_36430763_qa_1/tests/grader.py b/tasks/0036_430_36430763_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_430_36430763_qa_1/tests/grader.py +++ b/tasks/0036_430_36430763_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/0036_430_36430763_qa_5/tests/grader.py b/tasks/0036_430_36430763_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_430_36430763_qa_5/tests/grader.py +++ b/tasks/0036_430_36430763_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/0036_436_36436182_qa_5/tests/grader.py b/tasks/0036_436_36436182_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_436_36436182_qa_5/tests/grader.py +++ b/tasks/0036_436_36436182_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/0036_510_36510950_qa_3/tests/grader.py b/tasks/0036_510_36510950_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_510_36510950_qa_3/tests/grader.py +++ b/tasks/0036_510_36510950_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/0036_510_36510950_qa_4/tests/grader.py b/tasks/0036_510_36510950_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_510_36510950_qa_4/tests/grader.py +++ b/tasks/0036_510_36510950_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/0036_510_36510950_qa_5/tests/grader.py b/tasks/0036_510_36510950_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_510_36510950_qa_5/tests/grader.py +++ b/tasks/0036_510_36510950_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/0036_579_36579520_qa_4/tests/grader.py b/tasks/0036_579_36579520_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_579_36579520_qa_4/tests/grader.py +++ b/tasks/0036_579_36579520_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/0036_629_36629065_qa_2/tests/grader.py b/tasks/0036_629_36629065_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_629_36629065_qa_2/tests/grader.py +++ b/tasks/0036_629_36629065_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/0036_637_36637598_qa_2/tests/grader.py b/tasks/0036_637_36637598_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_637_36637598_qa_2/tests/grader.py +++ b/tasks/0036_637_36637598_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/0036_637_36637598_qa_4/tests/grader.py b/tasks/0036_637_36637598_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_637_36637598_qa_4/tests/grader.py +++ b/tasks/0036_637_36637598_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/0036_800_36800377_qa_3/tests/grader.py b/tasks/0036_800_36800377_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_800_36800377_qa_3/tests/grader.py +++ b/tasks/0036_800_36800377_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/0036_800_36800377_qa_4/tests/grader.py b/tasks/0036_800_36800377_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_800_36800377_qa_4/tests/grader.py +++ b/tasks/0036_800_36800377_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/0036_800_36800377_qa_5/tests/grader.py b/tasks/0036_800_36800377_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_800_36800377_qa_5/tests/grader.py +++ b/tasks/0036_800_36800377_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/0036_817_36817810_qa_1/tests/grader.py b/tasks/0036_817_36817810_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_817_36817810_qa_1/tests/grader.py +++ b/tasks/0036_817_36817810_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/0036_817_36817810_qa_4/tests/grader.py b/tasks/0036_817_36817810_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_817_36817810_qa_4/tests/grader.py +++ b/tasks/0036_817_36817810_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/0036_818_36818972_qa_1/tests/grader.py b/tasks/0036_818_36818972_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_818_36818972_qa_1/tests/grader.py +++ b/tasks/0036_818_36818972_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/0036_847_36847235_qa_1/tests/grader.py b/tasks/0036_847_36847235_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_847_36847235_qa_1/tests/grader.py +++ b/tasks/0036_847_36847235_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/0036_916_36916974_qa_1/tests/grader.py b/tasks/0036_916_36916974_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_916_36916974_qa_1/tests/grader.py +++ b/tasks/0036_916_36916974_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/0036_916_36916974_qa_5/tests/grader.py b/tasks/0036_916_36916974_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_916_36916974_qa_5/tests/grader.py +++ b/tasks/0036_916_36916974_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/0036_927_36927955_qa_1/tests/grader.py b/tasks/0036_927_36927955_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_927_36927955_qa_1/tests/grader.py +++ b/tasks/0036_927_36927955_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/0036_949_36949181_qa_1/tests/grader.py b/tasks/0036_949_36949181_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0036_949_36949181_qa_1/tests/grader.py +++ b/tasks/0036_949_36949181_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/0037_011_37011559_qa_5/tests/grader.py b/tasks/0037_011_37011559_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_011_37011559_qa_5/tests/grader.py +++ b/tasks/0037_011_37011559_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/0037_052_37052709_qa_5/tests/grader.py b/tasks/0037_052_37052709_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_052_37052709_qa_5/tests/grader.py +++ b/tasks/0037_052_37052709_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/0037_084_37084203_qa_1/tests/grader.py b/tasks/0037_084_37084203_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_084_37084203_qa_1/tests/grader.py +++ b/tasks/0037_084_37084203_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/0037_093_37093290_qa_1/tests/grader.py b/tasks/0037_093_37093290_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_093_37093290_qa_1/tests/grader.py +++ b/tasks/0037_093_37093290_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/0037_139_37139079_qa_2/tests/grader.py b/tasks/0037_139_37139079_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_139_37139079_qa_2/tests/grader.py +++ b/tasks/0037_139_37139079_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/0037_168_37168956_qa_5/tests/grader.py b/tasks/0037_168_37168956_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_168_37168956_qa_5/tests/grader.py +++ b/tasks/0037_168_37168956_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/0037_173_37173260_qa_1/tests/grader.py b/tasks/0037_173_37173260_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_173_37173260_qa_1/tests/grader.py +++ b/tasks/0037_173_37173260_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/0037_209_37209957_qa_5/tests/grader.py b/tasks/0037_209_37209957_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_209_37209957_qa_5/tests/grader.py +++ b/tasks/0037_209_37209957_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/0037_236_37236169_qa_4/tests/grader.py b/tasks/0037_236_37236169_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_236_37236169_qa_4/tests/grader.py +++ b/tasks/0037_236_37236169_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/0037_280_37280696_qa_2/tests/grader.py b/tasks/0037_280_37280696_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_280_37280696_qa_2/tests/grader.py +++ b/tasks/0037_280_37280696_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/0037_280_37280696_qa_5/tests/grader.py b/tasks/0037_280_37280696_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_280_37280696_qa_5/tests/grader.py +++ b/tasks/0037_280_37280696_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/0037_292_37292636_qa_3/tests/grader.py b/tasks/0037_292_37292636_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_292_37292636_qa_3/tests/grader.py +++ b/tasks/0037_292_37292636_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/0037_308_37308262_qa_3/tests/grader.py b/tasks/0037_308_37308262_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_308_37308262_qa_3/tests/grader.py +++ b/tasks/0037_308_37308262_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/0037_308_37308262_qa_4/tests/grader.py b/tasks/0037_308_37308262_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_308_37308262_qa_4/tests/grader.py +++ b/tasks/0037_308_37308262_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/0037_513_37513711_qa_2/tests/grader.py b/tasks/0037_513_37513711_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_513_37513711_qa_2/tests/grader.py +++ b/tasks/0037_513_37513711_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/0037_551_37551034_qa_1/tests/grader.py b/tasks/0037_551_37551034_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_551_37551034_qa_1/tests/grader.py +++ b/tasks/0037_551_37551034_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/0037_554_37554731_qa_1/tests/grader.py b/tasks/0037_554_37554731_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_554_37554731_qa_1/tests/grader.py +++ b/tasks/0037_554_37554731_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/0037_594_37594747_qa_1/tests/grader.py b/tasks/0037_594_37594747_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_594_37594747_qa_1/tests/grader.py +++ b/tasks/0037_594_37594747_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/0037_631_37631084_qa_2/tests/grader.py b/tasks/0037_631_37631084_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_631_37631084_qa_2/tests/grader.py +++ b/tasks/0037_631_37631084_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/0037_631_37631084_qa_3/tests/grader.py b/tasks/0037_631_37631084_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_631_37631084_qa_3/tests/grader.py +++ b/tasks/0037_631_37631084_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/0037_718_37718370_qa_1/tests/grader.py b/tasks/0037_718_37718370_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_718_37718370_qa_1/tests/grader.py +++ b/tasks/0037_718_37718370_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/0037_718_37718370_qa_2/tests/grader.py b/tasks/0037_718_37718370_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_718_37718370_qa_2/tests/grader.py +++ b/tasks/0037_718_37718370_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/0037_718_37718370_qa_3/tests/grader.py b/tasks/0037_718_37718370_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_718_37718370_qa_3/tests/grader.py +++ b/tasks/0037_718_37718370_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/0037_725_37725403_qa_5/tests/grader.py b/tasks/0037_725_37725403_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_725_37725403_qa_5/tests/grader.py +++ b/tasks/0037_725_37725403_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/0037_728_37728227_qa_2/tests/grader.py b/tasks/0037_728_37728227_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_728_37728227_qa_2/tests/grader.py +++ b/tasks/0037_728_37728227_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/0037_799_37799845_qa_4/tests/grader.py b/tasks/0037_799_37799845_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_799_37799845_qa_4/tests/grader.py +++ b/tasks/0037_799_37799845_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/0037_799_37799845_qa_5/tests/grader.py b/tasks/0037_799_37799845_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_799_37799845_qa_5/tests/grader.py +++ b/tasks/0037_799_37799845_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/0037_859_37859442_qa_1/tests/grader.py b/tasks/0037_859_37859442_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_859_37859442_qa_1/tests/grader.py +++ b/tasks/0037_859_37859442_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/0037_895_37895109_qa_2/tests/grader.py b/tasks/0037_895_37895109_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_895_37895109_qa_2/tests/grader.py +++ b/tasks/0037_895_37895109_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/0037_918_37918087_qa_1/tests/grader.py b/tasks/0037_918_37918087_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_918_37918087_qa_1/tests/grader.py +++ b/tasks/0037_918_37918087_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/0037_918_37918087_qa_4/tests/grader.py b/tasks/0037_918_37918087_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_918_37918087_qa_4/tests/grader.py +++ b/tasks/0037_918_37918087_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/0037_933_37933355_qa_2/tests/grader.py b/tasks/0037_933_37933355_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_933_37933355_qa_2/tests/grader.py +++ b/tasks/0037_933_37933355_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/0037_995_37995698_qa_1/tests/grader.py b/tasks/0037_995_37995698_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0037_995_37995698_qa_1/tests/grader.py +++ b/tasks/0037_995_37995698_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/0038_031_38031736_qa_4/tests/grader.py b/tasks/0038_031_38031736_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_031_38031736_qa_4/tests/grader.py +++ b/tasks/0038_031_38031736_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/0038_159_38159473_qa_2/tests/grader.py b/tasks/0038_159_38159473_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_159_38159473_qa_2/tests/grader.py +++ b/tasks/0038_159_38159473_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/0038_159_38159473_qa_4/tests/grader.py b/tasks/0038_159_38159473_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_159_38159473_qa_4/tests/grader.py +++ b/tasks/0038_159_38159473_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/0038_165_38165504_qa_3/tests/grader.py b/tasks/0038_165_38165504_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_165_38165504_qa_3/tests/grader.py +++ b/tasks/0038_165_38165504_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/0038_178_38178392_qa_1/tests/grader.py b/tasks/0038_178_38178392_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_178_38178392_qa_1/tests/grader.py +++ b/tasks/0038_178_38178392_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/0038_189_38189340_qa_1/tests/grader.py b/tasks/0038_189_38189340_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_189_38189340_qa_1/tests/grader.py +++ b/tasks/0038_189_38189340_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/0038_189_38189340_qa_2/tests/grader.py b/tasks/0038_189_38189340_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_189_38189340_qa_2/tests/grader.py +++ b/tasks/0038_189_38189340_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/0038_194_38194359_qa_1/tests/grader.py b/tasks/0038_194_38194359_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_194_38194359_qa_1/tests/grader.py +++ b/tasks/0038_194_38194359_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/0038_225_38225070_qa_5/tests/grader.py b/tasks/0038_225_38225070_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_225_38225070_qa_5/tests/grader.py +++ b/tasks/0038_225_38225070_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/0038_280_38280511_qa_5/tests/grader.py b/tasks/0038_280_38280511_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_280_38280511_qa_5/tests/grader.py +++ b/tasks/0038_280_38280511_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/0038_316_38316301_qa_1/tests/grader.py b/tasks/0038_316_38316301_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_316_38316301_qa_1/tests/grader.py +++ b/tasks/0038_316_38316301_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/0038_322_38322925_qa_1/tests/grader.py b/tasks/0038_322_38322925_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_322_38322925_qa_1/tests/grader.py +++ b/tasks/0038_322_38322925_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/0038_322_38322925_qa_2/tests/grader.py b/tasks/0038_322_38322925_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_322_38322925_qa_2/tests/grader.py +++ b/tasks/0038_322_38322925_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/0038_325_38325022_qa_3/tests/grader.py b/tasks/0038_325_38325022_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_325_38325022_qa_3/tests/grader.py +++ b/tasks/0038_325_38325022_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/0038_408_38408993_qa_2/tests/grader.py b/tasks/0038_408_38408993_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_408_38408993_qa_2/tests/grader.py +++ b/tasks/0038_408_38408993_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/0038_412_38412209_qa_2/tests/grader.py b/tasks/0038_412_38412209_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_412_38412209_qa_2/tests/grader.py +++ b/tasks/0038_412_38412209_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/0038_412_38412209_qa_3/tests/grader.py b/tasks/0038_412_38412209_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_412_38412209_qa_3/tests/grader.py +++ b/tasks/0038_412_38412209_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/0038_412_38412209_qa_5/tests/grader.py b/tasks/0038_412_38412209_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_412_38412209_qa_5/tests/grader.py +++ b/tasks/0038_412_38412209_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/0038_417_38417457_qa_1/tests/grader.py b/tasks/0038_417_38417457_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_417_38417457_qa_1/tests/grader.py +++ b/tasks/0038_417_38417457_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/0038_439_38439618_qa_2/tests/grader.py b/tasks/0038_439_38439618_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_439_38439618_qa_2/tests/grader.py +++ b/tasks/0038_439_38439618_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/0038_439_38439618_qa_5/tests/grader.py b/tasks/0038_439_38439618_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_439_38439618_qa_5/tests/grader.py +++ b/tasks/0038_439_38439618_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/0038_466_38466860_qa_2/tests/grader.py b/tasks/0038_466_38466860_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_466_38466860_qa_2/tests/grader.py +++ b/tasks/0038_466_38466860_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/0038_484_38484065_qa_2/tests/grader.py b/tasks/0038_484_38484065_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_484_38484065_qa_2/tests/grader.py +++ b/tasks/0038_484_38484065_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/0038_509_38509914_qa_4/tests/grader.py b/tasks/0038_509_38509914_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_509_38509914_qa_4/tests/grader.py +++ b/tasks/0038_509_38509914_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/0038_547_38547552_qa_1/tests/grader.py b/tasks/0038_547_38547552_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_547_38547552_qa_1/tests/grader.py +++ b/tasks/0038_547_38547552_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/0038_547_38547552_qa_3/tests/grader.py b/tasks/0038_547_38547552_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_547_38547552_qa_3/tests/grader.py +++ b/tasks/0038_547_38547552_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/0038_547_38547552_qa_4/tests/grader.py b/tasks/0038_547_38547552_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_547_38547552_qa_4/tests/grader.py +++ b/tasks/0038_547_38547552_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/0038_553_38553601_qa_2/tests/grader.py b/tasks/0038_553_38553601_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_553_38553601_qa_2/tests/grader.py +++ b/tasks/0038_553_38553601_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/0038_553_38553601_qa_3/tests/grader.py b/tasks/0038_553_38553601_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_553_38553601_qa_3/tests/grader.py +++ b/tasks/0038_553_38553601_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/0038_570_38570610_qa_3/tests/grader.py b/tasks/0038_570_38570610_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_570_38570610_qa_3/tests/grader.py +++ b/tasks/0038_570_38570610_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/0038_606_38606903_qa_2/tests/grader.py b/tasks/0038_606_38606903_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_606_38606903_qa_2/tests/grader.py +++ b/tasks/0038_606_38606903_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/0038_606_38606903_qa_3/tests/grader.py b/tasks/0038_606_38606903_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_606_38606903_qa_3/tests/grader.py +++ b/tasks/0038_606_38606903_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/0038_672_38672361_qa_1/tests/grader.py b/tasks/0038_672_38672361_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_672_38672361_qa_1/tests/grader.py +++ b/tasks/0038_672_38672361_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/0038_672_38672361_qa_3/tests/grader.py b/tasks/0038_672_38672361_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_672_38672361_qa_3/tests/grader.py +++ b/tasks/0038_672_38672361_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/0038_672_38672361_qa_4/tests/grader.py b/tasks/0038_672_38672361_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_672_38672361_qa_4/tests/grader.py +++ b/tasks/0038_672_38672361_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/0038_673_38673777_qa_1/tests/grader.py b/tasks/0038_673_38673777_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_673_38673777_qa_1/tests/grader.py +++ b/tasks/0038_673_38673777_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/0038_681_38681339_qa_3/tests/grader.py b/tasks/0038_681_38681339_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_681_38681339_qa_3/tests/grader.py +++ b/tasks/0038_681_38681339_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/0038_688_38688219_qa_1/tests/grader.py b/tasks/0038_688_38688219_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_688_38688219_qa_1/tests/grader.py +++ b/tasks/0038_688_38688219_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/0038_692_38692630_qa_4/tests/grader.py b/tasks/0038_692_38692630_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_692_38692630_qa_4/tests/grader.py +++ b/tasks/0038_692_38692630_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/0038_705_38705868_qa_4/tests/grader.py b/tasks/0038_705_38705868_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_705_38705868_qa_4/tests/grader.py +++ b/tasks/0038_705_38705868_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/0038_708_38708794_qa_3/tests/grader.py b/tasks/0038_708_38708794_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_708_38708794_qa_3/tests/grader.py +++ b/tasks/0038_708_38708794_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/0038_779_38779670_qa_5/tests/grader.py b/tasks/0038_779_38779670_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_779_38779670_qa_5/tests/grader.py +++ b/tasks/0038_779_38779670_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/0038_790_38790514_qa_3/tests/grader.py b/tasks/0038_790_38790514_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_790_38790514_qa_3/tests/grader.py +++ b/tasks/0038_790_38790514_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/0038_821_38821052_qa_5/tests/grader.py b/tasks/0038_821_38821052_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_821_38821052_qa_5/tests/grader.py +++ b/tasks/0038_821_38821052_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/0038_821_38821925_qa_1/tests/grader.py b/tasks/0038_821_38821925_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_821_38821925_qa_1/tests/grader.py +++ b/tasks/0038_821_38821925_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/0038_845_38845267_qa_1/tests/grader.py b/tasks/0038_845_38845267_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_845_38845267_qa_1/tests/grader.py +++ b/tasks/0038_845_38845267_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/0038_884_38884588_qa_5/tests/grader.py b/tasks/0038_884_38884588_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_884_38884588_qa_5/tests/grader.py +++ b/tasks/0038_884_38884588_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/0038_899_38899462_qa_2/tests/grader.py b/tasks/0038_899_38899462_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_899_38899462_qa_2/tests/grader.py +++ b/tasks/0038_899_38899462_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/0038_900_38900780_qa_4/tests/grader.py b/tasks/0038_900_38900780_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_900_38900780_qa_4/tests/grader.py +++ b/tasks/0038_900_38900780_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/0038_900_38900780_qa_5/tests/grader.py b/tasks/0038_900_38900780_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_900_38900780_qa_5/tests/grader.py +++ b/tasks/0038_900_38900780_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/0038_910_38910811_qa_2/tests/grader.py b/tasks/0038_910_38910811_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_910_38910811_qa_2/tests/grader.py +++ b/tasks/0038_910_38910811_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/0038_910_38910811_qa_5/tests/grader.py b/tasks/0038_910_38910811_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_910_38910811_qa_5/tests/grader.py +++ b/tasks/0038_910_38910811_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/0038_949_38949847_qa_2/tests/grader.py b/tasks/0038_949_38949847_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_949_38949847_qa_2/tests/grader.py +++ b/tasks/0038_949_38949847_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/0038_951_38951341_qa_1/tests/grader.py b/tasks/0038_951_38951341_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_951_38951341_qa_1/tests/grader.py +++ b/tasks/0038_951_38951341_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/0038_970_38970193_qa_5/tests/grader.py b/tasks/0038_970_38970193_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_970_38970193_qa_5/tests/grader.py +++ b/tasks/0038_970_38970193_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/0038_970_38970844_qa_5/tests/grader.py b/tasks/0038_970_38970844_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_970_38970844_qa_5/tests/grader.py +++ b/tasks/0038_970_38970844_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/0038_984_38984979_qa_4/tests/grader.py b/tasks/0038_984_38984979_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0038_984_38984979_qa_4/tests/grader.py +++ b/tasks/0038_984_38984979_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/0039_006_39006547_qa_4/tests/grader.py b/tasks/0039_006_39006547_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_006_39006547_qa_4/tests/grader.py +++ b/tasks/0039_006_39006547_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/0039_008_39008775_qa_5/tests/grader.py b/tasks/0039_008_39008775_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_008_39008775_qa_5/tests/grader.py +++ b/tasks/0039_008_39008775_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/0039_033_39033983_qa_3/tests/grader.py b/tasks/0039_033_39033983_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_033_39033983_qa_3/tests/grader.py +++ b/tasks/0039_033_39033983_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/0039_100_39100190_qa_5/tests/grader.py b/tasks/0039_100_39100190_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_100_39100190_qa_5/tests/grader.py +++ b/tasks/0039_100_39100190_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/0039_111_39111308_qa_1/tests/grader.py b/tasks/0039_111_39111308_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_111_39111308_qa_1/tests/grader.py +++ b/tasks/0039_111_39111308_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/0039_126_39126060_qa_2/tests/grader.py b/tasks/0039_126_39126060_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_126_39126060_qa_2/tests/grader.py +++ b/tasks/0039_126_39126060_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/0039_131_39131612_qa_1/tests/grader.py b/tasks/0039_131_39131612_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_131_39131612_qa_1/tests/grader.py +++ b/tasks/0039_131_39131612_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/0039_154_39154395_qa_2/tests/grader.py b/tasks/0039_154_39154395_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_154_39154395_qa_2/tests/grader.py +++ b/tasks/0039_154_39154395_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/0039_156_39156457_qa_3/tests/grader.py b/tasks/0039_156_39156457_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_156_39156457_qa_3/tests/grader.py +++ b/tasks/0039_156_39156457_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/0039_159_39159070_qa_2/tests/grader.py b/tasks/0039_159_39159070_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_159_39159070_qa_2/tests/grader.py +++ b/tasks/0039_159_39159070_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/0039_161_39161872_qa_5/tests/grader.py b/tasks/0039_161_39161872_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_161_39161872_qa_5/tests/grader.py +++ b/tasks/0039_161_39161872_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/0039_221_39221041_qa_2/tests/grader.py b/tasks/0039_221_39221041_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_221_39221041_qa_2/tests/grader.py +++ b/tasks/0039_221_39221041_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/0039_234_39234687_qa_1/tests/grader.py b/tasks/0039_234_39234687_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_234_39234687_qa_1/tests/grader.py +++ b/tasks/0039_234_39234687_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/0039_234_39234687_qa_2/tests/grader.py b/tasks/0039_234_39234687_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_234_39234687_qa_2/tests/grader.py +++ b/tasks/0039_234_39234687_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/0039_243_39243552_qa_4/tests/grader.py b/tasks/0039_243_39243552_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_243_39243552_qa_4/tests/grader.py +++ b/tasks/0039_243_39243552_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/0039_289_39289264_qa_1/tests/grader.py b/tasks/0039_289_39289264_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_289_39289264_qa_1/tests/grader.py +++ b/tasks/0039_289_39289264_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/0039_293_39293599_qa_4/tests/grader.py b/tasks/0039_293_39293599_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_293_39293599_qa_4/tests/grader.py +++ b/tasks/0039_293_39293599_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/0039_302_39302156_qa_3/tests/grader.py b/tasks/0039_302_39302156_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_302_39302156_qa_3/tests/grader.py +++ b/tasks/0039_302_39302156_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/0039_302_39302156_qa_5/tests/grader.py b/tasks/0039_302_39302156_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_302_39302156_qa_5/tests/grader.py +++ b/tasks/0039_302_39302156_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/0039_318_39318025_qa_4/tests/grader.py b/tasks/0039_318_39318025_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_318_39318025_qa_4/tests/grader.py +++ b/tasks/0039_318_39318025_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/0039_354_39354291_qa_1/tests/grader.py b/tasks/0039_354_39354291_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_354_39354291_qa_1/tests/grader.py +++ b/tasks/0039_354_39354291_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/0039_354_39354291_qa_3/tests/grader.py b/tasks/0039_354_39354291_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_354_39354291_qa_3/tests/grader.py +++ b/tasks/0039_354_39354291_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/0039_357_39357103_qa_3/tests/grader.py b/tasks/0039_357_39357103_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_357_39357103_qa_3/tests/grader.py +++ b/tasks/0039_357_39357103_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/0039_370_39370613_qa_3/tests/grader.py b/tasks/0039_370_39370613_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_370_39370613_qa_3/tests/grader.py +++ b/tasks/0039_370_39370613_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/0039_376_39376908_qa_1/tests/grader.py b/tasks/0039_376_39376908_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_376_39376908_qa_1/tests/grader.py +++ b/tasks/0039_376_39376908_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/0039_392_39392401_qa_1/tests/grader.py b/tasks/0039_392_39392401_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_392_39392401_qa_1/tests/grader.py +++ b/tasks/0039_392_39392401_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/0039_392_39392401_qa_3/tests/grader.py b/tasks/0039_392_39392401_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_392_39392401_qa_3/tests/grader.py +++ b/tasks/0039_392_39392401_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/0039_398_39398269_qa_1/tests/grader.py b/tasks/0039_398_39398269_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_398_39398269_qa_1/tests/grader.py +++ b/tasks/0039_398_39398269_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/0039_409_39409376_qa_2/tests/grader.py b/tasks/0039_409_39409376_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_409_39409376_qa_2/tests/grader.py +++ b/tasks/0039_409_39409376_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/0039_450_39450914_qa_1/tests/grader.py b/tasks/0039_450_39450914_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_450_39450914_qa_1/tests/grader.py +++ b/tasks/0039_450_39450914_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/0039_450_39450914_qa_3/tests/grader.py b/tasks/0039_450_39450914_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_450_39450914_qa_3/tests/grader.py +++ b/tasks/0039_450_39450914_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/0039_450_39450914_qa_4/tests/grader.py b/tasks/0039_450_39450914_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_450_39450914_qa_4/tests/grader.py +++ b/tasks/0039_450_39450914_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/0039_458_39458303_qa_5/tests/grader.py b/tasks/0039_458_39458303_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_458_39458303_qa_5/tests/grader.py +++ b/tasks/0039_458_39458303_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/0039_470_39470080_qa_2/tests/grader.py b/tasks/0039_470_39470080_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_470_39470080_qa_2/tests/grader.py +++ b/tasks/0039_470_39470080_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/0039_470_39470080_qa_3/tests/grader.py b/tasks/0039_470_39470080_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_470_39470080_qa_3/tests/grader.py +++ b/tasks/0039_470_39470080_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/0039_477_39477592_qa_5/tests/grader.py b/tasks/0039_477_39477592_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_477_39477592_qa_5/tests/grader.py +++ b/tasks/0039_477_39477592_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/0039_489_39489585_qa_1/tests/grader.py b/tasks/0039_489_39489585_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_489_39489585_qa_1/tests/grader.py +++ b/tasks/0039_489_39489585_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/0039_489_39489585_qa_2/tests/grader.py b/tasks/0039_489_39489585_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_489_39489585_qa_2/tests/grader.py +++ b/tasks/0039_489_39489585_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/0039_510_39510919_qa_3/tests/grader.py b/tasks/0039_510_39510919_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_510_39510919_qa_3/tests/grader.py +++ b/tasks/0039_510_39510919_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/0039_510_39510919_qa_4/tests/grader.py b/tasks/0039_510_39510919_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_510_39510919_qa_4/tests/grader.py +++ b/tasks/0039_510_39510919_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/0039_510_39510919_qa_5/tests/grader.py b/tasks/0039_510_39510919_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_510_39510919_qa_5/tests/grader.py +++ b/tasks/0039_510_39510919_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/0039_512_39512601_qa_2/tests/grader.py b/tasks/0039_512_39512601_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_512_39512601_qa_2/tests/grader.py +++ b/tasks/0039_512_39512601_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/0039_513_39513695_qa_3/tests/grader.py b/tasks/0039_513_39513695_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_513_39513695_qa_3/tests/grader.py +++ b/tasks/0039_513_39513695_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/0039_513_39513695_qa_4/tests/grader.py b/tasks/0039_513_39513695_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_513_39513695_qa_4/tests/grader.py +++ b/tasks/0039_513_39513695_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/0039_560_39560761_qa_1/tests/grader.py b/tasks/0039_560_39560761_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_560_39560761_qa_1/tests/grader.py +++ b/tasks/0039_560_39560761_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/0039_560_39560761_qa_3/tests/grader.py b/tasks/0039_560_39560761_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_560_39560761_qa_3/tests/grader.py +++ b/tasks/0039_560_39560761_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/0039_581_39581749_qa_4/tests/grader.py b/tasks/0039_581_39581749_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_581_39581749_qa_4/tests/grader.py +++ b/tasks/0039_581_39581749_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/0039_581_39581749_qa_5/tests/grader.py b/tasks/0039_581_39581749_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_581_39581749_qa_5/tests/grader.py +++ b/tasks/0039_581_39581749_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/0039_599_39599874_qa_1/tests/grader.py b/tasks/0039_599_39599874_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_599_39599874_qa_1/tests/grader.py +++ b/tasks/0039_599_39599874_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/0039_599_39599874_qa_4/tests/grader.py b/tasks/0039_599_39599874_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_599_39599874_qa_4/tests/grader.py +++ b/tasks/0039_599_39599874_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/0039_613_39613543_qa_3/tests/grader.py b/tasks/0039_613_39613543_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_613_39613543_qa_3/tests/grader.py +++ b/tasks/0039_613_39613543_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/0039_655_39655291_qa_2/tests/grader.py b/tasks/0039_655_39655291_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_655_39655291_qa_2/tests/grader.py +++ b/tasks/0039_655_39655291_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/0039_655_39655291_qa_4/tests/grader.py b/tasks/0039_655_39655291_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_655_39655291_qa_4/tests/grader.py +++ b/tasks/0039_655_39655291_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/0039_667_39667959_qa_5/tests/grader.py b/tasks/0039_667_39667959_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_667_39667959_qa_5/tests/grader.py +++ b/tasks/0039_667_39667959_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/0039_671_39671080_qa_2/tests/grader.py b/tasks/0039_671_39671080_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_671_39671080_qa_2/tests/grader.py +++ b/tasks/0039_671_39671080_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/0039_708_39708837_qa_1/tests/grader.py b/tasks/0039_708_39708837_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_708_39708837_qa_1/tests/grader.py +++ b/tasks/0039_708_39708837_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/0039_714_39714962_qa_1/tests/grader.py b/tasks/0039_714_39714962_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_714_39714962_qa_1/tests/grader.py +++ b/tasks/0039_714_39714962_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/0039_714_39714962_qa_2/tests/grader.py b/tasks/0039_714_39714962_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_714_39714962_qa_2/tests/grader.py +++ b/tasks/0039_714_39714962_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/0039_714_39714962_qa_3/tests/grader.py b/tasks/0039_714_39714962_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_714_39714962_qa_3/tests/grader.py +++ b/tasks/0039_714_39714962_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/0039_715_39715876_qa_1/tests/grader.py b/tasks/0039_715_39715876_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_715_39715876_qa_1/tests/grader.py +++ b/tasks/0039_715_39715876_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/0039_729_39729863_qa_2/tests/grader.py b/tasks/0039_729_39729863_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_729_39729863_qa_2/tests/grader.py +++ b/tasks/0039_729_39729863_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/0039_729_39729863_qa_4/tests/grader.py b/tasks/0039_729_39729863_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_729_39729863_qa_4/tests/grader.py +++ b/tasks/0039_729_39729863_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/0039_729_39729863_qa_5/tests/grader.py b/tasks/0039_729_39729863_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_729_39729863_qa_5/tests/grader.py +++ b/tasks/0039_729_39729863_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/0039_741_39741233_qa_5/tests/grader.py b/tasks/0039_741_39741233_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_741_39741233_qa_5/tests/grader.py +++ b/tasks/0039_741_39741233_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/0039_742_39742099_qa_4/tests/grader.py b/tasks/0039_742_39742099_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_742_39742099_qa_4/tests/grader.py +++ b/tasks/0039_742_39742099_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/0039_742_39742099_qa_5/tests/grader.py b/tasks/0039_742_39742099_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_742_39742099_qa_5/tests/grader.py +++ b/tasks/0039_742_39742099_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/0039_768_39768515_qa_1/tests/grader.py b/tasks/0039_768_39768515_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_768_39768515_qa_1/tests/grader.py +++ b/tasks/0039_768_39768515_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/0039_769_39769016_qa_3/tests/grader.py b/tasks/0039_769_39769016_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_769_39769016_qa_3/tests/grader.py +++ b/tasks/0039_769_39769016_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/0039_782_39782405_qa_2/tests/grader.py b/tasks/0039_782_39782405_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_782_39782405_qa_2/tests/grader.py +++ b/tasks/0039_782_39782405_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/0039_785_39785108_qa_1/tests/grader.py b/tasks/0039_785_39785108_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_785_39785108_qa_1/tests/grader.py +++ b/tasks/0039_785_39785108_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/0039_794_39794889_qa_1/tests/grader.py b/tasks/0039_794_39794889_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_794_39794889_qa_1/tests/grader.py +++ b/tasks/0039_794_39794889_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/0039_794_39794889_qa_3/tests/grader.py b/tasks/0039_794_39794889_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_794_39794889_qa_3/tests/grader.py +++ b/tasks/0039_794_39794889_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/0039_810_39810401_qa_1/tests/grader.py b/tasks/0039_810_39810401_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_810_39810401_qa_1/tests/grader.py +++ b/tasks/0039_810_39810401_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/0039_810_39810401_qa_2/tests/grader.py b/tasks/0039_810_39810401_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_810_39810401_qa_2/tests/grader.py +++ b/tasks/0039_810_39810401_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/0039_810_39810505_qa_1/tests/grader.py b/tasks/0039_810_39810505_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_810_39810505_qa_1/tests/grader.py +++ b/tasks/0039_810_39810505_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/0039_815_39815076_qa_3/tests/grader.py b/tasks/0039_815_39815076_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_815_39815076_qa_3/tests/grader.py +++ b/tasks/0039_815_39815076_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/0039_818_39818487_qa_1/tests/grader.py b/tasks/0039_818_39818487_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_818_39818487_qa_1/tests/grader.py +++ b/tasks/0039_818_39818487_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/0039_818_39818487_qa_3/tests/grader.py b/tasks/0039_818_39818487_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_818_39818487_qa_3/tests/grader.py +++ b/tasks/0039_818_39818487_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/0039_839_39839532_qa_1/tests/grader.py b/tasks/0039_839_39839532_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_839_39839532_qa_1/tests/grader.py +++ b/tasks/0039_839_39839532_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/0039_839_39839532_qa_2/tests/grader.py b/tasks/0039_839_39839532_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_839_39839532_qa_2/tests/grader.py +++ b/tasks/0039_839_39839532_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/0039_839_39839532_qa_5/tests/grader.py b/tasks/0039_839_39839532_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_839_39839532_qa_5/tests/grader.py +++ b/tasks/0039_839_39839532_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/0039_850_39850014_qa_2/tests/grader.py b/tasks/0039_850_39850014_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_850_39850014_qa_2/tests/grader.py +++ b/tasks/0039_850_39850014_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/0039_850_39850014_qa_3/tests/grader.py b/tasks/0039_850_39850014_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_850_39850014_qa_3/tests/grader.py +++ b/tasks/0039_850_39850014_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/0039_873_39873778_qa_5/tests/grader.py b/tasks/0039_873_39873778_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_873_39873778_qa_5/tests/grader.py +++ b/tasks/0039_873_39873778_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/0039_890_39890497_qa_1/tests/grader.py b/tasks/0039_890_39890497_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_890_39890497_qa_1/tests/grader.py +++ b/tasks/0039_890_39890497_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/0039_908_39908824_qa_4/tests/grader.py b/tasks/0039_908_39908824_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_908_39908824_qa_4/tests/grader.py +++ b/tasks/0039_908_39908824_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/0039_963_39963214_qa_3/tests/grader.py b/tasks/0039_963_39963214_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_963_39963214_qa_3/tests/grader.py +++ b/tasks/0039_963_39963214_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/0039_964_39964259_qa_2/tests/grader.py b/tasks/0039_964_39964259_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_964_39964259_qa_2/tests/grader.py +++ b/tasks/0039_964_39964259_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/0039_968_39968264_qa_1/tests/grader.py b/tasks/0039_968_39968264_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_968_39968264_qa_1/tests/grader.py +++ b/tasks/0039_968_39968264_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/0039_968_39968264_qa_3/tests/grader.py b/tasks/0039_968_39968264_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0039_968_39968264_qa_3/tests/grader.py +++ b/tasks/0039_968_39968264_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/0040_008_40008810_qa_1/tests/grader.py b/tasks/0040_008_40008810_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_008_40008810_qa_1/tests/grader.py +++ b/tasks/0040_008_40008810_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/0040_067_40067366_qa_4/tests/grader.py b/tasks/0040_067_40067366_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_067_40067366_qa_4/tests/grader.py +++ b/tasks/0040_067_40067366_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/0040_178_40178940_qa_3/tests/grader.py b/tasks/0040_178_40178940_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_178_40178940_qa_3/tests/grader.py +++ b/tasks/0040_178_40178940_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/0040_178_40178940_qa_4/tests/grader.py b/tasks/0040_178_40178940_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_178_40178940_qa_4/tests/grader.py +++ b/tasks/0040_178_40178940_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/0040_288_40288007_qa_1/tests/grader.py b/tasks/0040_288_40288007_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_288_40288007_qa_1/tests/grader.py +++ b/tasks/0040_288_40288007_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/0040_288_40288007_qa_3/tests/grader.py b/tasks/0040_288_40288007_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_288_40288007_qa_3/tests/grader.py +++ b/tasks/0040_288_40288007_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/0040_288_40288007_qa_4/tests/grader.py b/tasks/0040_288_40288007_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_288_40288007_qa_4/tests/grader.py +++ b/tasks/0040_288_40288007_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/0040_298_40298967_qa_4/tests/grader.py b/tasks/0040_298_40298967_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_298_40298967_qa_4/tests/grader.py +++ b/tasks/0040_298_40298967_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/0040_298_40298967_qa_5/tests/grader.py b/tasks/0040_298_40298967_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_298_40298967_qa_5/tests/grader.py +++ b/tasks/0040_298_40298967_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/0040_340_40340401_qa_2/tests/grader.py b/tasks/0040_340_40340401_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_340_40340401_qa_2/tests/grader.py +++ b/tasks/0040_340_40340401_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/0040_340_40340401_qa_3/tests/grader.py b/tasks/0040_340_40340401_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_340_40340401_qa_3/tests/grader.py +++ b/tasks/0040_340_40340401_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/0040_340_40340401_qa_4/tests/grader.py b/tasks/0040_340_40340401_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_340_40340401_qa_4/tests/grader.py +++ b/tasks/0040_340_40340401_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/0040_418_40418668_qa_4/tests/grader.py b/tasks/0040_418_40418668_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_418_40418668_qa_4/tests/grader.py +++ b/tasks/0040_418_40418668_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/0040_418_40418668_qa_5/tests/grader.py b/tasks/0040_418_40418668_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_418_40418668_qa_5/tests/grader.py +++ b/tasks/0040_418_40418668_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/0040_423_40423274_qa_5/tests/grader.py b/tasks/0040_423_40423274_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_423_40423274_qa_5/tests/grader.py +++ b/tasks/0040_423_40423274_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/0040_528_40528853_qa_4/tests/grader.py b/tasks/0040_528_40528853_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_528_40528853_qa_4/tests/grader.py +++ b/tasks/0040_528_40528853_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/0040_543_40543827_qa_1/tests/grader.py b/tasks/0040_543_40543827_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_543_40543827_qa_1/tests/grader.py +++ b/tasks/0040_543_40543827_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/0040_576_40576526_qa_2/tests/grader.py b/tasks/0040_576_40576526_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_576_40576526_qa_2/tests/grader.py +++ b/tasks/0040_576_40576526_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/0040_587_40587072_qa_1/tests/grader.py b/tasks/0040_587_40587072_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_587_40587072_qa_1/tests/grader.py +++ b/tasks/0040_587_40587072_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/0040_604_40604616_qa_1/tests/grader.py b/tasks/0040_604_40604616_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_604_40604616_qa_1/tests/grader.py +++ b/tasks/0040_604_40604616_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/0040_620_40620313_qa_1/tests/grader.py b/tasks/0040_620_40620313_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_620_40620313_qa_1/tests/grader.py +++ b/tasks/0040_620_40620313_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/0040_620_40620313_qa_3/tests/grader.py b/tasks/0040_620_40620313_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_620_40620313_qa_3/tests/grader.py +++ b/tasks/0040_620_40620313_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/0040_620_40620313_qa_5/tests/grader.py b/tasks/0040_620_40620313_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_620_40620313_qa_5/tests/grader.py +++ b/tasks/0040_620_40620313_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/0040_627_40627093_qa_1/tests/grader.py b/tasks/0040_627_40627093_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_627_40627093_qa_1/tests/grader.py +++ b/tasks/0040_627_40627093_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/0040_627_40627093_qa_4/tests/grader.py b/tasks/0040_627_40627093_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_627_40627093_qa_4/tests/grader.py +++ b/tasks/0040_627_40627093_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/0040_644_40644570_qa_1/tests/grader.py b/tasks/0040_644_40644570_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_644_40644570_qa_1/tests/grader.py +++ b/tasks/0040_644_40644570_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/0040_673_40673055_qa_1/tests/grader.py b/tasks/0040_673_40673055_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_673_40673055_qa_1/tests/grader.py +++ b/tasks/0040_673_40673055_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/0040_673_40673055_qa_4/tests/grader.py b/tasks/0040_673_40673055_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_673_40673055_qa_4/tests/grader.py +++ b/tasks/0040_673_40673055_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/0040_713_40713386_qa_2/tests/grader.py b/tasks/0040_713_40713386_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_713_40713386_qa_2/tests/grader.py +++ b/tasks/0040_713_40713386_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/0040_713_40713386_qa_3/tests/grader.py b/tasks/0040_713_40713386_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_713_40713386_qa_3/tests/grader.py +++ b/tasks/0040_713_40713386_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/0040_717_40717045_qa_2/tests/grader.py b/tasks/0040_717_40717045_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_717_40717045_qa_2/tests/grader.py +++ b/tasks/0040_717_40717045_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/0040_736_40736477_qa_1/tests/grader.py b/tasks/0040_736_40736477_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_736_40736477_qa_1/tests/grader.py +++ b/tasks/0040_736_40736477_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/0040_736_40736477_qa_3/tests/grader.py b/tasks/0040_736_40736477_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_736_40736477_qa_3/tests/grader.py +++ b/tasks/0040_736_40736477_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