diff --git a/tasks/0040_738_40738491_qa_1/tests/grader.py b/tasks/0040_738_40738491_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_738_40738491_qa_1/tests/grader.py +++ b/tasks/0040_738_40738491_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_738_40738491_qa_3/tests/grader.py b/tasks/0040_738_40738491_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_738_40738491_qa_3/tests/grader.py +++ b/tasks/0040_738_40738491_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_738_40738491_qa_4/tests/grader.py b/tasks/0040_738_40738491_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_738_40738491_qa_4/tests/grader.py +++ b/tasks/0040_738_40738491_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_748_40748661_qa_2/tests/grader.py b/tasks/0040_748_40748661_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_748_40748661_qa_2/tests/grader.py +++ b/tasks/0040_748_40748661_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_748_40748661_qa_3/tests/grader.py b/tasks/0040_748_40748661_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_748_40748661_qa_3/tests/grader.py +++ b/tasks/0040_748_40748661_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_748_40748661_qa_4/tests/grader.py b/tasks/0040_748_40748661_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_748_40748661_qa_4/tests/grader.py +++ b/tasks/0040_748_40748661_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_756_40756003_qa_2/tests/grader.py b/tasks/0040_756_40756003_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_756_40756003_qa_2/tests/grader.py +++ b/tasks/0040_756_40756003_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_776_40776095_qa_2/tests/grader.py b/tasks/0040_776_40776095_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_776_40776095_qa_2/tests/grader.py +++ b/tasks/0040_776_40776095_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_783_40783338_qa_3/tests/grader.py b/tasks/0040_783_40783338_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_783_40783338_qa_3/tests/grader.py +++ b/tasks/0040_783_40783338_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_785_40785152_qa_2/tests/grader.py b/tasks/0040_785_40785152_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_785_40785152_qa_2/tests/grader.py +++ b/tasks/0040_785_40785152_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_785_40785152_qa_5/tests/grader.py b/tasks/0040_785_40785152_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_785_40785152_qa_5/tests/grader.py +++ b/tasks/0040_785_40785152_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_788_40788057_qa_3/tests/grader.py b/tasks/0040_788_40788057_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_788_40788057_qa_3/tests/grader.py +++ b/tasks/0040_788_40788057_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_788_40788057_qa_5/tests/grader.py b/tasks/0040_788_40788057_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_788_40788057_qa_5/tests/grader.py +++ b/tasks/0040_788_40788057_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_788_40788908_qa_4/tests/grader.py b/tasks/0040_788_40788908_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_788_40788908_qa_4/tests/grader.py +++ b/tasks/0040_788_40788908_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_789_40789473_qa_3/tests/grader.py b/tasks/0040_789_40789473_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_789_40789473_qa_3/tests/grader.py +++ b/tasks/0040_789_40789473_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_789_40789473_qa_5/tests/grader.py b/tasks/0040_789_40789473_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_789_40789473_qa_5/tests/grader.py +++ b/tasks/0040_789_40789473_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_805_40805436_qa_1/tests/grader.py b/tasks/0040_805_40805436_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_805_40805436_qa_1/tests/grader.py +++ b/tasks/0040_805_40805436_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_808_40808132_qa_5/tests/grader.py b/tasks/0040_808_40808132_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_808_40808132_qa_5/tests/grader.py +++ b/tasks/0040_808_40808132_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_826_40826860_qa_1/tests/grader.py b/tasks/0040_826_40826860_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_826_40826860_qa_1/tests/grader.py +++ b/tasks/0040_826_40826860_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_826_40826860_qa_2/tests/grader.py b/tasks/0040_826_40826860_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_826_40826860_qa_2/tests/grader.py +++ b/tasks/0040_826_40826860_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_843_40843458_qa_3/tests/grader.py b/tasks/0040_843_40843458_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_843_40843458_qa_3/tests/grader.py +++ b/tasks/0040_843_40843458_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_843_40843458_qa_4/tests/grader.py b/tasks/0040_843_40843458_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_843_40843458_qa_4/tests/grader.py +++ b/tasks/0040_843_40843458_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_853_40853543_qa_3/tests/grader.py b/tasks/0040_853_40853543_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_853_40853543_qa_3/tests/grader.py +++ b/tasks/0040_853_40853543_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_880_40880494_qa_3/tests/grader.py b/tasks/0040_880_40880494_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_880_40880494_qa_3/tests/grader.py +++ b/tasks/0040_880_40880494_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_896_40896108_qa_3/tests/grader.py b/tasks/0040_896_40896108_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_896_40896108_qa_3/tests/grader.py +++ b/tasks/0040_896_40896108_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_916_40916847_qa_3/tests/grader.py b/tasks/0040_916_40916847_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_916_40916847_qa_3/tests/grader.py +++ b/tasks/0040_916_40916847_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_921_40921599_qa_1/tests/grader.py b/tasks/0040_921_40921599_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_921_40921599_qa_1/tests/grader.py +++ b/tasks/0040_921_40921599_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_929_40929685_qa_2/tests/grader.py b/tasks/0040_929_40929685_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_929_40929685_qa_2/tests/grader.py +++ b/tasks/0040_929_40929685_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_929_40929691_qa_1/tests/grader.py b/tasks/0040_929_40929691_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_929_40929691_qa_1/tests/grader.py +++ b/tasks/0040_929_40929691_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_930_40930969_qa_4/tests/grader.py b/tasks/0040_930_40930969_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_930_40930969_qa_4/tests/grader.py +++ b/tasks/0040_930_40930969_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_981_40981860_qa_1/tests/grader.py b/tasks/0040_981_40981860_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_981_40981860_qa_1/tests/grader.py +++ b/tasks/0040_981_40981860_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_981_40981860_qa_5/tests/grader.py b/tasks/0040_981_40981860_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_981_40981860_qa_5/tests/grader.py +++ b/tasks/0040_981_40981860_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_983_40983485_qa_1/tests/grader.py b/tasks/0040_983_40983485_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_983_40983485_qa_1/tests/grader.py +++ b/tasks/0040_983_40983485_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_983_40983485_qa_4/tests/grader.py b/tasks/0040_983_40983485_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0040_983_40983485_qa_4/tests/grader.py +++ b/tasks/0040_983_40983485_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/0041_009_41009075_qa_4/tests/grader.py b/tasks/0041_009_41009075_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_009_41009075_qa_4/tests/grader.py +++ b/tasks/0041_009_41009075_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/0041_015_41015677_qa_2/tests/grader.py b/tasks/0041_015_41015677_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_015_41015677_qa_2/tests/grader.py +++ b/tasks/0041_015_41015677_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/0041_015_41015677_qa_4/tests/grader.py b/tasks/0041_015_41015677_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_015_41015677_qa_4/tests/grader.py +++ b/tasks/0041_015_41015677_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/0041_018_41018707_qa_1/tests/grader.py b/tasks/0041_018_41018707_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_018_41018707_qa_1/tests/grader.py +++ b/tasks/0041_018_41018707_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/0041_018_41018707_qa_4/tests/grader.py b/tasks/0041_018_41018707_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_018_41018707_qa_4/tests/grader.py +++ b/tasks/0041_018_41018707_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/0041_020_41020843_qa_1/tests/grader.py b/tasks/0041_020_41020843_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_020_41020843_qa_1/tests/grader.py +++ b/tasks/0041_020_41020843_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/0041_020_41020843_qa_4/tests/grader.py b/tasks/0041_020_41020843_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_020_41020843_qa_4/tests/grader.py +++ b/tasks/0041_020_41020843_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/0041_034_41034683_qa_2/tests/grader.py b/tasks/0041_034_41034683_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_034_41034683_qa_2/tests/grader.py +++ b/tasks/0041_034_41034683_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/0041_035_41035825_qa_1/tests/grader.py b/tasks/0041_035_41035825_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_035_41035825_qa_1/tests/grader.py +++ b/tasks/0041_035_41035825_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/0041_074_41074160_qa_1/tests/grader.py b/tasks/0041_074_41074160_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_074_41074160_qa_1/tests/grader.py +++ b/tasks/0041_074_41074160_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/0041_084_41084912_qa_1/tests/grader.py b/tasks/0041_084_41084912_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_084_41084912_qa_1/tests/grader.py +++ b/tasks/0041_084_41084912_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/0041_143_41143507_qa_1/tests/grader.py b/tasks/0041_143_41143507_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_143_41143507_qa_1/tests/grader.py +++ b/tasks/0041_143_41143507_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/0041_145_41145764_qa_1/tests/grader.py b/tasks/0041_145_41145764_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_145_41145764_qa_1/tests/grader.py +++ b/tasks/0041_145_41145764_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/0041_145_41145764_qa_2/tests/grader.py b/tasks/0041_145_41145764_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_145_41145764_qa_2/tests/grader.py +++ b/tasks/0041_145_41145764_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/0041_156_41156002_qa_2/tests/grader.py b/tasks/0041_156_41156002_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_156_41156002_qa_2/tests/grader.py +++ b/tasks/0041_156_41156002_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/0041_156_41156002_qa_4/tests/grader.py b/tasks/0041_156_41156002_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_156_41156002_qa_4/tests/grader.py +++ b/tasks/0041_156_41156002_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/0041_159_41159247_qa_2/tests/grader.py b/tasks/0041_159_41159247_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_159_41159247_qa_2/tests/grader.py +++ b/tasks/0041_159_41159247_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/0041_172_41172395_qa_3/tests/grader.py b/tasks/0041_172_41172395_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_172_41172395_qa_3/tests/grader.py +++ b/tasks/0041_172_41172395_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/0041_186_41186066_qa_2/tests/grader.py b/tasks/0041_186_41186066_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_186_41186066_qa_2/tests/grader.py +++ b/tasks/0041_186_41186066_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/0041_193_41193082_qa_3/tests/grader.py b/tasks/0041_193_41193082_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_193_41193082_qa_3/tests/grader.py +++ b/tasks/0041_193_41193082_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/0041_193_41193541_qa_5/tests/grader.py b/tasks/0041_193_41193541_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_193_41193541_qa_5/tests/grader.py +++ b/tasks/0041_193_41193541_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/0041_198_41198482_qa_1/tests/grader.py b/tasks/0041_198_41198482_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_198_41198482_qa_1/tests/grader.py +++ b/tasks/0041_198_41198482_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/0041_214_41214331_qa_1/tests/grader.py b/tasks/0041_214_41214331_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_214_41214331_qa_1/tests/grader.py +++ b/tasks/0041_214_41214331_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/0041_214_41214331_qa_5/tests/grader.py b/tasks/0041_214_41214331_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_214_41214331_qa_5/tests/grader.py +++ b/tasks/0041_214_41214331_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/0041_216_41216352_qa_1/tests/grader.py b/tasks/0041_216_41216352_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_216_41216352_qa_1/tests/grader.py +++ b/tasks/0041_216_41216352_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/0041_216_41216352_qa_3/tests/grader.py b/tasks/0041_216_41216352_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_216_41216352_qa_3/tests/grader.py +++ b/tasks/0041_216_41216352_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/0041_236_41236083_qa_5/tests/grader.py b/tasks/0041_236_41236083_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_236_41236083_qa_5/tests/grader.py +++ b/tasks/0041_236_41236083_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/0041_236_41236723_qa_3/tests/grader.py b/tasks/0041_236_41236723_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_236_41236723_qa_3/tests/grader.py +++ b/tasks/0041_236_41236723_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/0041_243_41243008_qa_1/tests/grader.py b/tasks/0041_243_41243008_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_243_41243008_qa_1/tests/grader.py +++ b/tasks/0041_243_41243008_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/0041_243_41243008_qa_3/tests/grader.py b/tasks/0041_243_41243008_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_243_41243008_qa_3/tests/grader.py +++ b/tasks/0041_243_41243008_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/0041_253_41253749_qa_5/tests/grader.py b/tasks/0041_253_41253749_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_253_41253749_qa_5/tests/grader.py +++ b/tasks/0041_253_41253749_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/0041_258_41258552_qa_1/tests/grader.py b/tasks/0041_258_41258552_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_258_41258552_qa_1/tests/grader.py +++ b/tasks/0041_258_41258552_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/0041_261_41261699_qa_2/tests/grader.py b/tasks/0041_261_41261699_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_261_41261699_qa_2/tests/grader.py +++ b/tasks/0041_261_41261699_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/0041_268_41268576_qa_1/tests/grader.py b/tasks/0041_268_41268576_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_268_41268576_qa_1/tests/grader.py +++ b/tasks/0041_268_41268576_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/0041_314_41314150_qa_1/tests/grader.py b/tasks/0041_314_41314150_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_314_41314150_qa_1/tests/grader.py +++ b/tasks/0041_314_41314150_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/0041_321_41321221_qa_2/tests/grader.py b/tasks/0041_321_41321221_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_321_41321221_qa_2/tests/grader.py +++ b/tasks/0041_321_41321221_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/0041_321_41321221_qa_3/tests/grader.py b/tasks/0041_321_41321221_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_321_41321221_qa_3/tests/grader.py +++ b/tasks/0041_321_41321221_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/0041_321_41321221_qa_4/tests/grader.py b/tasks/0041_321_41321221_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_321_41321221_qa_4/tests/grader.py +++ b/tasks/0041_321_41321221_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/0041_323_41323136_qa_2/tests/grader.py b/tasks/0041_323_41323136_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_323_41323136_qa_2/tests/grader.py +++ b/tasks/0041_323_41323136_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/0041_323_41323136_qa_3/tests/grader.py b/tasks/0041_323_41323136_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_323_41323136_qa_3/tests/grader.py +++ b/tasks/0041_323_41323136_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/0041_324_41324781_qa_2/tests/grader.py b/tasks/0041_324_41324781_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_324_41324781_qa_2/tests/grader.py +++ b/tasks/0041_324_41324781_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/0041_421_41421779_qa_5/tests/grader.py b/tasks/0041_421_41421779_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_421_41421779_qa_5/tests/grader.py +++ b/tasks/0041_421_41421779_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/0041_451_41451584_qa_1/tests/grader.py b/tasks/0041_451_41451584_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_451_41451584_qa_1/tests/grader.py +++ b/tasks/0041_451_41451584_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/0041_451_41451584_qa_5/tests/grader.py b/tasks/0041_451_41451584_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_451_41451584_qa_5/tests/grader.py +++ b/tasks/0041_451_41451584_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/0041_463_41463553_qa_2/tests/grader.py b/tasks/0041_463_41463553_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_463_41463553_qa_2/tests/grader.py +++ b/tasks/0041_463_41463553_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/0041_501_41501839_qa_5/tests/grader.py b/tasks/0041_501_41501839_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_501_41501839_qa_5/tests/grader.py +++ b/tasks/0041_501_41501839_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/0041_513_41513812_qa_3/tests/grader.py b/tasks/0041_513_41513812_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_513_41513812_qa_3/tests/grader.py +++ b/tasks/0041_513_41513812_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/0041_556_41556433_qa_1/tests/grader.py b/tasks/0041_556_41556433_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_556_41556433_qa_1/tests/grader.py +++ b/tasks/0041_556_41556433_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/0041_560_41560306_qa_2/tests/grader.py b/tasks/0041_560_41560306_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_560_41560306_qa_2/tests/grader.py +++ b/tasks/0041_560_41560306_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/0041_560_41560306_qa_4/tests/grader.py b/tasks/0041_560_41560306_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_560_41560306_qa_4/tests/grader.py +++ b/tasks/0041_560_41560306_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/0041_571_41571567_qa_1/tests/grader.py b/tasks/0041_571_41571567_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_571_41571567_qa_1/tests/grader.py +++ b/tasks/0041_571_41571567_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/0041_571_41571567_qa_4/tests/grader.py b/tasks/0041_571_41571567_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_571_41571567_qa_4/tests/grader.py +++ b/tasks/0041_571_41571567_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/0041_600_41600293_qa_1/tests/grader.py b/tasks/0041_600_41600293_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_600_41600293_qa_1/tests/grader.py +++ b/tasks/0041_600_41600293_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/0041_600_41600293_qa_2/tests/grader.py b/tasks/0041_600_41600293_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_600_41600293_qa_2/tests/grader.py +++ b/tasks/0041_600_41600293_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/0041_600_41600293_qa_3/tests/grader.py b/tasks/0041_600_41600293_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_600_41600293_qa_3/tests/grader.py +++ b/tasks/0041_600_41600293_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/0041_604_41604680_qa_3/tests/grader.py b/tasks/0041_604_41604680_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_604_41604680_qa_3/tests/grader.py +++ b/tasks/0041_604_41604680_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/0041_604_41604680_qa_5/tests/grader.py b/tasks/0041_604_41604680_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_604_41604680_qa_5/tests/grader.py +++ b/tasks/0041_604_41604680_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/0041_604_41604696_qa_3/tests/grader.py b/tasks/0041_604_41604696_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_604_41604696_qa_3/tests/grader.py +++ b/tasks/0041_604_41604696_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/0041_652_41652253_qa_1/tests/grader.py b/tasks/0041_652_41652253_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_652_41652253_qa_1/tests/grader.py +++ b/tasks/0041_652_41652253_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/0041_658_41658396_qa_4/tests/grader.py b/tasks/0041_658_41658396_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_658_41658396_qa_4/tests/grader.py +++ b/tasks/0041_658_41658396_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/0041_703_41703265_qa_4/tests/grader.py b/tasks/0041_703_41703265_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_703_41703265_qa_4/tests/grader.py +++ b/tasks/0041_703_41703265_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/0041_703_41703265_qa_5/tests/grader.py b/tasks/0041_703_41703265_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_703_41703265_qa_5/tests/grader.py +++ b/tasks/0041_703_41703265_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/0041_708_41708867_qa_2/tests/grader.py b/tasks/0041_708_41708867_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_708_41708867_qa_2/tests/grader.py +++ b/tasks/0041_708_41708867_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/0041_708_41708867_qa_3/tests/grader.py b/tasks/0041_708_41708867_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_708_41708867_qa_3/tests/grader.py +++ b/tasks/0041_708_41708867_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/0041_712_41712543_qa_1/tests/grader.py b/tasks/0041_712_41712543_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_712_41712543_qa_1/tests/grader.py +++ b/tasks/0041_712_41712543_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/0041_712_41712543_qa_2/tests/grader.py b/tasks/0041_712_41712543_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_712_41712543_qa_2/tests/grader.py +++ b/tasks/0041_712_41712543_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/0041_714_41714800_qa_3/tests/grader.py b/tasks/0041_714_41714800_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_714_41714800_qa_3/tests/grader.py +++ b/tasks/0041_714_41714800_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/0041_758_41758573_qa_1/tests/grader.py b/tasks/0041_758_41758573_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_758_41758573_qa_1/tests/grader.py +++ b/tasks/0041_758_41758573_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/0041_758_41758573_qa_4/tests/grader.py b/tasks/0041_758_41758573_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_758_41758573_qa_4/tests/grader.py +++ b/tasks/0041_758_41758573_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/0041_818_41818748_qa_3/tests/grader.py b/tasks/0041_818_41818748_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_818_41818748_qa_3/tests/grader.py +++ b/tasks/0041_818_41818748_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/0041_818_41818748_qa_5/tests/grader.py b/tasks/0041_818_41818748_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_818_41818748_qa_5/tests/grader.py +++ b/tasks/0041_818_41818748_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/0041_838_41838462_qa_1/tests/grader.py b/tasks/0041_838_41838462_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_838_41838462_qa_1/tests/grader.py +++ b/tasks/0041_838_41838462_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/0041_888_41888820_qa_1/tests/grader.py b/tasks/0041_888_41888820_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_888_41888820_qa_1/tests/grader.py +++ b/tasks/0041_888_41888820_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/0041_888_41888820_qa_2/tests/grader.py b/tasks/0041_888_41888820_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_888_41888820_qa_2/tests/grader.py +++ b/tasks/0041_888_41888820_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/0041_914_41914023_qa_3/tests/grader.py b/tasks/0041_914_41914023_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_914_41914023_qa_3/tests/grader.py +++ b/tasks/0041_914_41914023_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/0041_914_41914023_qa_5/tests/grader.py b/tasks/0041_914_41914023_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_914_41914023_qa_5/tests/grader.py +++ b/tasks/0041_914_41914023_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/0041_998_41998385_qa_2/tests/grader.py b/tasks/0041_998_41998385_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0041_998_41998385_qa_2/tests/grader.py +++ b/tasks/0041_998_41998385_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/0042_049_42049242_qa_1/tests/grader.py b/tasks/0042_049_42049242_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_049_42049242_qa_1/tests/grader.py +++ b/tasks/0042_049_42049242_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/0042_102_42102863_qa_1/tests/grader.py b/tasks/0042_102_42102863_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_102_42102863_qa_1/tests/grader.py +++ b/tasks/0042_102_42102863_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/0042_102_42102863_qa_4/tests/grader.py b/tasks/0042_102_42102863_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_102_42102863_qa_4/tests/grader.py +++ b/tasks/0042_102_42102863_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/0042_106_42106983_qa_5/tests/grader.py b/tasks/0042_106_42106983_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_106_42106983_qa_5/tests/grader.py +++ b/tasks/0042_106_42106983_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/0042_124_42124908_qa_1/tests/grader.py b/tasks/0042_124_42124908_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_124_42124908_qa_1/tests/grader.py +++ b/tasks/0042_124_42124908_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/0042_124_42124908_qa_3/tests/grader.py b/tasks/0042_124_42124908_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_124_42124908_qa_3/tests/grader.py +++ b/tasks/0042_124_42124908_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/0042_139_42139358_qa_2/tests/grader.py b/tasks/0042_139_42139358_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_139_42139358_qa_2/tests/grader.py +++ b/tasks/0042_139_42139358_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/0042_170_42170738_qa_2/tests/grader.py b/tasks/0042_170_42170738_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_170_42170738_qa_2/tests/grader.py +++ b/tasks/0042_170_42170738_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/0042_170_42170738_qa_4/tests/grader.py b/tasks/0042_170_42170738_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_170_42170738_qa_4/tests/grader.py +++ b/tasks/0042_170_42170738_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/0042_372_42372757_qa_1/tests/grader.py b/tasks/0042_372_42372757_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_372_42372757_qa_1/tests/grader.py +++ b/tasks/0042_372_42372757_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/0042_372_42372757_qa_5/tests/grader.py b/tasks/0042_372_42372757_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_372_42372757_qa_5/tests/grader.py +++ b/tasks/0042_372_42372757_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/0042_378_42378330_qa_5/tests/grader.py b/tasks/0042_378_42378330_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_378_42378330_qa_5/tests/grader.py +++ b/tasks/0042_378_42378330_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/0042_383_42383310_qa_2/tests/grader.py b/tasks/0042_383_42383310_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_383_42383310_qa_2/tests/grader.py +++ b/tasks/0042_383_42383310_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/0042_384_42384112_qa_4/tests/grader.py b/tasks/0042_384_42384112_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_384_42384112_qa_4/tests/grader.py +++ b/tasks/0042_384_42384112_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/0042_414_42414264_qa_2/tests/grader.py b/tasks/0042_414_42414264_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_414_42414264_qa_2/tests/grader.py +++ b/tasks/0042_414_42414264_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/0042_446_42446239_qa_1/tests/grader.py b/tasks/0042_446_42446239_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_446_42446239_qa_1/tests/grader.py +++ b/tasks/0042_446_42446239_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/0042_446_42446776_qa_4/tests/grader.py b/tasks/0042_446_42446776_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_446_42446776_qa_4/tests/grader.py +++ b/tasks/0042_446_42446776_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/0042_446_42446776_qa_5/tests/grader.py b/tasks/0042_446_42446776_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_446_42446776_qa_5/tests/grader.py +++ b/tasks/0042_446_42446776_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/0042_455_42455252_qa_1/tests/grader.py b/tasks/0042_455_42455252_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_455_42455252_qa_1/tests/grader.py +++ b/tasks/0042_455_42455252_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/0042_455_42455252_qa_2/tests/grader.py b/tasks/0042_455_42455252_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_455_42455252_qa_2/tests/grader.py +++ b/tasks/0042_455_42455252_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/0042_480_42480581_qa_3/tests/grader.py b/tasks/0042_480_42480581_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_480_42480581_qa_3/tests/grader.py +++ b/tasks/0042_480_42480581_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/0042_485_42485813_qa_5/tests/grader.py b/tasks/0042_485_42485813_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_485_42485813_qa_5/tests/grader.py +++ b/tasks/0042_485_42485813_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/0042_488_42488023_qa_2/tests/grader.py b/tasks/0042_488_42488023_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_488_42488023_qa_2/tests/grader.py +++ b/tasks/0042_488_42488023_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/0042_488_42488023_qa_4/tests/grader.py b/tasks/0042_488_42488023_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_488_42488023_qa_4/tests/grader.py +++ b/tasks/0042_488_42488023_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/0042_488_42488426_qa_1/tests/grader.py b/tasks/0042_488_42488426_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_488_42488426_qa_1/tests/grader.py +++ b/tasks/0042_488_42488426_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/0042_488_42488426_qa_2/tests/grader.py b/tasks/0042_488_42488426_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_488_42488426_qa_2/tests/grader.py +++ b/tasks/0042_488_42488426_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/0042_488_42488426_qa_3/tests/grader.py b/tasks/0042_488_42488426_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_488_42488426_qa_3/tests/grader.py +++ b/tasks/0042_488_42488426_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/0042_492_42492005_qa_3/tests/grader.py b/tasks/0042_492_42492005_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_492_42492005_qa_3/tests/grader.py +++ b/tasks/0042_492_42492005_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/0042_501_42501868_qa_1/tests/grader.py b/tasks/0042_501_42501868_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_501_42501868_qa_1/tests/grader.py +++ b/tasks/0042_501_42501868_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/0042_501_42501868_qa_2/tests/grader.py b/tasks/0042_501_42501868_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_501_42501868_qa_2/tests/grader.py +++ b/tasks/0042_501_42501868_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/0042_503_42503346_qa_4/tests/grader.py b/tasks/0042_503_42503346_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_503_42503346_qa_4/tests/grader.py +++ b/tasks/0042_503_42503346_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/0042_528_42528802_qa_3/tests/grader.py b/tasks/0042_528_42528802_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_528_42528802_qa_3/tests/grader.py +++ b/tasks/0042_528_42528802_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/0042_569_42569940_qa_1/tests/grader.py b/tasks/0042_569_42569940_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_569_42569940_qa_1/tests/grader.py +++ b/tasks/0042_569_42569940_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/0042_590_42590102_qa_4/tests/grader.py b/tasks/0042_590_42590102_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_590_42590102_qa_4/tests/grader.py +++ b/tasks/0042_590_42590102_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/0042_635_42635249_qa_3/tests/grader.py b/tasks/0042_635_42635249_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_635_42635249_qa_3/tests/grader.py +++ b/tasks/0042_635_42635249_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/0042_642_42642764_qa_2/tests/grader.py b/tasks/0042_642_42642764_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_642_42642764_qa_2/tests/grader.py +++ b/tasks/0042_642_42642764_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/0042_642_42642764_qa_3/tests/grader.py b/tasks/0042_642_42642764_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_642_42642764_qa_3/tests/grader.py +++ b/tasks/0042_642_42642764_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/0042_644_42644185_qa_2/tests/grader.py b/tasks/0042_644_42644185_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_644_42644185_qa_2/tests/grader.py +++ b/tasks/0042_644_42644185_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/0042_684_42684548_qa_4/tests/grader.py b/tasks/0042_684_42684548_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_684_42684548_qa_4/tests/grader.py +++ b/tasks/0042_684_42684548_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/0042_738_42738840_qa_1/tests/grader.py b/tasks/0042_738_42738840_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_738_42738840_qa_1/tests/grader.py +++ b/tasks/0042_738_42738840_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/0042_738_42738840_qa_2/tests/grader.py b/tasks/0042_738_42738840_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_738_42738840_qa_2/tests/grader.py +++ b/tasks/0042_738_42738840_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/0042_750_42750016_qa_1/tests/grader.py b/tasks/0042_750_42750016_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_750_42750016_qa_1/tests/grader.py +++ b/tasks/0042_750_42750016_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/0042_773_42773926_qa_2/tests/grader.py b/tasks/0042_773_42773926_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_773_42773926_qa_2/tests/grader.py +++ b/tasks/0042_773_42773926_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/0042_773_42773926_qa_3/tests/grader.py b/tasks/0042_773_42773926_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_773_42773926_qa_3/tests/grader.py +++ b/tasks/0042_773_42773926_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/0042_806_42806362_qa_1/tests/grader.py b/tasks/0042_806_42806362_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_806_42806362_qa_1/tests/grader.py +++ b/tasks/0042_806_42806362_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/0042_836_42836971_qa_3/tests/grader.py b/tasks/0042_836_42836971_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_836_42836971_qa_3/tests/grader.py +++ b/tasks/0042_836_42836971_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/0042_857_42857956_qa_5/tests/grader.py b/tasks/0042_857_42857956_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_857_42857956_qa_5/tests/grader.py +++ b/tasks/0042_857_42857956_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/0042_902_42902013_qa_3/tests/grader.py b/tasks/0042_902_42902013_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_902_42902013_qa_3/tests/grader.py +++ b/tasks/0042_902_42902013_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/0042_903_42903883_qa_1/tests/grader.py b/tasks/0042_903_42903883_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_903_42903883_qa_1/tests/grader.py +++ b/tasks/0042_903_42903883_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/0042_911_42911036_qa_1/tests/grader.py b/tasks/0042_911_42911036_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_911_42911036_qa_1/tests/grader.py +++ b/tasks/0042_911_42911036_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/0042_911_42911036_qa_2/tests/grader.py b/tasks/0042_911_42911036_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_911_42911036_qa_2/tests/grader.py +++ b/tasks/0042_911_42911036_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/0042_917_42917087_qa_1/tests/grader.py b/tasks/0042_917_42917087_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_917_42917087_qa_1/tests/grader.py +++ b/tasks/0042_917_42917087_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/0042_928_42928888_qa_1/tests/grader.py b/tasks/0042_928_42928888_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_928_42928888_qa_1/tests/grader.py +++ b/tasks/0042_928_42928888_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/0042_941_42941100_qa_2/tests/grader.py b/tasks/0042_941_42941100_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_941_42941100_qa_2/tests/grader.py +++ b/tasks/0042_941_42941100_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/0042_973_42973076_qa_1/tests/grader.py b/tasks/0042_973_42973076_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_973_42973076_qa_1/tests/grader.py +++ b/tasks/0042_973_42973076_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/0042_973_42973076_qa_4/tests/grader.py b/tasks/0042_973_42973076_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_973_42973076_qa_4/tests/grader.py +++ b/tasks/0042_973_42973076_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/0042_973_42973076_qa_5/tests/grader.py b/tasks/0042_973_42973076_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_973_42973076_qa_5/tests/grader.py +++ b/tasks/0042_973_42973076_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/0042_991_42991381_qa_5/tests/grader.py b/tasks/0042_991_42991381_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_991_42991381_qa_5/tests/grader.py +++ b/tasks/0042_991_42991381_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/0042_993_42993650_qa_1/tests/grader.py b/tasks/0042_993_42993650_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0042_993_42993650_qa_1/tests/grader.py +++ b/tasks/0042_993_42993650_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/0043_029_43029106_qa_1/tests/grader.py b/tasks/0043_029_43029106_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_029_43029106_qa_1/tests/grader.py +++ b/tasks/0043_029_43029106_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/0043_032_43032812_qa_4/tests/grader.py b/tasks/0043_032_43032812_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_032_43032812_qa_4/tests/grader.py +++ b/tasks/0043_032_43032812_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/0043_043_43043497_qa_2/tests/grader.py b/tasks/0043_043_43043497_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_043_43043497_qa_2/tests/grader.py +++ b/tasks/0043_043_43043497_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/0043_069_43069626_qa_1/tests/grader.py b/tasks/0043_069_43069626_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_069_43069626_qa_1/tests/grader.py +++ b/tasks/0043_069_43069626_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/0043_069_43069626_qa_4/tests/grader.py b/tasks/0043_069_43069626_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_069_43069626_qa_4/tests/grader.py +++ b/tasks/0043_069_43069626_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/0043_124_43124508_qa_1/tests/grader.py b/tasks/0043_124_43124508_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_124_43124508_qa_1/tests/grader.py +++ b/tasks/0043_124_43124508_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/0043_124_43124508_qa_2/tests/grader.py b/tasks/0043_124_43124508_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_124_43124508_qa_2/tests/grader.py +++ b/tasks/0043_124_43124508_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/0043_124_43124508_qa_3/tests/grader.py b/tasks/0043_124_43124508_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_124_43124508_qa_3/tests/grader.py +++ b/tasks/0043_124_43124508_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/0043_124_43124508_qa_4/tests/grader.py b/tasks/0043_124_43124508_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_124_43124508_qa_4/tests/grader.py +++ b/tasks/0043_124_43124508_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/0043_303_43303678_qa_3/tests/grader.py b/tasks/0043_303_43303678_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_303_43303678_qa_3/tests/grader.py +++ b/tasks/0043_303_43303678_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/0043_305_43305320_qa_2/tests/grader.py b/tasks/0043_305_43305320_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_305_43305320_qa_2/tests/grader.py +++ b/tasks/0043_305_43305320_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/0043_305_43305320_qa_4/tests/grader.py b/tasks/0043_305_43305320_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_305_43305320_qa_4/tests/grader.py +++ b/tasks/0043_305_43305320_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/0043_309_43309435_qa_3/tests/grader.py b/tasks/0043_309_43309435_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_309_43309435_qa_3/tests/grader.py +++ b/tasks/0043_309_43309435_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/0043_309_43309435_qa_5/tests/grader.py b/tasks/0043_309_43309435_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_309_43309435_qa_5/tests/grader.py +++ b/tasks/0043_309_43309435_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/0043_313_43313326_qa_1/tests/grader.py b/tasks/0043_313_43313326_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_313_43313326_qa_1/tests/grader.py +++ b/tasks/0043_313_43313326_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/0043_313_43313326_qa_2/tests/grader.py b/tasks/0043_313_43313326_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_313_43313326_qa_2/tests/grader.py +++ b/tasks/0043_313_43313326_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/0043_313_43313326_qa_5/tests/grader.py b/tasks/0043_313_43313326_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_313_43313326_qa_5/tests/grader.py +++ b/tasks/0043_313_43313326_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/0043_338_43338909_qa_1/tests/grader.py b/tasks/0043_338_43338909_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_338_43338909_qa_1/tests/grader.py +++ b/tasks/0043_338_43338909_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/0043_338_43338909_qa_3/tests/grader.py b/tasks/0043_338_43338909_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_338_43338909_qa_3/tests/grader.py +++ b/tasks/0043_338_43338909_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/0043_348_43348851_qa_1/tests/grader.py b/tasks/0043_348_43348851_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_348_43348851_qa_1/tests/grader.py +++ b/tasks/0043_348_43348851_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/0043_373_43373918_qa_4/tests/grader.py b/tasks/0043_373_43373918_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_373_43373918_qa_4/tests/grader.py +++ b/tasks/0043_373_43373918_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/0043_374_43374447_qa_2/tests/grader.py b/tasks/0043_374_43374447_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_374_43374447_qa_2/tests/grader.py +++ b/tasks/0043_374_43374447_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/0043_376_43376696_qa_2/tests/grader.py b/tasks/0043_376_43376696_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_376_43376696_qa_2/tests/grader.py +++ b/tasks/0043_376_43376696_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/0043_419_43419580_qa_1/tests/grader.py b/tasks/0043_419_43419580_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_419_43419580_qa_1/tests/grader.py +++ b/tasks/0043_419_43419580_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/0043_419_43419580_qa_2/tests/grader.py b/tasks/0043_419_43419580_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_419_43419580_qa_2/tests/grader.py +++ b/tasks/0043_419_43419580_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/0043_437_43437842_qa_3/tests/grader.py b/tasks/0043_437_43437842_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_437_43437842_qa_3/tests/grader.py +++ b/tasks/0043_437_43437842_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/0043_510_43510597_qa_3/tests/grader.py b/tasks/0043_510_43510597_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_510_43510597_qa_3/tests/grader.py +++ b/tasks/0043_510_43510597_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/0043_512_43512047_qa_1/tests/grader.py b/tasks/0043_512_43512047_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_512_43512047_qa_1/tests/grader.py +++ b/tasks/0043_512_43512047_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/0043_512_43512681_qa_2/tests/grader.py b/tasks/0043_512_43512681_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_512_43512681_qa_2/tests/grader.py +++ b/tasks/0043_512_43512681_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/0043_512_43512681_qa_5/tests/grader.py b/tasks/0043_512_43512681_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_512_43512681_qa_5/tests/grader.py +++ b/tasks/0043_512_43512681_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/0043_524_43524264_qa_1/tests/grader.py b/tasks/0043_524_43524264_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_524_43524264_qa_1/tests/grader.py +++ b/tasks/0043_524_43524264_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/0043_528_43528813_qa_2/tests/grader.py b/tasks/0043_528_43528813_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_528_43528813_qa_2/tests/grader.py +++ b/tasks/0043_528_43528813_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/0043_544_43544384_qa_2/tests/grader.py b/tasks/0043_544_43544384_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_544_43544384_qa_2/tests/grader.py +++ b/tasks/0043_544_43544384_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/0043_544_43544384_qa_4/tests/grader.py b/tasks/0043_544_43544384_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_544_43544384_qa_4/tests/grader.py +++ b/tasks/0043_544_43544384_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/0043_551_43551294_qa_3/tests/grader.py b/tasks/0043_551_43551294_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_551_43551294_qa_3/tests/grader.py +++ b/tasks/0043_551_43551294_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/0043_591_43591690_qa_2/tests/grader.py b/tasks/0043_591_43591690_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_591_43591690_qa_2/tests/grader.py +++ b/tasks/0043_591_43591690_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/0043_591_43591690_qa_3/tests/grader.py b/tasks/0043_591_43591690_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_591_43591690_qa_3/tests/grader.py +++ b/tasks/0043_591_43591690_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/0043_591_43591690_qa_5/tests/grader.py b/tasks/0043_591_43591690_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_591_43591690_qa_5/tests/grader.py +++ b/tasks/0043_591_43591690_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/0043_639_43639268_qa_1/tests/grader.py b/tasks/0043_639_43639268_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_639_43639268_qa_1/tests/grader.py +++ b/tasks/0043_639_43639268_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/0043_642_43642810_qa_1/tests/grader.py b/tasks/0043_642_43642810_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_642_43642810_qa_1/tests/grader.py +++ b/tasks/0043_642_43642810_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/0043_644_43644485_qa_5/tests/grader.py b/tasks/0043_644_43644485_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_644_43644485_qa_5/tests/grader.py +++ b/tasks/0043_644_43644485_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/0043_694_43694920_qa_1/tests/grader.py b/tasks/0043_694_43694920_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_694_43694920_qa_1/tests/grader.py +++ b/tasks/0043_694_43694920_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/0043_694_43694920_qa_5/tests/grader.py b/tasks/0043_694_43694920_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_694_43694920_qa_5/tests/grader.py +++ b/tasks/0043_694_43694920_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/0043_720_43720895_qa_2/tests/grader.py b/tasks/0043_720_43720895_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_720_43720895_qa_2/tests/grader.py +++ b/tasks/0043_720_43720895_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/0043_759_43759429_qa_1/tests/grader.py b/tasks/0043_759_43759429_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_759_43759429_qa_1/tests/grader.py +++ b/tasks/0043_759_43759429_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/0043_773_43773059_qa_2/tests/grader.py b/tasks/0043_773_43773059_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_773_43773059_qa_2/tests/grader.py +++ b/tasks/0043_773_43773059_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/0043_773_43773059_qa_4/tests/grader.py b/tasks/0043_773_43773059_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_773_43773059_qa_4/tests/grader.py +++ b/tasks/0043_773_43773059_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/0043_774_43774308_qa_1/tests/grader.py b/tasks/0043_774_43774308_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_774_43774308_qa_1/tests/grader.py +++ b/tasks/0043_774_43774308_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/0043_783_43783786_qa_2/tests/grader.py b/tasks/0043_783_43783786_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_783_43783786_qa_2/tests/grader.py +++ b/tasks/0043_783_43783786_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/0043_783_43783786_qa_3/tests/grader.py b/tasks/0043_783_43783786_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_783_43783786_qa_3/tests/grader.py +++ b/tasks/0043_783_43783786_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/0043_826_43826331_qa_2/tests/grader.py b/tasks/0043_826_43826331_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_826_43826331_qa_2/tests/grader.py +++ b/tasks/0043_826_43826331_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/0043_829_43829102_qa_2/tests/grader.py b/tasks/0043_829_43829102_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_829_43829102_qa_2/tests/grader.py +++ b/tasks/0043_829_43829102_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/0043_829_43829102_qa_5/tests/grader.py b/tasks/0043_829_43829102_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_829_43829102_qa_5/tests/grader.py +++ b/tasks/0043_829_43829102_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/0043_869_43869885_qa_5/tests/grader.py b/tasks/0043_869_43869885_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_869_43869885_qa_5/tests/grader.py +++ b/tasks/0043_869_43869885_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/0043_889_43889204_qa_5/tests/grader.py b/tasks/0043_889_43889204_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_889_43889204_qa_5/tests/grader.py +++ b/tasks/0043_889_43889204_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/0043_936_43936231_qa_1/tests/grader.py b/tasks/0043_936_43936231_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_936_43936231_qa_1/tests/grader.py +++ b/tasks/0043_936_43936231_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/0043_936_43936231_qa_2/tests/grader.py b/tasks/0043_936_43936231_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_936_43936231_qa_2/tests/grader.py +++ b/tasks/0043_936_43936231_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/0043_936_43936231_qa_3/tests/grader.py b/tasks/0043_936_43936231_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_936_43936231_qa_3/tests/grader.py +++ b/tasks/0043_936_43936231_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/0043_969_43969595_qa_4/tests/grader.py b/tasks/0043_969_43969595_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_969_43969595_qa_4/tests/grader.py +++ b/tasks/0043_969_43969595_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/0043_969_43969595_qa_5/tests/grader.py b/tasks/0043_969_43969595_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0043_969_43969595_qa_5/tests/grader.py +++ b/tasks/0043_969_43969595_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/0044_001_44001840_qa_1/tests/grader.py b/tasks/0044_001_44001840_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_001_44001840_qa_1/tests/grader.py +++ b/tasks/0044_001_44001840_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/0044_103_44103052_qa_1/tests/grader.py b/tasks/0044_103_44103052_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_103_44103052_qa_1/tests/grader.py +++ b/tasks/0044_103_44103052_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/0044_103_44103052_qa_5/tests/grader.py b/tasks/0044_103_44103052_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_103_44103052_qa_5/tests/grader.py +++ b/tasks/0044_103_44103052_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/0044_107_44107622_qa_1/tests/grader.py b/tasks/0044_107_44107622_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_107_44107622_qa_1/tests/grader.py +++ b/tasks/0044_107_44107622_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/0044_107_44107622_qa_5/tests/grader.py b/tasks/0044_107_44107622_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_107_44107622_qa_5/tests/grader.py +++ b/tasks/0044_107_44107622_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/0044_141_44141679_qa_3/tests/grader.py b/tasks/0044_141_44141679_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_141_44141679_qa_3/tests/grader.py +++ b/tasks/0044_141_44141679_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/0044_153_44153291_qa_2/tests/grader.py b/tasks/0044_153_44153291_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_153_44153291_qa_2/tests/grader.py +++ b/tasks/0044_153_44153291_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/0044_153_44153291_qa_4/tests/grader.py b/tasks/0044_153_44153291_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_153_44153291_qa_4/tests/grader.py +++ b/tasks/0044_153_44153291_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/0044_155_44155408_qa_1/tests/grader.py b/tasks/0044_155_44155408_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_155_44155408_qa_1/tests/grader.py +++ b/tasks/0044_155_44155408_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/0044_155_44155408_qa_2/tests/grader.py b/tasks/0044_155_44155408_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_155_44155408_qa_2/tests/grader.py +++ b/tasks/0044_155_44155408_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/0044_175_44175301_qa_3/tests/grader.py b/tasks/0044_175_44175301_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_175_44175301_qa_3/tests/grader.py +++ b/tasks/0044_175_44175301_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/0044_193_44193489_qa_1/tests/grader.py b/tasks/0044_193_44193489_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_193_44193489_qa_1/tests/grader.py +++ b/tasks/0044_193_44193489_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/0044_251_44251119_qa_3/tests/grader.py b/tasks/0044_251_44251119_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_251_44251119_qa_3/tests/grader.py +++ b/tasks/0044_251_44251119_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/0044_270_44270596_qa_1/tests/grader.py b/tasks/0044_270_44270596_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_270_44270596_qa_1/tests/grader.py +++ b/tasks/0044_270_44270596_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/0044_270_44270596_qa_4/tests/grader.py b/tasks/0044_270_44270596_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_270_44270596_qa_4/tests/grader.py +++ b/tasks/0044_270_44270596_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/0044_352_44352035_qa_4/tests/grader.py b/tasks/0044_352_44352035_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_352_44352035_qa_4/tests/grader.py +++ b/tasks/0044_352_44352035_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/0044_352_44352035_qa_5/tests/grader.py b/tasks/0044_352_44352035_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_352_44352035_qa_5/tests/grader.py +++ b/tasks/0044_352_44352035_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/0044_367_44367279_qa_2/tests/grader.py b/tasks/0044_367_44367279_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_367_44367279_qa_2/tests/grader.py +++ b/tasks/0044_367_44367279_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/0044_367_44367279_qa_3/tests/grader.py b/tasks/0044_367_44367279_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_367_44367279_qa_3/tests/grader.py +++ b/tasks/0044_367_44367279_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/0044_367_44367279_qa_5/tests/grader.py b/tasks/0044_367_44367279_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_367_44367279_qa_5/tests/grader.py +++ b/tasks/0044_367_44367279_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/0044_401_44401900_qa_2/tests/grader.py b/tasks/0044_401_44401900_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_401_44401900_qa_2/tests/grader.py +++ b/tasks/0044_401_44401900_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/0044_401_44401900_qa_3/tests/grader.py b/tasks/0044_401_44401900_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_401_44401900_qa_3/tests/grader.py +++ b/tasks/0044_401_44401900_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/0044_406_44406244_qa_1/tests/grader.py b/tasks/0044_406_44406244_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_406_44406244_qa_1/tests/grader.py +++ b/tasks/0044_406_44406244_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/0044_406_44406244_qa_5/tests/grader.py b/tasks/0044_406_44406244_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_406_44406244_qa_5/tests/grader.py +++ b/tasks/0044_406_44406244_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/0044_412_44412230_qa_1/tests/grader.py b/tasks/0044_412_44412230_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_412_44412230_qa_1/tests/grader.py +++ b/tasks/0044_412_44412230_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/0044_466_44466723_qa_4/tests/grader.py b/tasks/0044_466_44466723_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_466_44466723_qa_4/tests/grader.py +++ b/tasks/0044_466_44466723_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/0044_466_44466723_qa_5/tests/grader.py b/tasks/0044_466_44466723_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_466_44466723_qa_5/tests/grader.py +++ b/tasks/0044_466_44466723_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/0044_505_44505990_qa_5/tests/grader.py b/tasks/0044_505_44505990_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_505_44505990_qa_5/tests/grader.py +++ b/tasks/0044_505_44505990_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/0044_572_44572407_qa_4/tests/grader.py b/tasks/0044_572_44572407_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_572_44572407_qa_4/tests/grader.py +++ b/tasks/0044_572_44572407_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/0044_575_44575268_qa_1/tests/grader.py b/tasks/0044_575_44575268_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_575_44575268_qa_1/tests/grader.py +++ b/tasks/0044_575_44575268_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/0044_575_44575651_qa_2/tests/grader.py b/tasks/0044_575_44575651_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_575_44575651_qa_2/tests/grader.py +++ b/tasks/0044_575_44575651_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/0044_575_44575651_qa_3/tests/grader.py b/tasks/0044_575_44575651_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_575_44575651_qa_3/tests/grader.py +++ b/tasks/0044_575_44575651_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/0044_609_44609132_qa_3/tests/grader.py b/tasks/0044_609_44609132_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_609_44609132_qa_3/tests/grader.py +++ b/tasks/0044_609_44609132_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/0044_708_44708511_qa_4/tests/grader.py b/tasks/0044_708_44708511_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_708_44708511_qa_4/tests/grader.py +++ b/tasks/0044_708_44708511_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/0044_721_44721454_qa_1/tests/grader.py b/tasks/0044_721_44721454_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_721_44721454_qa_1/tests/grader.py +++ b/tasks/0044_721_44721454_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/0044_727_44727189_qa_1/tests/grader.py b/tasks/0044_727_44727189_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_727_44727189_qa_1/tests/grader.py +++ b/tasks/0044_727_44727189_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/0044_766_44766802_qa_2/tests/grader.py b/tasks/0044_766_44766802_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_766_44766802_qa_2/tests/grader.py +++ b/tasks/0044_766_44766802_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/0044_860_44860367_qa_5/tests/grader.py b/tasks/0044_860_44860367_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_860_44860367_qa_5/tests/grader.py +++ b/tasks/0044_860_44860367_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/0044_867_44867555_qa_3/tests/grader.py b/tasks/0044_867_44867555_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_867_44867555_qa_3/tests/grader.py +++ b/tasks/0044_867_44867555_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/0044_867_44867555_qa_4/tests/grader.py b/tasks/0044_867_44867555_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_867_44867555_qa_4/tests/grader.py +++ b/tasks/0044_867_44867555_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/0044_869_44869617_qa_3/tests/grader.py b/tasks/0044_869_44869617_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_869_44869617_qa_3/tests/grader.py +++ b/tasks/0044_869_44869617_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/0044_873_44873237_qa_3/tests/grader.py b/tasks/0044_873_44873237_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_873_44873237_qa_3/tests/grader.py +++ b/tasks/0044_873_44873237_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/0044_954_44954372_qa_1/tests/grader.py b/tasks/0044_954_44954372_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_954_44954372_qa_1/tests/grader.py +++ b/tasks/0044_954_44954372_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/0044_954_44954372_qa_2/tests/grader.py b/tasks/0044_954_44954372_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_954_44954372_qa_2/tests/grader.py +++ b/tasks/0044_954_44954372_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/0044_977_44977269_qa_5/tests/grader.py b/tasks/0044_977_44977269_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_977_44977269_qa_5/tests/grader.py +++ b/tasks/0044_977_44977269_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/0044_988_44988061_qa_5/tests/grader.py b/tasks/0044_988_44988061_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_988_44988061_qa_5/tests/grader.py +++ b/tasks/0044_988_44988061_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/0044_993_44993292_qa_1/tests/grader.py b/tasks/0044_993_44993292_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0044_993_44993292_qa_1/tests/grader.py +++ b/tasks/0044_993_44993292_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/0045_006_45006527_qa_2/tests/grader.py b/tasks/0045_006_45006527_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_006_45006527_qa_2/tests/grader.py +++ b/tasks/0045_006_45006527_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/0045_024_45024257_qa_3/tests/grader.py b/tasks/0045_024_45024257_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_024_45024257_qa_3/tests/grader.py +++ b/tasks/0045_024_45024257_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/0045_024_45024257_qa_5/tests/grader.py b/tasks/0045_024_45024257_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_024_45024257_qa_5/tests/grader.py +++ b/tasks/0045_024_45024257_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/0045_032_45032719_qa_5/tests/grader.py b/tasks/0045_032_45032719_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_032_45032719_qa_5/tests/grader.py +++ b/tasks/0045_032_45032719_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/0045_056_45056822_qa_5/tests/grader.py b/tasks/0045_056_45056822_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_056_45056822_qa_5/tests/grader.py +++ b/tasks/0045_056_45056822_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/0045_065_45065521_qa_2/tests/grader.py b/tasks/0045_065_45065521_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_065_45065521_qa_2/tests/grader.py +++ b/tasks/0045_065_45065521_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/0045_067_45067031_qa_3/tests/grader.py b/tasks/0045_067_45067031_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_067_45067031_qa_3/tests/grader.py +++ b/tasks/0045_067_45067031_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/0045_071_45071899_qa_5/tests/grader.py b/tasks/0045_071_45071899_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_071_45071899_qa_5/tests/grader.py +++ b/tasks/0045_071_45071899_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/0045_100_45100270_qa_4/tests/grader.py b/tasks/0045_100_45100270_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_100_45100270_qa_4/tests/grader.py +++ b/tasks/0045_100_45100270_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/0045_118_45118642_qa_2/tests/grader.py b/tasks/0045_118_45118642_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_118_45118642_qa_2/tests/grader.py +++ b/tasks/0045_118_45118642_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/0045_136_45136493_qa_3/tests/grader.py b/tasks/0045_136_45136493_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_136_45136493_qa_3/tests/grader.py +++ b/tasks/0045_136_45136493_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/0045_136_45136728_qa_1/tests/grader.py b/tasks/0045_136_45136728_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_136_45136728_qa_1/tests/grader.py +++ b/tasks/0045_136_45136728_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/0045_138_45138042_qa_4/tests/grader.py b/tasks/0045_138_45138042_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_138_45138042_qa_4/tests/grader.py +++ b/tasks/0045_138_45138042_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/0045_142_45142290_qa_4/tests/grader.py b/tasks/0045_142_45142290_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_142_45142290_qa_4/tests/grader.py +++ b/tasks/0045_142_45142290_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/0045_142_45142290_qa_5/tests/grader.py b/tasks/0045_142_45142290_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_142_45142290_qa_5/tests/grader.py +++ b/tasks/0045_142_45142290_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/0045_162_45162455_qa_3/tests/grader.py b/tasks/0045_162_45162455_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_162_45162455_qa_3/tests/grader.py +++ b/tasks/0045_162_45162455_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/0045_174_45174378_qa_1/tests/grader.py b/tasks/0045_174_45174378_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_174_45174378_qa_1/tests/grader.py +++ b/tasks/0045_174_45174378_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/0045_190_45190323_qa_2/tests/grader.py b/tasks/0045_190_45190323_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_190_45190323_qa_2/tests/grader.py +++ b/tasks/0045_190_45190323_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/0045_190_45190323_qa_5/tests/grader.py b/tasks/0045_190_45190323_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_190_45190323_qa_5/tests/grader.py +++ b/tasks/0045_190_45190323_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/0045_378_45378696_qa_2/tests/grader.py b/tasks/0045_378_45378696_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_378_45378696_qa_2/tests/grader.py +++ b/tasks/0045_378_45378696_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/0045_378_45378696_qa_3/tests/grader.py b/tasks/0045_378_45378696_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_378_45378696_qa_3/tests/grader.py +++ b/tasks/0045_378_45378696_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/0045_385_45385383_qa_4/tests/grader.py b/tasks/0045_385_45385383_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_385_45385383_qa_4/tests/grader.py +++ b/tasks/0045_385_45385383_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/0045_409_45409591_qa_1/tests/grader.py b/tasks/0045_409_45409591_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_409_45409591_qa_1/tests/grader.py +++ b/tasks/0045_409_45409591_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/0045_409_45409591_qa_2/tests/grader.py b/tasks/0045_409_45409591_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_409_45409591_qa_2/tests/grader.py +++ b/tasks/0045_409_45409591_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/0045_409_45409591_qa_4/tests/grader.py b/tasks/0045_409_45409591_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_409_45409591_qa_4/tests/grader.py +++ b/tasks/0045_409_45409591_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/0045_433_45433575_qa_3/tests/grader.py b/tasks/0045_433_45433575_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_433_45433575_qa_3/tests/grader.py +++ b/tasks/0045_433_45433575_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/0045_452_45452619_qa_3/tests/grader.py b/tasks/0045_452_45452619_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_452_45452619_qa_3/tests/grader.py +++ b/tasks/0045_452_45452619_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/0045_454_45454053_qa_3/tests/grader.py b/tasks/0045_454_45454053_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_454_45454053_qa_3/tests/grader.py +++ b/tasks/0045_454_45454053_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/0045_466_45466628_qa_3/tests/grader.py b/tasks/0045_466_45466628_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_466_45466628_qa_3/tests/grader.py +++ b/tasks/0045_466_45466628_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/0045_476_45476147_qa_3/tests/grader.py b/tasks/0045_476_45476147_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_476_45476147_qa_3/tests/grader.py +++ b/tasks/0045_476_45476147_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/0045_605_45605559_qa_1/tests/grader.py b/tasks/0045_605_45605559_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_605_45605559_qa_1/tests/grader.py +++ b/tasks/0045_605_45605559_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/0045_605_45605559_qa_4/tests/grader.py b/tasks/0045_605_45605559_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_605_45605559_qa_4/tests/grader.py +++ b/tasks/0045_605_45605559_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/0045_668_45668013_qa_2/tests/grader.py b/tasks/0045_668_45668013_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_668_45668013_qa_2/tests/grader.py +++ b/tasks/0045_668_45668013_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/0045_670_45670809_qa_3/tests/grader.py b/tasks/0045_670_45670809_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_670_45670809_qa_3/tests/grader.py +++ b/tasks/0045_670_45670809_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/0045_675_45675145_qa_5/tests/grader.py b/tasks/0045_675_45675145_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_675_45675145_qa_5/tests/grader.py +++ b/tasks/0045_675_45675145_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/0045_738_45738362_qa_2/tests/grader.py b/tasks/0045_738_45738362_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_738_45738362_qa_2/tests/grader.py +++ b/tasks/0045_738_45738362_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/0045_738_45738362_qa_4/tests/grader.py b/tasks/0045_738_45738362_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_738_45738362_qa_4/tests/grader.py +++ b/tasks/0045_738_45738362_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/0045_754_45754674_qa_5/tests/grader.py b/tasks/0045_754_45754674_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_754_45754674_qa_5/tests/grader.py +++ b/tasks/0045_754_45754674_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/0045_758_45758482_qa_3/tests/grader.py b/tasks/0045_758_45758482_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_758_45758482_qa_3/tests/grader.py +++ b/tasks/0045_758_45758482_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/0045_818_45818362_qa_4/tests/grader.py b/tasks/0045_818_45818362_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_818_45818362_qa_4/tests/grader.py +++ b/tasks/0045_818_45818362_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/0045_821_45821165_qa_2/tests/grader.py b/tasks/0045_821_45821165_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_821_45821165_qa_2/tests/grader.py +++ b/tasks/0045_821_45821165_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/0045_821_45821165_qa_3/tests/grader.py b/tasks/0045_821_45821165_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_821_45821165_qa_3/tests/grader.py +++ b/tasks/0045_821_45821165_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/0045_821_45821165_qa_5/tests/grader.py b/tasks/0045_821_45821165_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_821_45821165_qa_5/tests/grader.py +++ b/tasks/0045_821_45821165_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/0045_874_45874370_qa_5/tests/grader.py b/tasks/0045_874_45874370_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_874_45874370_qa_5/tests/grader.py +++ b/tasks/0045_874_45874370_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/0045_880_45880804_qa_5/tests/grader.py b/tasks/0045_880_45880804_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_880_45880804_qa_5/tests/grader.py +++ b/tasks/0045_880_45880804_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/0045_892_45892166_qa_5/tests/grader.py b/tasks/0045_892_45892166_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_892_45892166_qa_5/tests/grader.py +++ b/tasks/0045_892_45892166_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/0045_913_45913671_qa_3/tests/grader.py b/tasks/0045_913_45913671_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_913_45913671_qa_3/tests/grader.py +++ b/tasks/0045_913_45913671_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/0045_943_45943372_qa_5/tests/grader.py b/tasks/0045_943_45943372_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_943_45943372_qa_5/tests/grader.py +++ b/tasks/0045_943_45943372_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/0045_969_45969290_qa_1/tests/grader.py b/tasks/0045_969_45969290_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_969_45969290_qa_1/tests/grader.py +++ b/tasks/0045_969_45969290_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/0045_969_45969290_qa_2/tests/grader.py b/tasks/0045_969_45969290_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0045_969_45969290_qa_2/tests/grader.py +++ b/tasks/0045_969_45969290_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/0046_035_46035466_qa_1/tests/grader.py b/tasks/0046_035_46035466_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_035_46035466_qa_1/tests/grader.py +++ b/tasks/0046_035_46035466_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/0046_035_46035466_qa_2/tests/grader.py b/tasks/0046_035_46035466_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_035_46035466_qa_2/tests/grader.py +++ b/tasks/0046_035_46035466_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/0046_103_46103508_qa_2/tests/grader.py b/tasks/0046_103_46103508_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_103_46103508_qa_2/tests/grader.py +++ b/tasks/0046_103_46103508_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/0046_112_46112628_qa_3/tests/grader.py b/tasks/0046_112_46112628_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_112_46112628_qa_3/tests/grader.py +++ b/tasks/0046_112_46112628_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/0046_113_46113496_qa_1/tests/grader.py b/tasks/0046_113_46113496_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_113_46113496_qa_1/tests/grader.py +++ b/tasks/0046_113_46113496_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/0046_113_46113496_qa_2/tests/grader.py b/tasks/0046_113_46113496_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_113_46113496_qa_2/tests/grader.py +++ b/tasks/0046_113_46113496_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/0046_115_46115058_qa_5/tests/grader.py b/tasks/0046_115_46115058_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_115_46115058_qa_5/tests/grader.py +++ b/tasks/0046_115_46115058_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/0046_178_46178687_qa_2/tests/grader.py b/tasks/0046_178_46178687_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_178_46178687_qa_2/tests/grader.py +++ b/tasks/0046_178_46178687_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/0046_178_46178687_qa_4/tests/grader.py b/tasks/0046_178_46178687_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_178_46178687_qa_4/tests/grader.py +++ b/tasks/0046_178_46178687_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/0046_263_46263849_qa_1/tests/grader.py b/tasks/0046_263_46263849_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_263_46263849_qa_1/tests/grader.py +++ b/tasks/0046_263_46263849_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/0046_267_46267192_qa_3/tests/grader.py b/tasks/0046_267_46267192_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_267_46267192_qa_3/tests/grader.py +++ b/tasks/0046_267_46267192_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/0046_282_46282379_qa_2/tests/grader.py b/tasks/0046_282_46282379_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_282_46282379_qa_2/tests/grader.py +++ b/tasks/0046_282_46282379_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/0046_305_46305988_qa_2/tests/grader.py b/tasks/0046_305_46305988_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_305_46305988_qa_2/tests/grader.py +++ b/tasks/0046_305_46305988_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/0046_333_46333553_qa_1/tests/grader.py b/tasks/0046_333_46333553_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_333_46333553_qa_1/tests/grader.py +++ b/tasks/0046_333_46333553_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/0046_421_46421373_qa_5/tests/grader.py b/tasks/0046_421_46421373_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_421_46421373_qa_5/tests/grader.py +++ b/tasks/0046_421_46421373_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/0046_456_46456896_qa_3/tests/grader.py b/tasks/0046_456_46456896_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_456_46456896_qa_3/tests/grader.py +++ b/tasks/0046_456_46456896_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/0046_467_46467108_qa_2/tests/grader.py b/tasks/0046_467_46467108_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_467_46467108_qa_2/tests/grader.py +++ b/tasks/0046_467_46467108_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/0046_487_46487066_qa_1/tests/grader.py b/tasks/0046_487_46487066_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_487_46487066_qa_1/tests/grader.py +++ b/tasks/0046_487_46487066_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/0046_487_46487066_qa_3/tests/grader.py b/tasks/0046_487_46487066_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_487_46487066_qa_3/tests/grader.py +++ b/tasks/0046_487_46487066_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/0046_487_46487066_qa_4/tests/grader.py b/tasks/0046_487_46487066_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_487_46487066_qa_4/tests/grader.py +++ b/tasks/0046_487_46487066_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/0046_517_46517574_qa_1/tests/grader.py b/tasks/0046_517_46517574_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_517_46517574_qa_1/tests/grader.py +++ b/tasks/0046_517_46517574_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/0046_528_46528108_qa_1/tests/grader.py b/tasks/0046_528_46528108_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_528_46528108_qa_1/tests/grader.py +++ b/tasks/0046_528_46528108_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/0046_597_46597030_qa_1/tests/grader.py b/tasks/0046_597_46597030_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_597_46597030_qa_1/tests/grader.py +++ b/tasks/0046_597_46597030_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/0046_597_46597030_qa_4/tests/grader.py b/tasks/0046_597_46597030_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_597_46597030_qa_4/tests/grader.py +++ b/tasks/0046_597_46597030_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/0046_641_46641346_qa_1/tests/grader.py b/tasks/0046_641_46641346_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_641_46641346_qa_1/tests/grader.py +++ b/tasks/0046_641_46641346_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/0046_651_46651682_qa_4/tests/grader.py b/tasks/0046_651_46651682_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_651_46651682_qa_4/tests/grader.py +++ b/tasks/0046_651_46651682_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/0046_658_46658315_qa_5/tests/grader.py b/tasks/0046_658_46658315_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_658_46658315_qa_5/tests/grader.py +++ b/tasks/0046_658_46658315_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/0046_660_46660345_qa_2/tests/grader.py b/tasks/0046_660_46660345_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_660_46660345_qa_2/tests/grader.py +++ b/tasks/0046_660_46660345_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/0046_660_46660345_qa_5/tests/grader.py b/tasks/0046_660_46660345_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_660_46660345_qa_5/tests/grader.py +++ b/tasks/0046_660_46660345_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/0046_711_46711953_qa_2/tests/grader.py b/tasks/0046_711_46711953_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_711_46711953_qa_2/tests/grader.py +++ b/tasks/0046_711_46711953_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/0046_788_46788472_qa_2/tests/grader.py b/tasks/0046_788_46788472_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_788_46788472_qa_2/tests/grader.py +++ b/tasks/0046_788_46788472_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/0046_788_46788472_qa_3/tests/grader.py b/tasks/0046_788_46788472_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_788_46788472_qa_3/tests/grader.py +++ b/tasks/0046_788_46788472_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/0046_788_46788472_qa_4/tests/grader.py b/tasks/0046_788_46788472_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_788_46788472_qa_4/tests/grader.py +++ b/tasks/0046_788_46788472_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/0046_808_46808200_qa_4/tests/grader.py b/tasks/0046_808_46808200_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_808_46808200_qa_4/tests/grader.py +++ b/tasks/0046_808_46808200_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/0046_857_46857117_qa_4/tests/grader.py b/tasks/0046_857_46857117_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_857_46857117_qa_4/tests/grader.py +++ b/tasks/0046_857_46857117_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/0046_857_46857117_qa_5/tests/grader.py b/tasks/0046_857_46857117_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_857_46857117_qa_5/tests/grader.py +++ b/tasks/0046_857_46857117_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/0046_875_46875284_qa_1/tests/grader.py b/tasks/0046_875_46875284_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_875_46875284_qa_1/tests/grader.py +++ b/tasks/0046_875_46875284_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/0046_875_46875284_qa_2/tests/grader.py b/tasks/0046_875_46875284_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_875_46875284_qa_2/tests/grader.py +++ b/tasks/0046_875_46875284_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/0046_905_46905660_qa_1/tests/grader.py b/tasks/0046_905_46905660_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_905_46905660_qa_1/tests/grader.py +++ b/tasks/0046_905_46905660_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/0046_933_46933248_qa_5/tests/grader.py b/tasks/0046_933_46933248_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_933_46933248_qa_5/tests/grader.py +++ b/tasks/0046_933_46933248_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/0046_955_46955725_qa_4/tests/grader.py b/tasks/0046_955_46955725_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_955_46955725_qa_4/tests/grader.py +++ b/tasks/0046_955_46955725_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/0046_964_46964114_qa_1/tests/grader.py b/tasks/0046_964_46964114_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0046_964_46964114_qa_1/tests/grader.py +++ b/tasks/0046_964_46964114_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/0047_059_47059066_qa_2/tests/grader.py b/tasks/0047_059_47059066_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_059_47059066_qa_2/tests/grader.py +++ b/tasks/0047_059_47059066_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/0047_266_47266614_qa_1/tests/grader.py b/tasks/0047_266_47266614_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_266_47266614_qa_1/tests/grader.py +++ b/tasks/0047_266_47266614_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/0047_266_47266614_qa_3/tests/grader.py b/tasks/0047_266_47266614_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_266_47266614_qa_3/tests/grader.py +++ b/tasks/0047_266_47266614_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/0047_271_47271508_qa_4/tests/grader.py b/tasks/0047_271_47271508_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_271_47271508_qa_4/tests/grader.py +++ b/tasks/0047_271_47271508_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/0047_271_47271508_qa_5/tests/grader.py b/tasks/0047_271_47271508_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_271_47271508_qa_5/tests/grader.py +++ b/tasks/0047_271_47271508_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/0047_308_47308029_qa_1/tests/grader.py b/tasks/0047_308_47308029_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_308_47308029_qa_1/tests/grader.py +++ b/tasks/0047_308_47308029_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/0047_367_47367333_qa_4/tests/grader.py b/tasks/0047_367_47367333_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_367_47367333_qa_4/tests/grader.py +++ b/tasks/0047_367_47367333_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/0047_398_47398075_qa_2/tests/grader.py b/tasks/0047_398_47398075_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_398_47398075_qa_2/tests/grader.py +++ b/tasks/0047_398_47398075_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/0047_398_47398075_qa_5/tests/grader.py b/tasks/0047_398_47398075_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_398_47398075_qa_5/tests/grader.py +++ b/tasks/0047_398_47398075_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/0047_417_47417997_qa_1/tests/grader.py b/tasks/0047_417_47417997_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_417_47417997_qa_1/tests/grader.py +++ b/tasks/0047_417_47417997_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/0047_417_47417997_qa_3/tests/grader.py b/tasks/0047_417_47417997_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_417_47417997_qa_3/tests/grader.py +++ b/tasks/0047_417_47417997_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/0047_428_47428905_qa_2/tests/grader.py b/tasks/0047_428_47428905_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_428_47428905_qa_2/tests/grader.py +++ b/tasks/0047_428_47428905_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/0047_507_47507147_qa_5/tests/grader.py b/tasks/0047_507_47507147_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_507_47507147_qa_5/tests/grader.py +++ b/tasks/0047_507_47507147_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/0047_560_47560034_qa_1/tests/grader.py b/tasks/0047_560_47560034_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_560_47560034_qa_1/tests/grader.py +++ b/tasks/0047_560_47560034_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/0047_560_47560034_qa_4/tests/grader.py b/tasks/0047_560_47560034_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_560_47560034_qa_4/tests/grader.py +++ b/tasks/0047_560_47560034_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/0047_560_47560034_qa_5/tests/grader.py b/tasks/0047_560_47560034_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_560_47560034_qa_5/tests/grader.py +++ b/tasks/0047_560_47560034_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/0047_564_47564024_qa_3/tests/grader.py b/tasks/0047_564_47564024_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_564_47564024_qa_3/tests/grader.py +++ b/tasks/0047_564_47564024_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/0047_591_47591946_qa_1/tests/grader.py b/tasks/0047_591_47591946_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_591_47591946_qa_1/tests/grader.py +++ b/tasks/0047_591_47591946_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/0047_591_47591946_qa_3/tests/grader.py b/tasks/0047_591_47591946_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_591_47591946_qa_3/tests/grader.py +++ b/tasks/0047_591_47591946_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/0047_667_47667613_qa_5/tests/grader.py b/tasks/0047_667_47667613_qa_5/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_667_47667613_qa_5/tests/grader.py +++ b/tasks/0047_667_47667613_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/0047_751_47751075_qa_2/tests/grader.py b/tasks/0047_751_47751075_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_751_47751075_qa_2/tests/grader.py +++ b/tasks/0047_751_47751075_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/0047_757_47757565_qa_3/tests/grader.py b/tasks/0047_757_47757565_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_757_47757565_qa_3/tests/grader.py +++ b/tasks/0047_757_47757565_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/0047_766_47766276_qa_1/tests/grader.py b/tasks/0047_766_47766276_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_766_47766276_qa_1/tests/grader.py +++ b/tasks/0047_766_47766276_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/0047_766_47766276_qa_2/tests/grader.py b/tasks/0047_766_47766276_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_766_47766276_qa_2/tests/grader.py +++ b/tasks/0047_766_47766276_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/0047_835_47835417_qa_1/tests/grader.py b/tasks/0047_835_47835417_qa_1/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_835_47835417_qa_1/tests/grader.py +++ b/tasks/0047_835_47835417_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/0047_849_47849671_qa_4/tests/grader.py b/tasks/0047_849_47849671_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_849_47849671_qa_4/tests/grader.py +++ b/tasks/0047_849_47849671_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/0047_852_47852416_qa_2/tests/grader.py b/tasks/0047_852_47852416_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_852_47852416_qa_2/tests/grader.py +++ b/tasks/0047_852_47852416_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/0047_862_47862196_qa_2/tests/grader.py b/tasks/0047_862_47862196_qa_2/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_862_47862196_qa_2/tests/grader.py +++ b/tasks/0047_862_47862196_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/0047_862_47862196_qa_3/tests/grader.py b/tasks/0047_862_47862196_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0047_862_47862196_qa_3/tests/grader.py +++ b/tasks/0047_862_47862196_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/0048_022_48022242_qa_3/tests/grader.py b/tasks/0048_022_48022242_qa_3/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0048_022_48022242_qa_3/tests/grader.py +++ b/tasks/0048_022_48022242_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/0048_022_48022242_qa_4/tests/grader.py b/tasks/0048_022_48022242_qa_4/tests/grader.py index 3befa9762b926171364dc7e4e3534da4303d8379..c46c20189865f2c93d497015f84abd2e7ef6c838 100644 --- a/tasks/0048_022_48022242_qa_4/tests/grader.py +++ b/tasks/0048_022_48022242_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