naklitechie commited on
Commit
9de6be7
·
verified ·
1 Parent(s): f0057d5

Upload folder using huggingface_hub

Browse files
README.md ADDED
@@ -0,0 +1,32 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pretty_name: OpenEnv Arena null control
4
+ tags:
5
+ - openenv
6
+ - openenv-arena
7
+ - reinforcement-learning
8
+ - control
9
+ ---
10
+
11
+ # OpenEnv Arena null control
12
+
13
+ This environment is a constant-reward pipeline control, not an entry. It teaches nothing on purpose.
14
+
15
+ Every episode has one step. Any action ends it with reward 0.5. All rollouts in a GRPO group get the same reward, so the advantage is zero on every step. The arena's public Trackio logs show loss 0 and grad_norm 0 on every zero-variance step (1,759 of 1,759 steps across 14 runs), so the gradient is zero on every step. Whether the recipe applies weight decay is not published.
16
+
17
+ The evaluated score of this run is one observation of the arena's train-and-evaluate path with no reward signal. It is not by itself a noise floor: one score cannot separate evaluation variability from changes the pipeline makes without a gradient. The prediction, registered before submission, is 2/40 with industrial 1 and office 1, the score of an earlier run that also logged zero gradient on every step. The control counts as valid only if its Trackio log shows reward 0.5, loss 0 and grad_norm 0 on every logged step.
18
+
19
+ ## Interface
20
+
21
+ - Task ids: `null` (one task, `train` split). See `tasks.jsonl`.
22
+ - Action: one JSON object; `answer` is optional, any JSON value, and ignored; extra keys are accepted. A reply that fails the schema ends the episode and is scored through `finish_action`, which also returns 0.5.
23
+ - Observation: a one-line prompt; `done` is true after the first action; `reward` is 0.5.
24
+
25
+ ## Reward
26
+
27
+ Constant 0.5. Nothing is checked.
28
+
29
+ ## Image and source
30
+
31
+ - Image: `ghcr.io/naklitechie/openenv-null-control:v1` (linux/amd64; the submission pins its digest).
32
+ - Source: `source/` in this dataset (server, Dockerfile, locked requirements, replay script, tests), pinned to OpenEnv `86a180ede21e044f7929b9a7783ad83aa67d83a3`. Build from `source/` with `DOCKER_DEFAULT_PLATFORM=linux/amd64 openenv build -t <ref>`.
source/models.py ADDED
@@ -0,0 +1,20 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Action and observation types for the null-control environment."""
2
+
3
+ from typing import Any
4
+
5
+ from openenv.core.env_server.types import Action, Observation
6
+ from pydantic import ConfigDict, Field
7
+
8
+
9
+ class NullAction(Action):
10
+ """Any reply ends the episode. Extra keys are accepted so no reply is a schema error."""
11
+
12
+ model_config = ConfigDict(extra="allow")
13
+
14
+ answer: Any = Field(default="", description="Ignored, any JSON value. Any action ends the episode.")
15
+
16
+
17
+ class NullObservation(Observation):
18
+ """Short text prompt; reward and done come from the base Observation."""
19
+
20
+ prompt: str = Field(default="", description="Instruction shown to the policy")
source/openenv.yaml ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ spec_version: 1
2
+ name: null_control
3
+ version: 0.1.0
4
+ type: space
5
+ runtime: fastapi
6
+ app: server.app:app
7
+ port: 8000
source/replay.py ADDED
@@ -0,0 +1,61 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Replay example actions over /ws and assert every episode ends done=True with reward 0.5.
2
+
3
+ Usage: python replay.py ws://127.0.0.1:8000/ws [log.json]
4
+ """
5
+ import asyncio
6
+ import json
7
+ import sys
8
+ from datetime import datetime, timezone
9
+
10
+ import websockets
11
+
12
+ TASK_IDS = ["null"]
13
+ ACTIONS = [
14
+ {"answer": "done"}, # example action (submission example_actions[0])
15
+ {}, # empty object
16
+ {"answer": "42", "tool": "calc", "x": 1}, # stray keys a policy may emit
17
+ {"answer": 0}, # non-string answer
18
+ {"answer": None}, # null answer
19
+ ]
20
+ # Replies that fail the schema never reach step(): the arena ends the episode and
21
+ # scores it through finish_action (guide, "How the model sees your environment").
22
+ REWARD = 0.5
23
+
24
+
25
+ async def episode(url, task_id, action):
26
+ async with websockets.connect(url) as ws:
27
+ await ws.send(json.dumps({"type": "reset", "data": {"task_id": task_id}}))
28
+ reset = json.loads(await ws.recv())
29
+ await ws.send(json.dumps({"type": "step", "data": action}))
30
+ step = json.loads(await ws.recv())
31
+ await ws.send(json.dumps({"type": "close"}))
32
+ return {"task_id": task_id, "action": action, "reset": reset, "step": step}
33
+
34
+
35
+ async def main(url, log_path):
36
+ results = []
37
+ for task_id in TASK_IDS:
38
+ for action in ACTIONS:
39
+ r = await episode(url, task_id, action)
40
+ data = r["step"].get("data", {})
41
+ r["ok"] = (r["reset"].get("type") == "observation" and r["step"].get("type") == "observation"
42
+ and data.get("done") is True and data.get("reward") == REWARD)
43
+ results.append(r)
44
+ print(("OK " if r["ok"] else "FAIL"), task_id, json.dumps(action), "->", json.dumps(data))
45
+ # One GRPO group: 5 rollouts of the same task in parallel sessions.
46
+ group = await asyncio.gather(*(episode(url, TASK_IDS[0], ACTIONS[0]) for _ in range(5)))
47
+ rewards = [g["step"].get("data", {}).get("reward") for g in group]
48
+ group_ok = all(g["step"].get("data", {}).get("done") is True for g in group) and rewards == [REWARD] * 5
49
+ print(("OK " if group_ok else "FAIL"), "concurrent group of 5 rewards", rewards)
50
+ results.append({"task_id": TASK_IDS[0], "concurrent_group_rewards": rewards, "ok": group_ok})
51
+ log = {"url": url, "at_utc": datetime.now(timezone.utc).isoformat(timespec="seconds"),
52
+ "episodes": results, "all_ok": all(r["ok"] for r in results)}
53
+ if log_path:
54
+ with open(log_path, "w") as f:
55
+ json.dump(log, f, indent=1)
56
+ f.write("\n")
57
+ return 0 if log["all_ok"] else 1
58
+
59
+
60
+ if __name__ == "__main__":
61
+ sys.exit(asyncio.run(main(sys.argv[1], sys.argv[2] if len(sys.argv) > 2 else None)))
source/requirements.in ADDED
@@ -0,0 +1 @@
 
 
1
+ openenv @ https://github.com/meta-pytorch/OpenEnv/archive/86a180ede21e044f7929b9a7783ad83aa67d83a3.tar.gz
source/requirements.lock ADDED
@@ -0,0 +1,358 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # This file was autogenerated by uv via the following command:
2
+ # uv pip compile requirements.in --python-version 3.11 --python-platform x86_64-manylinux_2_28 -o requirements.lock
3
+ aiofile==3.12.3
4
+ # via py-key-value-aio
5
+ annotated-doc==0.0.5
6
+ # via
7
+ # fastapi
8
+ # typer
9
+ annotated-types==0.8.0
10
+ # via pydantic
11
+ anyio==4.15.1
12
+ # via
13
+ # gradio
14
+ # httpx
15
+ # httpx2
16
+ # mcp
17
+ # openai
18
+ # py-key-value-aio
19
+ # sse-starlette
20
+ # starlette
21
+ # watchfiles
22
+ attrs==26.1.0
23
+ # via
24
+ # cyclopts
25
+ # jsonschema
26
+ # jsonschema-path
27
+ # referencing
28
+ authlib==1.8.0
29
+ # via fastmcp-slim
30
+ backports-tarfile==1.2.0
31
+ # via jaraco-context
32
+ beartype==0.22.9
33
+ # via py-key-value-aio
34
+ brotli==1.2.0
35
+ # via gradio
36
+ cachetools==7.2.1
37
+ # via py-key-value-aio
38
+ caio==0.12.9
39
+ # via aiofile
40
+ certifi==2026.7.22
41
+ # via
42
+ # httpcore
43
+ # httpx
44
+ # requests
45
+ cffi==2.1.1
46
+ # via cryptography
47
+ charset-normalizer==3.5.2
48
+ # via requests
49
+ click==8.5.0
50
+ # via
51
+ # huggingface-hub
52
+ # uvicorn
53
+ cryptography==50.0.2
54
+ # via
55
+ # authlib
56
+ # joserfc
57
+ # pyjwt
58
+ # secretstorage
59
+ cyclopts==5.2.0
60
+ # via fastmcp-slim
61
+ dnspython==2.9.0
62
+ # via email-validator
63
+ docstring-parser==0.18.0
64
+ # via cyclopts
65
+ email-validator==2.3.0
66
+ # via pydantic
67
+ exceptiongroup==1.3.1
68
+ # via fastmcp-slim
69
+ fastapi==0.143.0
70
+ # via
71
+ # gradio
72
+ # openenv
73
+ fastmcp==3.4.8
74
+ # via openenv
75
+ fastmcp-slim==3.4.8
76
+ # via fastmcp
77
+ filelock==4.1.0
78
+ # via huggingface-hub
79
+ fsspec==2026.9.0
80
+ # via
81
+ # gradio-client
82
+ # huggingface-hub
83
+ gradio==6.30.0
84
+ # via openenv
85
+ gradio-client==2.7.2
86
+ # via
87
+ # gradio
88
+ # hf-gradio
89
+ griffelib==2.3.2
90
+ # via fastmcp-slim
91
+ groovy==0.1.2
92
+ # via gradio
93
+ h11==0.16.0
94
+ # via
95
+ # httpcore
96
+ # httpcore2
97
+ # uvicorn
98
+ hf-gradio==0.4.1
99
+ # via gradio
100
+ hf-xet==1.7.0
101
+ # via huggingface-hub
102
+ httpcore==1.0.9
103
+ # via httpx
104
+ httpcore2==2.13.1
105
+ # via httpx2
106
+ httpx==0.28.1
107
+ # via
108
+ # fastmcp-slim
109
+ # gradio
110
+ # gradio-client
111
+ # mcp
112
+ # openenv
113
+ # safehttpx
114
+ httpx-sse==0.4.3
115
+ # via mcp
116
+ httpx2==2.13.1
117
+ # via
118
+ # huggingface-hub
119
+ # openai
120
+ huggingface-hub==2.2.0
121
+ # via
122
+ # gradio
123
+ # gradio-client
124
+ # openenv
125
+ idna==3.20
126
+ # via
127
+ # anyio
128
+ # email-validator
129
+ # httpx
130
+ # httpx2
131
+ # requests
132
+ importlib-metadata==9.0.1
133
+ # via keyring
134
+ jaraco-classes==3.4.0
135
+ # via keyring
136
+ jaraco-context==6.1.2
137
+ # via keyring
138
+ jaraco-functools==4.6.0
139
+ # via keyring
140
+ jeepney==0.9.0
141
+ # via
142
+ # keyring
143
+ # secretstorage
144
+ jinja2==3.1.6
145
+ # via gradio
146
+ jiter==0.17.0
147
+ # via openai
148
+ joserfc==1.7.5
149
+ # via
150
+ # authlib
151
+ # fastmcp-slim
152
+ jsonref==1.1.0
153
+ # via fastmcp-slim
154
+ jsonschema==4.26.0
155
+ # via mcp
156
+ jsonschema-path==0.5.0
157
+ # via fastmcp-slim
158
+ jsonschema-specifications==2025.9.1
159
+ # via jsonschema
160
+ keyring==25.7.0
161
+ # via py-key-value-aio
162
+ markdown-it-py==4.2.0
163
+ # via rich
164
+ markupsafe==3.0.4
165
+ # via
166
+ # gradio
167
+ # jinja2
168
+ mcp==1.30.0
169
+ # via fastmcp-slim
170
+ mdurl==0.1.2
171
+ # via markdown-it-py
172
+ more-itertools==11.1.0
173
+ # via
174
+ # jaraco-classes
175
+ # jaraco-functools
176
+ numpy==2.4.6
177
+ # via
178
+ # gradio
179
+ # pandas
180
+ openai==3.28.0
181
+ # via openenv
182
+ openapi-pydantic==0.6.0
183
+ # via fastmcp-slim
184
+ openenv @ https://github.com/meta-pytorch/OpenEnv/archive/86a180ede21e044f7929b9a7783ad83aa67d83a3.tar.gz
185
+ # via -r requirements.in
186
+ opentelemetry-api==1.45.1
187
+ # via
188
+ # fastapi
189
+ # fastmcp-slim
190
+ orjson==3.13.0
191
+ # via gradio
192
+ packaging==26.3
193
+ # via
194
+ # fastmcp-slim
195
+ # gradio
196
+ # gradio-client
197
+ # huggingface-hub
198
+ # openenv
199
+ pandas==3.0.6
200
+ # via gradio
201
+ pathable==0.6.0
202
+ # via jsonschema-path
203
+ pillow==12.3.0
204
+ # via gradio
205
+ platformdirs==4.12.4
206
+ # via fastmcp-slim
207
+ py-key-value-aio==0.4.6
208
+ # via fastmcp-slim
209
+ pycparser==3.11
210
+ # via cffi
211
+ pydantic==2.14.0
212
+ # via
213
+ # fastapi
214
+ # fastmcp-slim
215
+ # gradio
216
+ # mcp
217
+ # openai
218
+ # openapi-pydantic
219
+ # openenv
220
+ # pydantic-settings
221
+ pydantic-core==2.50.0
222
+ # via pydantic
223
+ pydantic-settings==2.15.0
224
+ # via
225
+ # fastmcp-slim
226
+ # mcp
227
+ pydub==0.25.1
228
+ # via gradio
229
+ pygments==2.21.0
230
+ # via
231
+ # rich
232
+ # rich-rst
233
+ pyjwt==2.15.1
234
+ # via mcp
235
+ pyperclip==1.11.0
236
+ # via fastmcp-slim
237
+ python-dateutil==2.9.0.post0
238
+ # via pandas
239
+ python-dotenv==1.2.4
240
+ # via
241
+ # fastmcp-slim
242
+ # pydantic-settings
243
+ python-multipart==0.0.32
244
+ # via
245
+ # fastmcp-slim
246
+ # gradio
247
+ # mcp
248
+ pytz==2026.5
249
+ # via gradio
250
+ pyyaml==6.0.3
251
+ # via
252
+ # fastmcp-slim
253
+ # gradio
254
+ # huggingface-hub
255
+ # jsonschema-path
256
+ # openenv
257
+ referencing==0.37.0
258
+ # via
259
+ # jsonschema
260
+ # jsonschema-path
261
+ # jsonschema-specifications
262
+ requests==2.34.2
263
+ # via openenv
264
+ rich==15.0.0
265
+ # via
266
+ # cyclopts
267
+ # fastmcp-slim
268
+ # openenv
269
+ # rich-rst
270
+ # typer
271
+ rich-rst==2.2.0
272
+ # via cyclopts
273
+ rpds-py==2026.9.1
274
+ # via
275
+ # jsonschema
276
+ # referencing
277
+ safehttpx==0.1.7
278
+ # via gradio
279
+ secretstorage==3.5.0
280
+ # via keyring
281
+ semantic-version==2.10.0
282
+ # via gradio
283
+ shellingham==1.5.4
284
+ # via typer
285
+ six==1.17.0
286
+ # via python-dateutil
287
+ sniffio==1.3.1
288
+ # via openai
289
+ sse-starlette==3.5.0
290
+ # via mcp
291
+ starlette==1.7.0
292
+ # via
293
+ # fastapi
294
+ # fastmcp-slim
295
+ # gradio
296
+ # mcp
297
+ # sse-starlette
298
+ tomli==2.5.0
299
+ # via openenv
300
+ tomli-w==1.2.0
301
+ # via openenv
302
+ tomlkit==0.14.0
303
+ # via gradio
304
+ tqdm==4.70.1
305
+ # via huggingface-hub
306
+ truststore==0.10.4
307
+ # via
308
+ # httpcore2
309
+ # httpx2
310
+ typer==0.27.3
311
+ # via
312
+ # gradio
313
+ # hf-gradio
314
+ # openenv
315
+ typing-extensions==4.16.0
316
+ # via
317
+ # anyio
318
+ # exceptiongroup
319
+ # fastapi
320
+ # fastmcp-slim
321
+ # gradio
322
+ # gradio-client
323
+ # httpx2
324
+ # huggingface-hub
325
+ # mcp
326
+ # openai
327
+ # openenv
328
+ # opentelemetry-api
329
+ # py-key-value-aio
330
+ # pydantic
331
+ # pydantic-core
332
+ # referencing
333
+ # starlette
334
+ # typing-inspection
335
+ typing-inspection==0.4.4
336
+ # via
337
+ # fastapi
338
+ # mcp
339
+ # pydantic
340
+ # pydantic-settings
341
+ uncalled-for==0.4.1
342
+ # via fastmcp-slim
343
+ urllib3==2.8.0
344
+ # via requests
345
+ uvicorn==0.54.0
346
+ # via
347
+ # fastmcp-slim
348
+ # gradio
349
+ # mcp
350
+ # openenv
351
+ watchfiles==1.3.0
352
+ # via fastmcp-slim
353
+ websockets==17.2
354
+ # via
355
+ # fastmcp-slim
356
+ # openenv
357
+ zipp==4.1.1
358
+ # via importlib-metadata
source/server/Dockerfile ADDED
@@ -0,0 +1,18 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Null-control OpenEnv server. Build from envs/null:
2
+ # DOCKER_DEFAULT_PLATFORM=linux/amd64 openenv build -t <ref>
3
+ FROM python:3.11-slim@sha256:e88e9763f943ec1834f992a4b51e0f24500486803e8bc534e5767af9ea65f6ce
4
+
5
+ WORKDIR /app
6
+ COPY requirements.lock /app/requirements.lock
7
+ RUN pip install --no-cache-dir -r /app/requirements.lock \
8
+ && useradd --uid 10001 --no-create-home --shell /usr/sbin/nologin env
9
+
10
+ COPY models.py /app/models.py
11
+ COPY server /app/server
12
+
13
+ LABEL org.opencontainers.image.source="https://github.com/NakliTechie/openenv-arena" \
14
+ org.opencontainers.image.description="OpenEnv Arena null control: constant reward 0.5, zero GRPO advantage"
15
+
16
+ USER env
17
+ EXPOSE 8000
18
+ CMD ["uvicorn", "server.app:app", "--host", "0.0.0.0", "--port", "8000"]
source/server/__init__.py ADDED
File without changes
source/server/app.py ADDED
@@ -0,0 +1,12 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """FastAPI app for the null-control environment (HTTP + /ws)."""
2
+
3
+ from openenv.core.env_server.http_server import create_app
4
+
5
+ try:
6
+ from ..models import NullAction, NullObservation
7
+ from .environment import NullEnvironment
8
+ except ImportError:
9
+ from models import NullAction, NullObservation
10
+ from server.environment import NullEnvironment
11
+
12
+ app = create_app(NullEnvironment, NullAction, NullObservation, env_name="null_control", max_concurrent_envs=16)
source/server/environment.py ADDED
@@ -0,0 +1,44 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """Null-control environment: every episode ends after one action with the same reward.
2
+
3
+ Every rollout in a GRPO group gets REWARD, so within-group variance and the
4
+ advantage are zero on every step. Purpose: measure the arena's evaluation with
5
+ no learning signal (plan/research/design.md, Batch B).
6
+ """
7
+
8
+ from uuid import uuid4
9
+
10
+ from openenv.core.env_server.interfaces import Environment
11
+ from openenv.core.env_server.types import State
12
+
13
+ try:
14
+ from ..models import NullAction, NullObservation
15
+ except ImportError:
16
+ from models import NullAction, NullObservation
17
+
18
+ REWARD = 0.5
19
+ TASK_IDS = ("null",)
20
+ PROMPT = 'Reply with one JSON object: {"answer": "done"}. Any reply ends the episode.'
21
+
22
+
23
+ class NullEnvironment(Environment):
24
+ SUPPORTS_CONCURRENT_SESSIONS: bool = True
25
+
26
+ def __init__(self):
27
+ self._state = State(episode_id=str(uuid4()), step_count=0)
28
+ self._done = False
29
+
30
+ def reset(self, seed=None, episode_id=None, task_id=None, **kwargs) -> NullObservation:
31
+ if task_id is not None and task_id not in TASK_IDS:
32
+ raise ValueError(f"unknown task_id {task_id!r}; known: {list(TASK_IDS)}")
33
+ self._state = State(episode_id=episode_id or str(uuid4()), step_count=0)
34
+ self._done = False
35
+ return NullObservation(prompt=PROMPT, done=False, reward=0.0)
36
+
37
+ def step(self, action: NullAction, timeout_s=None, **kwargs) -> NullObservation: # type: ignore[override]
38
+ self._state.step_count += 1
39
+ self._done = True
40
+ return NullObservation(prompt="Episode over.", done=True, reward=REWARD)
41
+
42
+ @property
43
+ def state(self) -> State:
44
+ return self._state
source/tests/test_null.py ADDED
@@ -0,0 +1,35 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ """In-process checks: every action ends the episode with the same reward. Run: python -m unittest discover -s tests"""
2
+ import sys
3
+ import unittest
4
+ from pathlib import Path
5
+
6
+ sys.path.insert(0, str(Path(__file__).resolve().parent.parent))
7
+
8
+ from models import NullAction # noqa: E402
9
+ from server.environment import REWARD, NullEnvironment # noqa: E402
10
+
11
+
12
+ class NullEnvTest(unittest.TestCase):
13
+ def test_reset_is_not_terminal(self):
14
+ obs = NullEnvironment().reset(task_id="null")
15
+ self.assertFalse(obs.done)
16
+ self.assertLess(len(obs.prompt), 200)
17
+
18
+ def test_every_action_gives_constant_reward(self):
19
+ for payload in ({"answer": "done"}, {}, {"answer": "x", "tool": "calc", "n": 3}, {"answer": 0}, {"answer": None}):
20
+ env = NullEnvironment()
21
+ env.reset(task_id="null")
22
+ obs = env.step(NullAction.model_validate(payload))
23
+ self.assertTrue(obs.done)
24
+ self.assertEqual(obs.reward, REWARD)
25
+
26
+ def test_reward_is_half(self):
27
+ self.assertEqual(REWARD, 0.5)
28
+
29
+ def test_unknown_task_rejected(self):
30
+ with self.assertRaises(ValueError):
31
+ NullEnvironment().reset(task_id="other")
32
+
33
+
34
+ if __name__ == "__main__":
35
+ unittest.main()
tasks.jsonl ADDED
@@ -0,0 +1 @@
 
 
1
+ {"task_id": "null", "split": "train", "prompt": "Reply with one JSON object: {\"answer\": \"done\"}. Any reply ends the episode.", "reward": 0.5}