From 1700c01ae3ca125373bff79a66b41ab6fd292bef Mon Sep 17 00:00:00 2001 From: Stephen Guo Date: Fri, 19 Dec 2025 16:32:03 -0500 Subject: [PATCH 1/3] Fix robot-simulator and list-ops --- evaluator/datasets/polyglot_js/CHANGES.md | 2 +- .../datasets/polyglot_js/robot-simulator/main.js | 7 ++++--- evaluator/datasets/polyglot_py/CHANGES.md | 2 +- evaluator/datasets/polyglot_py/list-ops/main.py | 4 ++-- .../datasets/polyglot_py/robot-simulator/main.py | 11 +++++++++++ 5 files changed, 19 insertions(+), 7 deletions(-) diff --git a/evaluator/datasets/polyglot_js/CHANGES.md b/evaluator/datasets/polyglot_js/CHANGES.md index b83532a00..7105b5cae 100644 --- a/evaluator/datasets/polyglot_js/CHANGES.md +++ b/evaluator/datasets/polyglot_js/CHANGES.md @@ -400,7 +400,7 @@ Added the missing `name` property and `reset()` method with type hints. The inst ## robot-simulator -Added typing to `Robot.bearing`, `Robot.coordinates`, `Robot.place()`, and `Robot.evaluate()`, as it is unclear what the parameter types should be and what the methods should return. +Added typing to `Robot.bearing`, `Robot.coordinates`, `Robot.place()`, and `Robot.evaluate()`, as it is unclear what the parameter types should be, what errors should be thrown, and what the methods should return. ## roman-numerals diff --git a/evaluator/datasets/polyglot_js/robot-simulator/main.js b/evaluator/datasets/polyglot_js/robot-simulator/main.js index 2ccd18f55..873f1df3f 100644 --- a/evaluator/datasets/polyglot_js/robot-simulator/main.js +++ b/evaluator/datasets/polyglot_js/robot-simulator/main.js @@ -12,21 +12,22 @@ export class InvalidInputError extends Error { export class Robot { /** - * @returns {string} + * @returns {'north' | 'east' | 'south' | 'west'} */ get bearing() { throw new Error('Remove this line and implement the function'); } /** - * @returns {number[]} + * @returns {[number, number]} */ get coordinates() { throw new Error('Remove this line and implement the function'); } /** - * @param {{x: number, y: number, direction: string}} position + * @param {{x: number, y: number, direction: 'north' | 'east' | 'south' | 'west'}} position + * @throws {InvalidInputError} */ place({ x, y, direction }) { throw new Error('Remove this line and implement the function'); diff --git a/evaluator/datasets/polyglot_py/CHANGES.md b/evaluator/datasets/polyglot_py/CHANGES.md index 8d916cf79..e4fde9ee8 100644 --- a/evaluator/datasets/polyglot_py/CHANGES.md +++ b/evaluator/datasets/polyglot_py/CHANGES.md @@ -395,7 +395,7 @@ Added the missing `name` property and `reset()` method with type hints. The inst ## robot-simulator -Added typing to `Robot.__init__()`, as it is unclear what the parameter types should be. Added import for `Tuple` type hint. +Added typing to `Robot.__init__()`, as it is unclear what the parameter types should be. Added import for `Tuple` type hint. Added `Robot.move()`, `Robot.direction`, and `Robot.coordinates` since they are needed by the tests. ## roman-numerals diff --git a/evaluator/datasets/polyglot_py/list-ops/main.py b/evaluator/datasets/polyglot_py/list-ops/main.py index 6021e420e..3e2445267 100644 --- a/evaluator/datasets/polyglot_py/list-ops/main.py +++ b/evaluator/datasets/polyglot_py/list-ops/main.py @@ -21,11 +21,11 @@ def map(function: Callable[[Any], Any], list: list) -> list: pass -def foldl(function: Callable[[Any, Any], list], list: list, initial: Any) -> Any: # function(acc, el) +def foldl(function: Callable[[Any, Any], Any], list: list, initial: Any) -> Any: # function(acc, el) pass -def foldr(function: Callable[[Any, Any], list], list: list, initial: Any) -> Any: # function(acc, el) +def foldr(function: Callable[[Any, Any], Any], list: list, initial: Any) -> Any: # function(acc, el) pass diff --git a/evaluator/datasets/polyglot_py/robot-simulator/main.py b/evaluator/datasets/polyglot_py/robot-simulator/main.py index 72caa3b59..941622a86 100644 --- a/evaluator/datasets/polyglot_py/robot-simulator/main.py +++ b/evaluator/datasets/polyglot_py/robot-simulator/main.py @@ -11,3 +11,14 @@ class Robot: def __init__(self, direction: int = NORTH, x_pos: int = 0, y_pos: int = 0) -> None: pass + + def move(self, commands: str) -> None: + pass + + @property + def direction(self) -> int: + pass + + @property + def coordinates(self) -> Tuple[int, int]: + pass From 1945658ef689c9d8735ea21b01d0c501b002e7e3 Mon Sep 17 00:00:00 2001 From: Stephen Guo Date: Fri, 19 Dec 2025 16:48:18 -0500 Subject: [PATCH 2/3] Fix proverb-js typing and added instructions --- evaluator/datasets/polyglot_js/CHANGES.md | 2 +- evaluator/datasets/polyglot_js/proverb/main.js | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/evaluator/datasets/polyglot_js/CHANGES.md b/evaluator/datasets/polyglot_js/CHANGES.md index 7105b5cae..15519f7f5 100644 --- a/evaluator/datasets/polyglot_js/CHANGES.md +++ b/evaluator/datasets/polyglot_js/CHANGES.md @@ -336,7 +336,7 @@ Added typing to `promisify()`, `all()`, `allSettled()`, `race()`, and `any()`, a ## proverb -Added the complete function signature with typing for `proverb()`, including the `...args` rest parameter, as the `main.js` file had no parameters at all. +Added the complete function signature with typing for `proverb()`, including the `...args` rest parameter, as the `main.js` file had no parameters at all. Explained where the qualifier should be used. ## pythagorean-triplet diff --git a/evaluator/datasets/polyglot_js/proverb/main.js b/evaluator/datasets/polyglot_js/proverb/main.js index fb2aec729..2da2ef1cc 100644 --- a/evaluator/datasets/polyglot_js/proverb/main.js +++ b/evaluator/datasets/polyglot_js/proverb/main.js @@ -4,7 +4,7 @@ // /** - * @param {...string} args + * @param {...string | {qualifier: string}} args - The last argument may be an object with a `qualifier` property. The qualifier should go before the first argument in the conclusion. * @return {string} */ export const proverb = (...args) => { From ef463d2d9962b7e366175badfaefc6b70fff79d2 Mon Sep 17 00:00:00 2001 From: Stephen Guo Date: Fri, 19 Dec 2025 16:51:18 -0500 Subject: [PATCH 3/3] Fix forth-py missing raise error --- evaluator/datasets/polyglot_py/CHANGES.md | 2 +- evaluator/datasets/polyglot_py/forth/instructions.md | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/evaluator/datasets/polyglot_py/CHANGES.md b/evaluator/datasets/polyglot_py/CHANGES.md index e4fde9ee8..ea4faff53 100644 --- a/evaluator/datasets/polyglot_py/CHANGES.md +++ b/evaluator/datasets/polyglot_py/CHANGES.md @@ -159,7 +159,7 @@ Added typing to `recite()`, as it is unclear what the parameter types should be ## forth -Added typing to `evaluate()`, as it is unclear what the parameter type should be and what the function should return. There are some links that are impossible for the agent to follow. This will be resolved in a future version of our sandbox, where we provide restricted Internet access. +Added typing to `evaluate()`, as it is unclear what the parameter type should be and what the function should return. Added a missing exception message in the instructions that the tests look for. There are some links that are impossible for the agent to follow. This will be resolved in a future version of our sandbox, where we provide restricted Internet access. ## gigasecond diff --git a/evaluator/datasets/polyglot_py/forth/instructions.md b/evaluator/datasets/polyglot_py/forth/instructions.md index b06134fca..b504c1e4f 100644 --- a/evaluator/datasets/polyglot_py/forth/instructions.md +++ b/evaluator/datasets/polyglot_py/forth/instructions.md @@ -59,4 +59,7 @@ raise ZeroDivisionError("divide by zero") #an example when the operation is undefined. raise ValueError("undefined operation") + +# an example when the operation is not allowed. +raise ValueError('illegal operation') ```