s3-maze: 32 trees from seed 115, the maze service, the grader, the move budget (210) and the checks (huggingface/flock#115) (part 3)
Browse files- tasks/maze-t31/tests/Dockerfile +5 -0
- tasks/maze-t31/tests/expected.json +6 -0
- tasks/maze-t31/tests/grade.py +117 -0
- tasks/maze-t31/tests/test.sh +12 -0
- tasks/maze-t32/environment/agent/Dockerfile +8 -0
- tasks/maze-t32/environment/agent/maze +53 -0
- tasks/maze-t32/environment/docker-compose.yaml +25 -0
- tasks/maze-t32/environment/maze/Dockerfile +9 -0
- tasks/maze-t32/environment/maze/engine.py +93 -0
- tasks/maze-t32/environment/maze/export.py +40 -0
- tasks/maze-t32/environment/maze/service.py +167 -0
- tasks/maze-t32/environment/maze/success.py +29 -0
- tasks/maze-t32/environment/maze/tree.json +1569 -0
- tasks/maze-t32/instruction.md +26 -0
- tasks/maze-t32/solution/solve.sh +7 -0
- tasks/maze-t32/task.toml +48 -0
- tasks/maze-t32/tests/Dockerfile +5 -0
- tasks/maze-t32/tests/expected.json +6 -0
- tasks/maze-t32/tests/grade.py +117 -0
- tasks/maze-t32/tests/test.sh +12 -0
- template/environment/agent/Dockerfile +8 -0
- template/environment/agent/maze +53 -0
- template/environment/maze/Dockerfile +9 -0
- template/environment/maze/engine.py +93 -0
- template/environment/maze/export.py +40 -0
- template/environment/maze/service.py +167 -0
- template/environment/maze/success.py +29 -0
- template/tests/Dockerfile +5 -0
- template/tests/grade.py +117 -0
- template/tests/test.sh +12 -0
tasks/maze-t31/tests/Dockerfile
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.13-slim-bookworm@sha256:281d39ff02e3b389401586134ff9e6572954687822a58055ec07a60ded4e0b7f
|
| 2 |
+
# The verifier's own container (environment_mode = "separate"): the grader and the task's
|
| 3 |
+
# answer, never in the agent's container. Harbor adds /evidence from the maze service.
|
| 4 |
+
COPY test.sh grade.py expected.json /tests/
|
| 5 |
+
RUN chmod 755 /tests/test.sh
|
tasks/maze-t31/tests/expected.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"start": "R2357",
|
| 3 |
+
"exit": "R7718",
|
| 4 |
+
"budget": 210,
|
| 5 |
+
"tree_sha256": "5b61772311485303b02c6afbbb9cb03b024ff75b5df6f0494b4634ea23a3d6e3"
|
| 6 |
+
}
|
tasks/maze-t31/tests/grade.py
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""s3-maze's grader: reward 1 if the agent's walk reached the exit, from the maze service's own
|
| 2 |
+
record. Run by test.sh as `python3 -I -S grade.py`, in a fresh verifier container (the task's
|
| 3 |
+
`environment_mode = "separate"`), after the agent's container has stopped.
|
| 4 |
+
|
| 5 |
+
It reads only /evidence/final.json and /evidence/moves.jsonl, which the maze service exported
|
| 6 |
+
(export.py, Harbor's collect hook) and Harbor carried over, and expected.json (this folder,
|
| 7 |
+
never in the agent's container). Reward 1 needs all of: the export is the service's
|
| 8 |
+
(`exported_by`), for this task's tree (its sha256), start and move budget; the service says the
|
| 9 |
+
exit was reached and the walk ends there; and the move log's accepted moves are one unbroken
|
| 10 |
+
walk from the start to the exit, within the budget, as many as the service counted. Anything
|
| 11 |
+
else, a missing, unreadable or malformed file included, scores 0.
|
| 12 |
+
|
| 13 |
+
Each file counts only as a regular file of its own at exactly its path: no link anywhere on the
|
| 14 |
+
path is followed, and a FIFO cannot block the read. The reward file is written 0 first and
|
| 15 |
+
never through a link. Copies of both files stay in the verifier's folder, for the metrics.
|
| 16 |
+
EVIDENCE_DIR, EXPECTED and VERIFIER_DIR override the paths (no links in them), to test locally.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
import json
|
| 20 |
+
import os
|
| 21 |
+
import stat
|
| 22 |
+
|
| 23 |
+
EVIDENCE = os.environ.get("EVIDENCE_DIR", "/evidence")
|
| 24 |
+
EXPECTED = os.environ.get("EXPECTED", "/tests/expected.json")
|
| 25 |
+
VERIFIER = os.environ.get("VERIFIER_DIR", "/logs/verifier")
|
| 26 |
+
LIMIT = 16 << 20 # bytes
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def read_own(path: str) -> bytes:
|
| 30 |
+
"""The bytes of the regular file at exactly `path`: every folder on the way is opened
|
| 31 |
+
without following a link, and so is the file (a FIFO cannot block it); one link only."""
|
| 32 |
+
parts = os.path.abspath(path).split("/")[1:]
|
| 33 |
+
folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY)
|
| 34 |
+
try:
|
| 35 |
+
for part in parts[:-1]:
|
| 36 |
+
inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder)
|
| 37 |
+
os.close(folder)
|
| 38 |
+
folder = inner
|
| 39 |
+
fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder)
|
| 40 |
+
finally:
|
| 41 |
+
os.close(folder)
|
| 42 |
+
with os.fdopen(fd, "rb") as stream:
|
| 43 |
+
info = os.fstat(stream.fileno())
|
| 44 |
+
if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1:
|
| 45 |
+
raise ValueError("not a regular file of its own")
|
| 46 |
+
data = stream.read(LIMIT + 1)
|
| 47 |
+
if len(data) > LIMIT:
|
| 48 |
+
raise ValueError("too large")
|
| 49 |
+
return data
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def write_new(name: str, data: bytes) -> None:
|
| 53 |
+
path = os.path.join(VERIFIER, name)
|
| 54 |
+
try:
|
| 55 |
+
os.unlink(path) # never written through a link
|
| 56 |
+
except FileNotFoundError:
|
| 57 |
+
pass
|
| 58 |
+
fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644)
|
| 59 |
+
with os.fdopen(fd, "wb") as stream:
|
| 60 |
+
stream.write(data)
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def reject_constant(name):
|
| 64 |
+
raise ValueError(f"{name} is not JSON")
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def parse(data: bytes):
|
| 68 |
+
return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def walk_reaches_exit(final: dict, records: list, expected: dict) -> bool:
|
| 72 |
+
room, moves = expected["start"], 0
|
| 73 |
+
for record in records:
|
| 74 |
+
if not isinstance(record, dict) or record.get("ok") not in (True, False):
|
| 75 |
+
return False
|
| 76 |
+
if record["ok"] is True:
|
| 77 |
+
if record.get("from") != room or not isinstance(record.get("to"), str):
|
| 78 |
+
return False
|
| 79 |
+
room, moves = record["to"], moves + 1
|
| 80 |
+
return (room == expected["exit"] and moves == final.get("moves")
|
| 81 |
+
and 0 < moves <= expected["budget"])
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
def grade() -> bool:
|
| 85 |
+
expected = parse(read_own(EXPECTED))
|
| 86 |
+
final_data = read_own(os.path.join(EVIDENCE, "final.json"))
|
| 87 |
+
moves_data = read_own(os.path.join(EVIDENCE, "moves.jsonl"))
|
| 88 |
+
write_new("final.json", final_data)
|
| 89 |
+
write_new("moves.jsonl", moves_data)
|
| 90 |
+
final = parse(final_data)
|
| 91 |
+
records = [parse(line) for line in moves_data.splitlines() if line.strip()]
|
| 92 |
+
return (
|
| 93 |
+
isinstance(final, dict)
|
| 94 |
+
and final.get("exported_by") == "maze"
|
| 95 |
+
and final.get("tree_sha256") == expected["tree_sha256"]
|
| 96 |
+
and final.get("start") == expected["start"]
|
| 97 |
+
and final.get("budget") == expected["budget"]
|
| 98 |
+
and final.get("reached") is True
|
| 99 |
+
and final.get("room") == expected["exit"]
|
| 100 |
+
and walk_reaches_exit(final, records, expected)
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
os.makedirs(VERIFIER, exist_ok=True)
|
| 105 |
+
for name in ("reward.txt", "reward.json"):
|
| 106 |
+
try:
|
| 107 |
+
os.unlink(os.path.join(VERIFIER, name))
|
| 108 |
+
except FileNotFoundError:
|
| 109 |
+
pass
|
| 110 |
+
write_new("reward.txt", b"0")
|
| 111 |
+
try:
|
| 112 |
+
valid = grade()
|
| 113 |
+
except Exception: # missing, a link, not regular, invalid UTF-8 or JSON, a wrong shape
|
| 114 |
+
valid = False
|
| 115 |
+
if valid:
|
| 116 |
+
write_new("reward.txt", b"1")
|
| 117 |
+
print("reward:", 1 if valid else 0)
|
tasks/maze-t31/tests/test.sh
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# s3-maze's verifier, in a fresh container built from this folder (environment_mode =
|
| 3 |
+
# "separate"): reward 1 if the maze service's own record shows the agent's walk reached the exit
|
| 4 |
+
# (grade.py has the rules). Reward 0 is written before anything is checked, so a crash of the
|
| 5 |
+
# check also scores 0. Python runs isolated (-I -S): no module from the working directory,
|
| 6 |
+
# PYTHON* variables or site hooks can change what it imports. Besides bash, python3 is the only
|
| 7 |
+
# command this script runs.
|
| 8 |
+
case $0 in */*) here=${0%/*} ;; *) here=. ;; esac
|
| 9 |
+
export EXPECTED=${EXPECTED:-$here/expected.json}
|
| 10 |
+
export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}
|
| 11 |
+
[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"
|
| 12 |
+
python3 -I -S "$here/grade.py" || true
|
tasks/maze-t32/environment/agent/Dockerfile
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.13-slim-bookworm@sha256:281d39ff02e3b389401586134ff9e6572954687822a58055ec07a60ded4e0b7f
|
| 2 |
+
# The agent's container: only the `maze` command, which talks to the maze service. The tree and
|
| 3 |
+
# the exit are never here.
|
| 4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates \
|
| 5 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 6 |
+
COPY maze /usr/local/bin/maze
|
| 7 |
+
RUN chmod 755 /usr/local/bin/maze
|
| 8 |
+
WORKDIR /app
|
tasks/maze-t32/environment/agent/maze
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""maze look | maze move ROOM: explore the maze through its service (standard library only).
|
| 3 |
+
|
| 4 |
+
Prints the service's JSON for your current room: `room`, its `doors`, whether it is the `exit`,
|
| 5 |
+
the room you `arrived_from` and your `moves_left` (a dead end adds a `notice`). A refused move
|
| 6 |
+
adds an `error` and exits 1; the service unreachable exits 2.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
import json
|
| 10 |
+
import os
|
| 11 |
+
import sys
|
| 12 |
+
import time
|
| 13 |
+
import urllib.error
|
| 14 |
+
import urllib.request
|
| 15 |
+
|
| 16 |
+
URL = os.environ.get("MAZE_URL", "http://maze:8000").rstrip("/")
|
| 17 |
+
USAGE = "usage: maze look | maze move ROOM"
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def call(request: urllib.request.Request) -> tuple[int, dict]:
|
| 21 |
+
deadline = time.monotonic() + 30 # the service may still be starting
|
| 22 |
+
while True:
|
| 23 |
+
try:
|
| 24 |
+
with urllib.request.urlopen(request, timeout=30) as response:
|
| 25 |
+
return response.status, json.load(response)
|
| 26 |
+
except urllib.error.HTTPError as e:
|
| 27 |
+
try:
|
| 28 |
+
return e.code, json.load(e)
|
| 29 |
+
except ValueError:
|
| 30 |
+
return e.code, {"error": f"HTTP {e.code} from the maze service"}
|
| 31 |
+
except (urllib.error.URLError, ConnectionError, TimeoutError) as e:
|
| 32 |
+
if time.monotonic() > deadline:
|
| 33 |
+
return 0, {"error": f"the maze service is unreachable: {e}"}
|
| 34 |
+
time.sleep(1)
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main(argv: list[str]) -> int:
|
| 38 |
+
if argv == ["look"]:
|
| 39 |
+
request = urllib.request.Request(URL + "/look")
|
| 40 |
+
elif len(argv) == 2 and argv[0] == "move":
|
| 41 |
+
request = urllib.request.Request(
|
| 42 |
+
URL + "/move", data=json.dumps({"room": argv[1]}).encode(), method="POST",
|
| 43 |
+
headers={"Content-Type": "application/json"})
|
| 44 |
+
else:
|
| 45 |
+
print(USAGE, file=sys.stderr)
|
| 46 |
+
return 2
|
| 47 |
+
status, body = call(request)
|
| 48 |
+
print(json.dumps(body))
|
| 49 |
+
return 0 if status == 200 else 1 if status in (400, 409) else 2
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
if __name__ == "__main__":
|
| 53 |
+
sys.exit(main(sys.argv[1:]))
|
tasks/maze-t32/environment/docker-compose.yaml
ADDED
|
@@ -0,0 +1,25 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# maze-t32: the agent's container (main) and its own maze service. The service holds
|
| 2 |
+
# the tree and answers only `maze look` and `maze move ROOM`, on a network only main reaches.
|
| 3 |
+
services:
|
| 4 |
+
main:
|
| 5 |
+
image: s3-maze-agent:7ecf229faaac
|
| 6 |
+
build:
|
| 7 |
+
context: ./agent
|
| 8 |
+
networks: [default, maze]
|
| 9 |
+
security_opt: [no-new-privileges:true]
|
| 10 |
+
depends_on: [maze]
|
| 11 |
+
maze:
|
| 12 |
+
image: s3-maze-service:maze-t32-adeaa1e513d1
|
| 13 |
+
build:
|
| 14 |
+
context: ./maze
|
| 15 |
+
networks: [maze]
|
| 16 |
+
environment:
|
| 17 |
+
MAZE_AGENT: ${COMPOSE_PROJECT_NAME:-} # the Trial, for the move log
|
| 18 |
+
cap_drop: [ALL]
|
| 19 |
+
security_opt: [no-new-privileges:true]
|
| 20 |
+
pids_limit: 64
|
| 21 |
+
mem_limit: 256m
|
| 22 |
+
networks:
|
| 23 |
+
default: {} # main's way out (Flock replaces it with the agent's own network)
|
| 24 |
+
maze:
|
| 25 |
+
internal: true
|
tasks/maze-t32/environment/maze/Dockerfile
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.13-slim-bookworm@sha256:281d39ff02e3b389401586134ff9e6572954687822a58055ec07a60ded4e0b7f
|
| 2 |
+
# The maze service: the tree (private, never in the agent's container), the walk's state and
|
| 3 |
+
# move log, the success check and the collect hook. Standard library only.
|
| 4 |
+
COPY engine.py service.py success.py export.py /app/
|
| 5 |
+
COPY tree.json /private/tree.json
|
| 6 |
+
RUN mkdir -p /var/lib/maze /evidence && chmod 0700 /private /var/lib/maze
|
| 7 |
+
ENV MAZE_TREE=/private/tree.json MAZE_STATE_DIR=/var/lib/maze
|
| 8 |
+
WORKDIR /app
|
| 9 |
+
CMD ["python3", "-I", "-S", "-B", "/app/service.py"]
|
tasks/maze-t32/environment/maze/engine.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""The maze: one agent's walk through its own copy of a tree of rooms (s3-maze).
|
| 2 |
+
|
| 3 |
+
The service (service.py) holds one Walk per Trial; budget.py simulates searches on this same
|
| 4 |
+
code. Python 3.10+, standard library only.
|
| 5 |
+
|
| 6 |
+
A tree is `{"start", "exit", "budget", "doors": {room: [neighbour, ...]}}`: each room lists its
|
| 7 |
+
doors in the order fixed when the tree was generated, the same for every agent and every visit.
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
import json
|
| 11 |
+
|
| 12 |
+
DEAD_END = "Dead end: its only door leads back the way you came."
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class Maze:
|
| 16 |
+
def __init__(self, tree: dict):
|
| 17 |
+
self.start = tree["start"]
|
| 18 |
+
self.exit = tree["exit"]
|
| 19 |
+
self.budget = int(tree["budget"])
|
| 20 |
+
self.doors = {room: list(doors) for room, doors in tree["doors"].items()}
|
| 21 |
+
|
| 22 |
+
@classmethod
|
| 23 |
+
def load(cls, path: str) -> "Maze":
|
| 24 |
+
with open(path, encoding="utf-8") as f:
|
| 25 |
+
return cls(json.load(f))
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class Walk:
|
| 29 |
+
"""One agent's position and its accepted moves. Looking is free; a refused move costs
|
| 30 |
+
nothing; at most `budget` moves are accepted, and none once the exit is reached."""
|
| 31 |
+
|
| 32 |
+
def __init__(self, maze: Maze, room: str | None = None, arrived_from: str | None = None,
|
| 33 |
+
moves: int = 0, refused: int = 0):
|
| 34 |
+
self.maze = maze
|
| 35 |
+
self.room = room or maze.start
|
| 36 |
+
self.arrived_from = arrived_from
|
| 37 |
+
self.moves = moves
|
| 38 |
+
self.refused = refused
|
| 39 |
+
|
| 40 |
+
@property
|
| 41 |
+
def reached(self) -> bool:
|
| 42 |
+
return self.room == self.maze.exit
|
| 43 |
+
|
| 44 |
+
def look(self) -> dict:
|
| 45 |
+
"""The paper's observation (s3, Appendix H), plus the moves left."""
|
| 46 |
+
doors = self.maze.doors[self.room]
|
| 47 |
+
out = {"room": self.room, "doors": list(doors), "exit": self.reached,
|
| 48 |
+
"arrived_from": self.arrived_from, "moves_left": self.maze.budget - self.moves}
|
| 49 |
+
if len(doors) == 1 and not self.reached:
|
| 50 |
+
out["notice"] = DEAD_END
|
| 51 |
+
return out
|
| 52 |
+
|
| 53 |
+
def refusal(self, room) -> str | None:
|
| 54 |
+
"""Why a move into `room` is refused (a short code), or None."""
|
| 55 |
+
if self.reached:
|
| 56 |
+
return "at_exit"
|
| 57 |
+
if self.moves >= self.maze.budget:
|
| 58 |
+
return "no_moves_left"
|
| 59 |
+
if not isinstance(room, str) or room not in self.maze.doors[self.room]:
|
| 60 |
+
return "not_a_door"
|
| 61 |
+
return None
|
| 62 |
+
|
| 63 |
+
def move(self, room) -> tuple[dict, str | None]:
|
| 64 |
+
"""(the observation after moving into `room`, None), or (an error and the current
|
| 65 |
+
observation, the refusal's code)."""
|
| 66 |
+
why = self.refusal(room)
|
| 67 |
+
if why is not None:
|
| 68 |
+
self.refused += 1
|
| 69 |
+
return {"error": MESSAGES[why].format(room=_short(room), here=self.room,
|
| 70 |
+
budget=self.maze.budget), **self.look()}, why
|
| 71 |
+
self.arrived_from, self.room = self.room, room
|
| 72 |
+
self.moves += 1
|
| 73 |
+
return self.look(), None
|
| 74 |
+
|
| 75 |
+
def state(self) -> dict:
|
| 76 |
+
return {"room": self.room, "arrived_from": self.arrived_from, "moves": self.moves,
|
| 77 |
+
"refused": self.refused, "reached": self.reached}
|
| 78 |
+
|
| 79 |
+
@classmethod
|
| 80 |
+
def from_state(cls, maze: Maze, state: dict) -> "Walk":
|
| 81 |
+
return cls(maze, state["room"], state["arrived_from"], state["moves"], state["refused"])
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
MESSAGES = {
|
| 85 |
+
"at_exit": "You are at the exit: the task is solved.",
|
| 86 |
+
"no_moves_left": "No moves left: your budget of {budget} moves is used up.",
|
| 87 |
+
"not_a_door": "{room} is not a door of {here}: move into one of the doors listed for it.",
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
def _short(value) -> str:
|
| 92 |
+
text = value if isinstance(value, str) else json.dumps(value)
|
| 93 |
+
return text if len(text) <= 40 else text[:40] + "..."
|
tasks/maze-t32/environment/maze/export.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Harbor's [[verifier.collect]] hook for s3-maze, run in this maze service once the agent is done
|
| 2 |
+
(its container already stopped): `python3 -I -S /app/export.py`.
|
| 3 |
+
|
| 4 |
+
Writes the service's own record of the walk to /evidence, which Harbor collects as artifacts
|
| 5 |
+
and hands to the grader in a fresh container: `final.json` (the state file, marked as exported
|
| 6 |
+
here) and `moves.jsonl` (the move log). Nothing in /evidence comes from the agent's container.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
import json
|
| 10 |
+
import os
|
| 11 |
+
|
| 12 |
+
STATE_DIR = os.environ.get("MAZE_STATE_DIR", "/var/lib/maze")
|
| 13 |
+
EVIDENCE = os.environ.get("MAZE_EVIDENCE_DIR", "/evidence")
|
| 14 |
+
LIMIT = 16 << 20
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def read(name: str) -> bytes:
|
| 18 |
+
fd = os.open(os.path.join(STATE_DIR, name), os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK)
|
| 19 |
+
with os.fdopen(fd, "rb") as f:
|
| 20 |
+
return f.read(LIMIT)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def write(name: str, data: bytes) -> None:
|
| 24 |
+
path = os.path.join(EVIDENCE, name)
|
| 25 |
+
temp = path + ".tmp"
|
| 26 |
+
fd = os.open(temp, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644)
|
| 27 |
+
with os.fdopen(fd, "wb") as f:
|
| 28 |
+
f.write(data)
|
| 29 |
+
os.replace(temp, path)
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
os.makedirs(EVIDENCE, exist_ok=True)
|
| 33 |
+
state = json.loads(read("state.json"))
|
| 34 |
+
try:
|
| 35 |
+
moves = read("moves.jsonl")
|
| 36 |
+
except FileNotFoundError: # no move was ever asked for
|
| 37 |
+
moves = b""
|
| 38 |
+
write("moves.jsonl", moves)
|
| 39 |
+
write("final.json", json.dumps({**state, "exported_by": "maze"}).encode())
|
| 40 |
+
print("exported", state.get("moves"), "moves; exit reached:", state.get("reached"))
|
tasks/maze-t32/environment/maze/service.py
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""The maze service: one agent's own copy of the maze, behind `maze look` and `maze move ROOM`.
|
| 2 |
+
|
| 3 |
+
Two routes answer, `GET /look` and `POST /move` (`{"room": <a door>}`), each with the current
|
| 4 |
+
room's observation (engine.Walk.look); every other request gets a 404 that names nothing. So the
|
| 5 |
+
tree and the exit stay in this container: an agent learns a room's doors only by standing in it,
|
| 6 |
+
and that a room is the exit only by reaching it.
|
| 7 |
+
|
| 8 |
+
Every move, accepted or refused, is appended to the move log (agent, from, to, time) before it is
|
| 9 |
+
answered, and the walk's state file is replaced after it: success.py (flock's success_check)
|
| 10 |
+
and export.py (Harbor's collect hook, for the grader) read those two files. A restarted
|
| 11 |
+
container resumes from them. Python 3.10+, standard library only.
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
import hashlib
|
| 15 |
+
import json
|
| 16 |
+
import os
|
| 17 |
+
import sys
|
| 18 |
+
import threading
|
| 19 |
+
from datetime import datetime, timezone
|
| 20 |
+
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
| 21 |
+
|
| 22 |
+
sys.dont_write_bytecode = True # -I ignores PYTHONDONTWRITEBYTECODE
|
| 23 |
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
| 24 |
+
from engine import Maze, Walk # noqa: E402
|
| 25 |
+
|
| 26 |
+
TREE = os.environ.get("MAZE_TREE", "/private/tree.json")
|
| 27 |
+
STATE_DIR = os.environ.get("MAZE_STATE_DIR", "/var/lib/maze")
|
| 28 |
+
PORT = int(os.environ.get("MAZE_PORT", "8000"))
|
| 29 |
+
# The Trial whose maze this is: compose's project name, `<swarm>-<agent>-tN__env`
|
| 30 |
+
AGENT = os.environ.get("MAZE_AGENT", "").removesuffix("__env") or "agent"
|
| 31 |
+
BODY_LIMIT = 4096
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def now() -> str:
|
| 35 |
+
return datetime.now(timezone.utc).isoformat(timespec="milliseconds")
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
class Service:
|
| 39 |
+
def __init__(self, tree_path: str, state_dir: str, agent: str):
|
| 40 |
+
with open(tree_path, "rb") as f:
|
| 41 |
+
raw = f.read()
|
| 42 |
+
self.maze = Maze(json.loads(raw))
|
| 43 |
+
self.tree_sha256 = hashlib.sha256(raw).hexdigest()
|
| 44 |
+
self.agent = agent
|
| 45 |
+
self.state_path = os.path.join(state_dir, "state.json")
|
| 46 |
+
self.log_path = os.path.join(state_dir, "moves.jsonl")
|
| 47 |
+
self.lock = threading.Lock()
|
| 48 |
+
os.makedirs(state_dir, exist_ok=True)
|
| 49 |
+
self.reached_at = None
|
| 50 |
+
if os.path.exists(self.state_path): # a restarted container
|
| 51 |
+
with open(self.state_path, encoding="utf-8") as f:
|
| 52 |
+
saved = json.load(f)
|
| 53 |
+
self.walk = Walk.from_state(self.maze, saved)
|
| 54 |
+
self.reached_at = saved.get("reached_at")
|
| 55 |
+
else:
|
| 56 |
+
self.walk = Walk(self.maze)
|
| 57 |
+
self.save()
|
| 58 |
+
|
| 59 |
+
def save(self) -> None:
|
| 60 |
+
state = {"agent": self.agent, "start": self.maze.start, "budget": self.maze.budget,
|
| 61 |
+
"tree_sha256": self.tree_sha256, **self.walk.state(),
|
| 62 |
+
"reached_at": self.reached_at}
|
| 63 |
+
temp = self.state_path + ".tmp"
|
| 64 |
+
with open(temp, "w", encoding="utf-8") as f:
|
| 65 |
+
json.dump(state, f)
|
| 66 |
+
f.flush()
|
| 67 |
+
os.fsync(f.fileno())
|
| 68 |
+
os.replace(temp, self.state_path)
|
| 69 |
+
|
| 70 |
+
def look(self) -> dict:
|
| 71 |
+
with self.lock:
|
| 72 |
+
return self.walk.look()
|
| 73 |
+
|
| 74 |
+
def move(self, room) -> tuple[dict, str | None]:
|
| 75 |
+
with self.lock:
|
| 76 |
+
here = self.walk.room
|
| 77 |
+
body, why = self.walk.move(room)
|
| 78 |
+
if why is None and self.walk.reached:
|
| 79 |
+
self.reached_at = now()
|
| 80 |
+
self.log(here, _logged(room), why)
|
| 81 |
+
return body, why
|
| 82 |
+
|
| 83 |
+
def bad_request(self) -> None:
|
| 84 |
+
"""A move request without a room: refused, and logged like any other."""
|
| 85 |
+
with self.lock:
|
| 86 |
+
self.walk.refused += 1
|
| 87 |
+
self.log(self.walk.room, None, "bad_request")
|
| 88 |
+
|
| 89 |
+
def log(self, here: str, to, why: str | None) -> None:
|
| 90 |
+
record = {"agent": self.agent, "from": here, "to": to, "time": now(), "ok": why is None,
|
| 91 |
+
"moves": self.walk.moves}
|
| 92 |
+
if why is not None:
|
| 93 |
+
record["refused"] = why
|
| 94 |
+
with open(self.log_path, "a", encoding="utf-8") as f:
|
| 95 |
+
f.write(json.dumps(record) + "\n")
|
| 96 |
+
f.flush()
|
| 97 |
+
os.fsync(f.fileno())
|
| 98 |
+
self.save()
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
def _logged(room):
|
| 102 |
+
"""What the agent asked to move into, as the log keeps it (a string, at most 64 chars)."""
|
| 103 |
+
text = room if isinstance(room, str) else json.dumps(room)
|
| 104 |
+
return text[:64]
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def handler(service: Service):
|
| 108 |
+
class Handler(BaseHTTPRequestHandler):
|
| 109 |
+
server_version = "maze"
|
| 110 |
+
sys_version = ""
|
| 111 |
+
|
| 112 |
+
def reply(self, code: int, body: dict) -> None:
|
| 113 |
+
data = json.dumps(body).encode()
|
| 114 |
+
self.send_response(code)
|
| 115 |
+
self.send_header("Content-Type", "application/json")
|
| 116 |
+
self.send_header("Content-Length", str(len(data)))
|
| 117 |
+
self.end_headers()
|
| 118 |
+
self.wfile.write(data)
|
| 119 |
+
|
| 120 |
+
def not_found(self) -> None:
|
| 121 |
+
self.reply(404, {"error": "not found: use `maze look` or `maze move ROOM`"})
|
| 122 |
+
|
| 123 |
+
def do_GET(self): # noqa: N802
|
| 124 |
+
if self.path == "/look":
|
| 125 |
+
self.reply(200, service.look())
|
| 126 |
+
else:
|
| 127 |
+
self.not_found()
|
| 128 |
+
|
| 129 |
+
def do_POST(self): # noqa: N802
|
| 130 |
+
if self.path != "/move":
|
| 131 |
+
return self.not_found()
|
| 132 |
+
try:
|
| 133 |
+
length = int(self.headers.get("Content-Length") or 0)
|
| 134 |
+
except ValueError:
|
| 135 |
+
length = -1
|
| 136 |
+
room = None
|
| 137 |
+
if 0 < length <= BODY_LIMIT:
|
| 138 |
+
try:
|
| 139 |
+
room = json.loads(self.rfile.read(length)).get("room")
|
| 140 |
+
except (ValueError, AttributeError):
|
| 141 |
+
pass
|
| 142 |
+
if room is None:
|
| 143 |
+
service.bad_request()
|
| 144 |
+
return self.reply(400, {"error": 'send {"room": "<a door of your room>"}'})
|
| 145 |
+
body, why = service.move(room)
|
| 146 |
+
self.reply(200 if why is None else 409, body)
|
| 147 |
+
|
| 148 |
+
def do_PUT(self): # noqa: N802
|
| 149 |
+
self.not_found()
|
| 150 |
+
|
| 151 |
+
do_DELETE = do_PATCH = do_HEAD = do_OPTIONS = do_PUT # noqa: N815
|
| 152 |
+
|
| 153 |
+
def log_message(self, *args): # the move log is the record
|
| 154 |
+
pass
|
| 155 |
+
|
| 156 |
+
return Handler
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
def main() -> None:
|
| 160 |
+
service = Service(TREE, STATE_DIR, AGENT)
|
| 161 |
+
server = ThreadingHTTPServer(("0.0.0.0", PORT), handler(service))
|
| 162 |
+
server.daemon_threads = True
|
| 163 |
+
server.serve_forever()
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
if __name__ == "__main__":
|
| 167 |
+
main()
|
tasks/maze-t32/environment/maze/success.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""flock's success_check for s3-maze (`stop_on_success`), run in this maze service, never in the
|
| 2 |
+
agent's container: `python3 -I -S /app/success.py`.
|
| 3 |
+
|
| 4 |
+
Read-only: it prints `{"success": <the exit was reached>, "evidence": {...}}` from the walk's
|
| 5 |
+
state file, which only service.py writes. No state yet, or one that can't be read, is not a
|
| 6 |
+
success.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
import json
|
| 10 |
+
import os
|
| 11 |
+
|
| 12 |
+
STATE = os.environ.get("MAZE_STATE_DIR", "/var/lib/maze") + "/state.json"
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def read_state() -> dict | None:
|
| 16 |
+
try:
|
| 17 |
+
fd = os.open(STATE, os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK)
|
| 18 |
+
with os.fdopen(fd, "rb") as f:
|
| 19 |
+
state = json.loads(f.read(1 << 16))
|
| 20 |
+
return state if isinstance(state, dict) else None
|
| 21 |
+
except (OSError, ValueError):
|
| 22 |
+
return None
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
state = read_state()
|
| 26 |
+
reached = bool(state) and state.get("reached") is True
|
| 27 |
+
evidence = ({"exit_reached": reached, "moves": state.get("moves"),
|
| 28 |
+
"reached_at": state.get("reached_at")} if state else {"state": "unreadable"})
|
| 29 |
+
print(json.dumps({"success": reached, "evidence": evidence}))
|
tasks/maze-t32/environment/maze/tree.json
ADDED
|
@@ -0,0 +1,1569 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|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],
|
| 23 |
+
"R1386": [
|
| 24 |
+
"R3073",
|
| 25 |
+
"R2509"
|
| 26 |
+
],
|
| 27 |
+
"R3073": [
|
| 28 |
+
"R6087",
|
| 29 |
+
"R1386"
|
| 30 |
+
],
|
| 31 |
+
"R6087": [
|
| 32 |
+
"R3073",
|
| 33 |
+
"R7086"
|
| 34 |
+
],
|
| 35 |
+
"R7086": [
|
| 36 |
+
"R4331",
|
| 37 |
+
"R6087"
|
| 38 |
+
],
|
| 39 |
+
"R4331": [
|
| 40 |
+
"R7086",
|
| 41 |
+
"R7734"
|
| 42 |
+
],
|
| 43 |
+
"R7734": [
|
| 44 |
+
"R4331",
|
| 45 |
+
"R1302"
|
| 46 |
+
],
|
| 47 |
+
"R1302": [
|
| 48 |
+
"R4968",
|
| 49 |
+
"R6036",
|
| 50 |
+
"R1387",
|
| 51 |
+
"R7734"
|
| 52 |
+
],
|
| 53 |
+
"R2910": [
|
| 54 |
+
"R8064",
|
| 55 |
+
"R7888"
|
| 56 |
+
],
|
| 57 |
+
"R7888": [
|
| 58 |
+
"R2910",
|
| 59 |
+
"R6453"
|
| 60 |
+
],
|
| 61 |
+
"R6453": [
|
| 62 |
+
"R3041",
|
| 63 |
+
"R7888"
|
| 64 |
+
],
|
| 65 |
+
"R3041": [
|
| 66 |
+
"R6453",
|
| 67 |
+
"R2369"
|
| 68 |
+
],
|
| 69 |
+
"R2369": [
|
| 70 |
+
"R7832",
|
| 71 |
+
"R3041"
|
| 72 |
+
],
|
| 73 |
+
"R7832": [
|
| 74 |
+
"R4985",
|
| 75 |
+
"R2369"
|
| 76 |
+
],
|
| 77 |
+
"R4985": [
|
| 78 |
+
"R7832",
|
| 79 |
+
"R6154"
|
| 80 |
+
],
|
| 81 |
+
"R6154": [
|
| 82 |
+
"R2058",
|
| 83 |
+
"R4985"
|
| 84 |
+
],
|
| 85 |
+
"R2058": [
|
| 86 |
+
"R6154",
|
| 87 |
+
"R6282"
|
| 88 |
+
],
|
| 89 |
+
"R6282": [
|
| 90 |
+
"R9831",
|
| 91 |
+
"R9737",
|
| 92 |
+
"R2058",
|
| 93 |
+
"R7297"
|
| 94 |
+
],
|
| 95 |
+
"R7710": [
|
| 96 |
+
"R1463",
|
| 97 |
+
"R8064"
|
| 98 |
+
],
|
| 99 |
+
"R1463": [
|
| 100 |
+
"R7710",
|
| 101 |
+
"R2116"
|
| 102 |
+
],
|
| 103 |
+
"R2116": [
|
| 104 |
+
"R4755",
|
| 105 |
+
"R1463"
|
| 106 |
+
],
|
| 107 |
+
"R4755": [
|
| 108 |
+
"R1501",
|
| 109 |
+
"R2116"
|
| 110 |
+
],
|
| 111 |
+
"R1501": [
|
| 112 |
+
"R4755",
|
| 113 |
+
"R3775"
|
| 114 |
+
],
|
| 115 |
+
"R3775": [
|
| 116 |
+
"R1501",
|
| 117 |
+
"R1957"
|
| 118 |
+
],
|
| 119 |
+
"R1957": [
|
| 120 |
+
"R3775",
|
| 121 |
+
"R8416"
|
| 122 |
+
],
|
| 123 |
+
"R8416": [
|
| 124 |
+
"R7516",
|
| 125 |
+
"R1957"
|
| 126 |
+
],
|
| 127 |
+
"R7516": [
|
| 128 |
+
"R7386",
|
| 129 |
+
"R8416"
|
| 130 |
+
],
|
| 131 |
+
"R7386": [
|
| 132 |
+
"R7516",
|
| 133 |
+
"R2472",
|
| 134 |
+
"R1432",
|
| 135 |
+
"R3146"
|
| 136 |
+
],
|
| 137 |
+
"R1387": [
|
| 138 |
+
"R8254",
|
| 139 |
+
"R1302"
|
| 140 |
+
],
|
| 141 |
+
"R8254": [
|
| 142 |
+
"R6713",
|
| 143 |
+
"R1387"
|
| 144 |
+
],
|
| 145 |
+
"R6713": [
|
| 146 |
+
"R2501",
|
| 147 |
+
"R8254"
|
| 148 |
+
],
|
| 149 |
+
"R2501": [
|
| 150 |
+
"R6713",
|
| 151 |
+
"R7762"
|
| 152 |
+
],
|
| 153 |
+
"R7762": [
|
| 154 |
+
"R3193",
|
| 155 |
+
"R2501"
|
| 156 |
+
],
|
| 157 |
+
"R3193": [
|
| 158 |
+
"R6664",
|
| 159 |
+
"R7762"
|
| 160 |
+
],
|
| 161 |
+
"R6664": [
|
| 162 |
+
"R3193",
|
| 163 |
+
"R5541"
|
| 164 |
+
],
|
| 165 |
+
"R5541": [
|
| 166 |
+
"R2043",
|
| 167 |
+
"R6664"
|
| 168 |
+
],
|
| 169 |
+
"R2043": [
|
| 170 |
+
"R2681",
|
| 171 |
+
"R5541"
|
| 172 |
+
],
|
| 173 |
+
"R2681": [
|
| 174 |
+
"R2413",
|
| 175 |
+
"R2043",
|
| 176 |
+
"R1073",
|
| 177 |
+
"R1508"
|
| 178 |
+
],
|
| 179 |
+
"R6036": [
|
| 180 |
+
"R1302",
|
| 181 |
+
"R8847"
|
| 182 |
+
],
|
| 183 |
+
"R8847": [
|
| 184 |
+
"R6036",
|
| 185 |
+
"R7384"
|
| 186 |
+
],
|
| 187 |
+
"R7384": [
|
| 188 |
+
"R3475",
|
| 189 |
+
"R8847"
|
| 190 |
+
],
|
| 191 |
+
"R3475": [
|
| 192 |
+
"R8807",
|
| 193 |
+
"R7384"
|
| 194 |
+
],
|
| 195 |
+
"R8807": [
|
| 196 |
+
"R3475",
|
| 197 |
+
"R1127"
|
| 198 |
+
],
|
| 199 |
+
"R1127": [
|
| 200 |
+
"R6738",
|
| 201 |
+
"R8807"
|
| 202 |
+
],
|
| 203 |
+
"R6738": [
|
| 204 |
+
"R4827",
|
| 205 |
+
"R1127"
|
| 206 |
+
],
|
| 207 |
+
"R4827": [
|
| 208 |
+
"R6739",
|
| 209 |
+
"R6738"
|
| 210 |
+
],
|
| 211 |
+
"R6739": [
|
| 212 |
+
"R1419",
|
| 213 |
+
"R4827"
|
| 214 |
+
],
|
| 215 |
+
"R1419": [
|
| 216 |
+
"R7116",
|
| 217 |
+
"R1823",
|
| 218 |
+
"R6739",
|
| 219 |
+
"R8061"
|
| 220 |
+
],
|
| 221 |
+
"R4968": [
|
| 222 |
+
"R1302",
|
| 223 |
+
"R2164"
|
| 224 |
+
],
|
| 225 |
+
"R2164": [
|
| 226 |
+
"R7393",
|
| 227 |
+
"R4968"
|
| 228 |
+
],
|
| 229 |
+
"R7393": [
|
| 230 |
+
"R2966",
|
| 231 |
+
"R2164"
|
| 232 |
+
],
|
| 233 |
+
"R2966": [
|
| 234 |
+
"R7393",
|
| 235 |
+
"R4901"
|
| 236 |
+
],
|
| 237 |
+
"R4901": [
|
| 238 |
+
"R2966",
|
| 239 |
+
"R5913"
|
| 240 |
+
],
|
| 241 |
+
"R5913": [
|
| 242 |
+
"R4901",
|
| 243 |
+
"R9892"
|
| 244 |
+
],
|
| 245 |
+
"R9892": [
|
| 246 |
+
"R5913",
|
| 247 |
+
"R6765"
|
| 248 |
+
],
|
| 249 |
+
"R6765": [
|
| 250 |
+
"R9892",
|
| 251 |
+
"R7767"
|
| 252 |
+
],
|
| 253 |
+
"R7767": [
|
| 254 |
+
"R3335",
|
| 255 |
+
"R6765"
|
| 256 |
+
],
|
| 257 |
+
"R3335": [
|
| 258 |
+
"R3855",
|
| 259 |
+
"R9983",
|
| 260 |
+
"R9117",
|
| 261 |
+
"R7767"
|
| 262 |
+
],
|
| 263 |
+
"R9831": [
|
| 264 |
+
"R6282",
|
| 265 |
+
"R7204"
|
| 266 |
+
],
|
| 267 |
+
"R7204": [
|
| 268 |
+
"R9831",
|
| 269 |
+
"R3885"
|
| 270 |
+
],
|
| 271 |
+
"R3885": [
|
| 272 |
+
"R9103",
|
| 273 |
+
"R7204"
|
| 274 |
+
],
|
| 275 |
+
"R9103": [
|
| 276 |
+
"R3885",
|
| 277 |
+
"R7236"
|
| 278 |
+
],
|
| 279 |
+
"R7236": [
|
| 280 |
+
"R9103",
|
| 281 |
+
"R3204"
|
| 282 |
+
],
|
| 283 |
+
"R3204": [
|
| 284 |
+
"R9435",
|
| 285 |
+
"R7236"
|
| 286 |
+
],
|
| 287 |
+
"R9435": [
|
| 288 |
+
"R7793",
|
| 289 |
+
"R3204"
|
| 290 |
+
],
|
| 291 |
+
"R7793": [
|
| 292 |
+
"R2235",
|
| 293 |
+
"R9435"
|
| 294 |
+
],
|
| 295 |
+
"R2235": [
|
| 296 |
+
"R7793",
|
| 297 |
+
"R7528"
|
| 298 |
+
],
|
| 299 |
+
"R7528": [
|
| 300 |
+
"R6640",
|
| 301 |
+
"R1673",
|
| 302 |
+
"R2235",
|
| 303 |
+
"R5748"
|
| 304 |
+
],
|
| 305 |
+
"R7297": [
|
| 306 |
+
"R6282",
|
| 307 |
+
"R3675"
|
| 308 |
+
],
|
| 309 |
+
"R3675": [
|
| 310 |
+
"R7297",
|
| 311 |
+
"R9468"
|
| 312 |
+
],
|
| 313 |
+
"R9468": [
|
| 314 |
+
"R3675",
|
| 315 |
+
"R9002"
|
| 316 |
+
],
|
| 317 |
+
"R9002": [
|
| 318 |
+
"R9468",
|
| 319 |
+
"R7785"
|
| 320 |
+
],
|
| 321 |
+
"R7785": [
|
| 322 |
+
"R2961",
|
| 323 |
+
"R9002"
|
| 324 |
+
],
|
| 325 |
+
"R2961": [
|
| 326 |
+
"R7785",
|
| 327 |
+
"R8467"
|
| 328 |
+
],
|
| 329 |
+
"R8467": [
|
| 330 |
+
"R5985",
|
| 331 |
+
"R2961"
|
| 332 |
+
],
|
| 333 |
+
"R5985": [
|
| 334 |
+
"R1844",
|
| 335 |
+
"R8467"
|
| 336 |
+
],
|
| 337 |
+
"R1844": [
|
| 338 |
+
"R5985",
|
| 339 |
+
"R9481"
|
| 340 |
+
],
|
| 341 |
+
"R9481": [
|
| 342 |
+
"R1844",
|
| 343 |
+
"R4519",
|
| 344 |
+
"R3904",
|
| 345 |
+
"R1429"
|
| 346 |
+
],
|
| 347 |
+
"R9737": [
|
| 348 |
+
"R9385",
|
| 349 |
+
"R6282"
|
| 350 |
+
],
|
| 351 |
+
"R9385": [
|
| 352 |
+
"R2041",
|
| 353 |
+
"R9737"
|
| 354 |
+
],
|
| 355 |
+
"R2041": [
|
| 356 |
+
"R9385",
|
| 357 |
+
"R3980"
|
| 358 |
+
],
|
| 359 |
+
"R3980": [
|
| 360 |
+
"R2041",
|
| 361 |
+
"R7852"
|
| 362 |
+
],
|
| 363 |
+
"R7852": [
|
| 364 |
+
"R6429",
|
| 365 |
+
"R3980"
|
| 366 |
+
],
|
| 367 |
+
"R6429": [
|
| 368 |
+
"R7852",
|
| 369 |
+
"R9698"
|
| 370 |
+
],
|
| 371 |
+
"R9698": [
|
| 372 |
+
"R6429",
|
| 373 |
+
"R8681"
|
| 374 |
+
],
|
| 375 |
+
"R8681": [
|
| 376 |
+
"R1900",
|
| 377 |
+
"R9698"
|
| 378 |
+
],
|
| 379 |
+
"R1900": [
|
| 380 |
+
"R7061",
|
| 381 |
+
"R8681"
|
| 382 |
+
],
|
| 383 |
+
"R7061": [
|
| 384 |
+
"R2209",
|
| 385 |
+
"R1900",
|
| 386 |
+
"R5978",
|
| 387 |
+
"R7725"
|
| 388 |
+
],
|
| 389 |
+
"R3146": [
|
| 390 |
+
"R6691",
|
| 391 |
+
"R7386"
|
| 392 |
+
],
|
| 393 |
+
"R6691": [
|
| 394 |
+
"R3146",
|
| 395 |
+
"R6058"
|
| 396 |
+
],
|
| 397 |
+
"R6058": [
|
| 398 |
+
"R5371",
|
| 399 |
+
"R6691"
|
| 400 |
+
],
|
| 401 |
+
"R5371": [
|
| 402 |
+
"R8331",
|
| 403 |
+
"R6058"
|
| 404 |
+
],
|
| 405 |
+
"R8331": [
|
| 406 |
+
"R4488",
|
| 407 |
+
"R5371"
|
| 408 |
+
],
|
| 409 |
+
"R4488": [
|
| 410 |
+
"R8331",
|
| 411 |
+
"R8495"
|
| 412 |
+
],
|
| 413 |
+
"R8495": [
|
| 414 |
+
"R5330",
|
| 415 |
+
"R4488"
|
| 416 |
+
],
|
| 417 |
+
"R5330": [
|
| 418 |
+
"R7171",
|
| 419 |
+
"R8495"
|
| 420 |
+
],
|
| 421 |
+
"R7171": [
|
| 422 |
+
"R5330",
|
| 423 |
+
"R8629"
|
| 424 |
+
],
|
| 425 |
+
"R8629": [
|
| 426 |
+
"R8387",
|
| 427 |
+
"R6604",
|
| 428 |
+
"R1220",
|
| 429 |
+
"R7171"
|
| 430 |
+
],
|
| 431 |
+
"R2472": [
|
| 432 |
+
"R8103",
|
| 433 |
+
"R7386"
|
| 434 |
+
],
|
| 435 |
+
"R8103": [
|
| 436 |
+
"R8296",
|
| 437 |
+
"R2472"
|
| 438 |
+
],
|
| 439 |
+
"R8296": [
|
| 440 |
+
"R9853",
|
| 441 |
+
"R8103"
|
| 442 |
+
],
|
| 443 |
+
"R9853": [
|
| 444 |
+
"R2294",
|
| 445 |
+
"R8296"
|
| 446 |
+
],
|
| 447 |
+
"R2294": [
|
| 448 |
+
"R9853",
|
| 449 |
+
"R5028"
|
| 450 |
+
],
|
| 451 |
+
"R5028": [
|
| 452 |
+
"R2691",
|
| 453 |
+
"R2294"
|
| 454 |
+
],
|
| 455 |
+
"R2691": [
|
| 456 |
+
"R5028",
|
| 457 |
+
"R4877"
|
| 458 |
+
],
|
| 459 |
+
"R4877": [
|
| 460 |
+
"R8149",
|
| 461 |
+
"R2691"
|
| 462 |
+
],
|
| 463 |
+
"R8149": [
|
| 464 |
+
"R4877",
|
| 465 |
+
"R9882"
|
| 466 |
+
],
|
| 467 |
+
"R9882": [
|
| 468 |
+
"R1817",
|
| 469 |
+
"R8149",
|
| 470 |
+
"R1096",
|
| 471 |
+
"R1983"
|
| 472 |
+
],
|
| 473 |
+
"R1432": [
|
| 474 |
+
"R4743",
|
| 475 |
+
"R7386"
|
| 476 |
+
],
|
| 477 |
+
"R4743": [
|
| 478 |
+
"R8256",
|
| 479 |
+
"R1432"
|
| 480 |
+
],
|
| 481 |
+
"R8256": [
|
| 482 |
+
"R5341",
|
| 483 |
+
"R4743"
|
| 484 |
+
],
|
| 485 |
+
"R5341": [
|
| 486 |
+
"R1145",
|
| 487 |
+
"R8256"
|
| 488 |
+
],
|
| 489 |
+
"R1145": [
|
| 490 |
+
"R5341",
|
| 491 |
+
"R5846"
|
| 492 |
+
],
|
| 493 |
+
"R5846": [
|
| 494 |
+
"R1145",
|
| 495 |
+
"R2152"
|
| 496 |
+
],
|
| 497 |
+
"R2152": [
|
| 498 |
+
"R5846",
|
| 499 |
+
"R7845"
|
| 500 |
+
],
|
| 501 |
+
"R7845": [
|
| 502 |
+
"R2152",
|
| 503 |
+
"R7335"
|
| 504 |
+
],
|
| 505 |
+
"R7335": [
|
| 506 |
+
"R6073",
|
| 507 |
+
"R7845"
|
| 508 |
+
],
|
| 509 |
+
"R6073": [
|
| 510 |
+
"R3968",
|
| 511 |
+
"R2864",
|
| 512 |
+
"R2838",
|
| 513 |
+
"R7335"
|
| 514 |
+
],
|
| 515 |
+
"R1508": [
|
| 516 |
+
"R1678",
|
| 517 |
+
"R2681"
|
| 518 |
+
],
|
| 519 |
+
"R1678": [
|
| 520 |
+
"R1508",
|
| 521 |
+
"R9473"
|
| 522 |
+
],
|
| 523 |
+
"R9473": [
|
| 524 |
+
"R9226",
|
| 525 |
+
"R1678"
|
| 526 |
+
],
|
| 527 |
+
"R9226": [
|
| 528 |
+
"R1606",
|
| 529 |
+
"R9473"
|
| 530 |
+
],
|
| 531 |
+
"R1606": [
|
| 532 |
+
"R9226",
|
| 533 |
+
"R9571"
|
| 534 |
+
],
|
| 535 |
+
"R9571": [
|
| 536 |
+
"R1606",
|
| 537 |
+
"R8537"
|
| 538 |
+
],
|
| 539 |
+
"R8537": [
|
| 540 |
+
"R3230",
|
| 541 |
+
"R9571"
|
| 542 |
+
],
|
| 543 |
+
"R3230": [
|
| 544 |
+
"R9098",
|
| 545 |
+
"R8537"
|
| 546 |
+
],
|
| 547 |
+
"R9098": [
|
| 548 |
+
"R9013",
|
| 549 |
+
"R3230"
|
| 550 |
+
],
|
| 551 |
+
"R9013": [
|
| 552 |
+
"R9098"
|
| 553 |
+
],
|
| 554 |
+
"R1073": [
|
| 555 |
+
"R5272",
|
| 556 |
+
"R2681"
|
| 557 |
+
],
|
| 558 |
+
"R5272": [
|
| 559 |
+
"R1073",
|
| 560 |
+
"R1229"
|
| 561 |
+
],
|
| 562 |
+
"R1229": [
|
| 563 |
+
"R7779",
|
| 564 |
+
"R5272"
|
| 565 |
+
],
|
| 566 |
+
"R7779": [
|
| 567 |
+
"R2170",
|
| 568 |
+
"R1229"
|
| 569 |
+
],
|
| 570 |
+
"R2170": [
|
| 571 |
+
"R8555",
|
| 572 |
+
"R7779"
|
| 573 |
+
],
|
| 574 |
+
"R8555": [
|
| 575 |
+
"R2170",
|
| 576 |
+
"R3651"
|
| 577 |
+
],
|
| 578 |
+
"R3651": [
|
| 579 |
+
"R8555",
|
| 580 |
+
"R5441"
|
| 581 |
+
],
|
| 582 |
+
"R5441": [
|
| 583 |
+
"R7613",
|
| 584 |
+
"R3651"
|
| 585 |
+
],
|
| 586 |
+
"R7613": [
|
| 587 |
+
"R5441",
|
| 588 |
+
"R6341"
|
| 589 |
+
],
|
| 590 |
+
"R6341": [
|
| 591 |
+
"R7613"
|
| 592 |
+
],
|
| 593 |
+
"R2413": [
|
| 594 |
+
"R8290",
|
| 595 |
+
"R2681"
|
| 596 |
+
],
|
| 597 |
+
"R8290": [
|
| 598 |
+
"R2413",
|
| 599 |
+
"R4513"
|
| 600 |
+
],
|
| 601 |
+
"R4513": [
|
| 602 |
+
"R8290",
|
| 603 |
+
"R6128"
|
| 604 |
+
],
|
| 605 |
+
"R6128": [
|
| 606 |
+
"R4513",
|
| 607 |
+
"R3518"
|
| 608 |
+
],
|
| 609 |
+
"R3518": [
|
| 610 |
+
"R9049",
|
| 611 |
+
"R6128"
|
| 612 |
+
],
|
| 613 |
+
"R9049": [
|
| 614 |
+
"R6513",
|
| 615 |
+
"R3518"
|
| 616 |
+
],
|
| 617 |
+
"R6513": [
|
| 618 |
+
"R9049",
|
| 619 |
+
"R5142"
|
| 620 |
+
],
|
| 621 |
+
"R5142": [
|
| 622 |
+
"R6513",
|
| 623 |
+
"R3468"
|
| 624 |
+
],
|
| 625 |
+
"R3468": [
|
| 626 |
+
"R3497",
|
| 627 |
+
"R5142"
|
| 628 |
+
],
|
| 629 |
+
"R3497": [
|
| 630 |
+
"R3468"
|
| 631 |
+
],
|
| 632 |
+
"R7116": [
|
| 633 |
+
"R1419",
|
| 634 |
+
"R8582"
|
| 635 |
+
],
|
| 636 |
+
"R8582": [
|
| 637 |
+
"R9565",
|
| 638 |
+
"R7116"
|
| 639 |
+
],
|
| 640 |
+
"R9565": [
|
| 641 |
+
"R8582",
|
| 642 |
+
"R2752"
|
| 643 |
+
],
|
| 644 |
+
"R2752": [
|
| 645 |
+
"R7279",
|
| 646 |
+
"R9565"
|
| 647 |
+
],
|
| 648 |
+
"R7279": [
|
| 649 |
+
"R2752",
|
| 650 |
+
"R7626"
|
| 651 |
+
],
|
| 652 |
+
"R7626": [
|
| 653 |
+
"R7279",
|
| 654 |
+
"R4034"
|
| 655 |
+
],
|
| 656 |
+
"R4034": [
|
| 657 |
+
"R6051",
|
| 658 |
+
"R7626"
|
| 659 |
+
],
|
| 660 |
+
"R6051": [
|
| 661 |
+
"R5306",
|
| 662 |
+
"R4034"
|
| 663 |
+
],
|
| 664 |
+
"R5306": [
|
| 665 |
+
"R1683",
|
| 666 |
+
"R6051"
|
| 667 |
+
],
|
| 668 |
+
"R1683": [
|
| 669 |
+
"R5306"
|
| 670 |
+
],
|
| 671 |
+
"R8061": [
|
| 672 |
+
"R8489",
|
| 673 |
+
"R1419"
|
| 674 |
+
],
|
| 675 |
+
"R8489": [
|
| 676 |
+
"R7070",
|
| 677 |
+
"R8061"
|
| 678 |
+
],
|
| 679 |
+
"R7070": [
|
| 680 |
+
"R6303",
|
| 681 |
+
"R8489"
|
| 682 |
+
],
|
| 683 |
+
"R6303": [
|
| 684 |
+
"R2334",
|
| 685 |
+
"R7070"
|
| 686 |
+
],
|
| 687 |
+
"R2334": [
|
| 688 |
+
"R7439",
|
| 689 |
+
"R6303"
|
| 690 |
+
],
|
| 691 |
+
"R7439": [
|
| 692 |
+
"R1034",
|
| 693 |
+
"R2334"
|
| 694 |
+
],
|
| 695 |
+
"R1034": [
|
| 696 |
+
"R7439",
|
| 697 |
+
"R3350"
|
| 698 |
+
],
|
| 699 |
+
"R3350": [
|
| 700 |
+
"R2228",
|
| 701 |
+
"R1034"
|
| 702 |
+
],
|
| 703 |
+
"R2228": [
|
| 704 |
+
"R7545",
|
| 705 |
+
"R3350"
|
| 706 |
+
],
|
| 707 |
+
"R7545": [
|
| 708 |
+
"R2228"
|
| 709 |
+
],
|
| 710 |
+
"R1823": [
|
| 711 |
+
"R7941",
|
| 712 |
+
"R1419"
|
| 713 |
+
],
|
| 714 |
+
"R7941": [
|
| 715 |
+
"R8695",
|
| 716 |
+
"R1823"
|
| 717 |
+
],
|
| 718 |
+
"R8695": [
|
| 719 |
+
"R7941",
|
| 720 |
+
"R3564"
|
| 721 |
+
],
|
| 722 |
+
"R3564": [
|
| 723 |
+
"R1240",
|
| 724 |
+
"R8695"
|
| 725 |
+
],
|
| 726 |
+
"R1240": [
|
| 727 |
+
"R3564",
|
| 728 |
+
"R7035"
|
| 729 |
+
],
|
| 730 |
+
"R7035": [
|
| 731 |
+
"R3040",
|
| 732 |
+
"R1240"
|
| 733 |
+
],
|
| 734 |
+
"R3040": [
|
| 735 |
+
"R7035",
|
| 736 |
+
"R4944"
|
| 737 |
+
],
|
| 738 |
+
"R4944": [
|
| 739 |
+
"R3040",
|
| 740 |
+
"R5534"
|
| 741 |
+
],
|
| 742 |
+
"R5534": [
|
| 743 |
+
"R2874",
|
| 744 |
+
"R4944"
|
| 745 |
+
],
|
| 746 |
+
"R2874": [
|
| 747 |
+
"R5534"
|
| 748 |
+
],
|
| 749 |
+
"R9117": [
|
| 750 |
+
"R3335",
|
| 751 |
+
"R9992"
|
| 752 |
+
],
|
| 753 |
+
"R9992": [
|
| 754 |
+
"R3963",
|
| 755 |
+
"R9117"
|
| 756 |
+
],
|
| 757 |
+
"R3963": [
|
| 758 |
+
"R1182",
|
| 759 |
+
"R9992"
|
| 760 |
+
],
|
| 761 |
+
"R1182": [
|
| 762 |
+
"R5268",
|
| 763 |
+
"R3963"
|
| 764 |
+
],
|
| 765 |
+
"R5268": [
|
| 766 |
+
"R1182",
|
| 767 |
+
"R6346"
|
| 768 |
+
],
|
| 769 |
+
"R6346": [
|
| 770 |
+
"R5268",
|
| 771 |
+
"R4259"
|
| 772 |
+
],
|
| 773 |
+
"R4259": [
|
| 774 |
+
"R6346",
|
| 775 |
+
"R7024"
|
| 776 |
+
],
|
| 777 |
+
"R7024": [
|
| 778 |
+
"R4259",
|
| 779 |
+
"R6550"
|
| 780 |
+
],
|
| 781 |
+
"R6550": [
|
| 782 |
+
"R7024",
|
| 783 |
+
"R5451"
|
| 784 |
+
],
|
| 785 |
+
"R5451": [
|
| 786 |
+
"R6550"
|
| 787 |
+
],
|
| 788 |
+
"R9983": [
|
| 789 |
+
"R2935",
|
| 790 |
+
"R3335"
|
| 791 |
+
],
|
| 792 |
+
"R2935": [
|
| 793 |
+
"R9983",
|
| 794 |
+
"R2586"
|
| 795 |
+
],
|
| 796 |
+
"R2586": [
|
| 797 |
+
"R6978",
|
| 798 |
+
"R2935"
|
| 799 |
+
],
|
| 800 |
+
"R6978": [
|
| 801 |
+
"R3967",
|
| 802 |
+
"R2586"
|
| 803 |
+
],
|
| 804 |
+
"R3967": [
|
| 805 |
+
"R6978",
|
| 806 |
+
"R1660"
|
| 807 |
+
],
|
| 808 |
+
"R1660": [
|
| 809 |
+
"R3967",
|
| 810 |
+
"R1287"
|
| 811 |
+
],
|
| 812 |
+
"R1287": [
|
| 813 |
+
"R4036",
|
| 814 |
+
"R1660"
|
| 815 |
+
],
|
| 816 |
+
"R4036": [
|
| 817 |
+
"R1287",
|
| 818 |
+
"R5262"
|
| 819 |
+
],
|
| 820 |
+
"R5262": [
|
| 821 |
+
"R5628",
|
| 822 |
+
"R4036"
|
| 823 |
+
],
|
| 824 |
+
"R5628": [
|
| 825 |
+
"R5262"
|
| 826 |
+
],
|
| 827 |
+
"R3855": [
|
| 828 |
+
"R3335",
|
| 829 |
+
"R5215"
|
| 830 |
+
],
|
| 831 |
+
"R5215": [
|
| 832 |
+
"R3855",
|
| 833 |
+
"R7585"
|
| 834 |
+
],
|
| 835 |
+
"R7585": [
|
| 836 |
+
"R5215",
|
| 837 |
+
"R6142"
|
| 838 |
+
],
|
| 839 |
+
"R6142": [
|
| 840 |
+
"R3765",
|
| 841 |
+
"R7585"
|
| 842 |
+
],
|
| 843 |
+
"R3765": [
|
| 844 |
+
"R6142",
|
| 845 |
+
"R1459"
|
| 846 |
+
],
|
| 847 |
+
"R1459": [
|
| 848 |
+
"R1565",
|
| 849 |
+
"R3765"
|
| 850 |
+
],
|
| 851 |
+
"R1565": [
|
| 852 |
+
"R1459",
|
| 853 |
+
"R4173"
|
| 854 |
+
],
|
| 855 |
+
"R4173": [
|
| 856 |
+
"R6246",
|
| 857 |
+
"R1565"
|
| 858 |
+
],
|
| 859 |
+
"R6246": [
|
| 860 |
+
"R4173",
|
| 861 |
+
"R1506"
|
| 862 |
+
],
|
| 863 |
+
"R1506": [
|
| 864 |
+
"R6246"
|
| 865 |
+
],
|
| 866 |
+
"R1673": [
|
| 867 |
+
"R7528",
|
| 868 |
+
"R7513"
|
| 869 |
+
],
|
| 870 |
+
"R7513": [
|
| 871 |
+
"R1673",
|
| 872 |
+
"R5366"
|
| 873 |
+
],
|
| 874 |
+
"R5366": [
|
| 875 |
+
"R5912",
|
| 876 |
+
"R7513"
|
| 877 |
+
],
|
| 878 |
+
"R5912": [
|
| 879 |
+
"R3156",
|
| 880 |
+
"R5366"
|
| 881 |
+
],
|
| 882 |
+
"R3156": [
|
| 883 |
+
"R5912",
|
| 884 |
+
"R6324"
|
| 885 |
+
],
|
| 886 |
+
"R6324": [
|
| 887 |
+
"R3156",
|
| 888 |
+
"R2230"
|
| 889 |
+
],
|
| 890 |
+
"R2230": [
|
| 891 |
+
"R4764",
|
| 892 |
+
"R6324"
|
| 893 |
+
],
|
| 894 |
+
"R4764": [
|
| 895 |
+
"R3339",
|
| 896 |
+
"R2230"
|
| 897 |
+
],
|
| 898 |
+
"R3339": [
|
| 899 |
+
"R2232",
|
| 900 |
+
"R4764"
|
| 901 |
+
],
|
| 902 |
+
"R2232": [
|
| 903 |
+
"R3339"
|
| 904 |
+
],
|
| 905 |
+
"R6640": [
|
| 906 |
+
"R6851",
|
| 907 |
+
"R7528"
|
| 908 |
+
],
|
| 909 |
+
"R6851": [
|
| 910 |
+
"R2939",
|
| 911 |
+
"R6640"
|
| 912 |
+
],
|
| 913 |
+
"R2939": [
|
| 914 |
+
"R8004",
|
| 915 |
+
"R6851"
|
| 916 |
+
],
|
| 917 |
+
"R8004": [
|
| 918 |
+
"R2939",
|
| 919 |
+
"R3194"
|
| 920 |
+
],
|
| 921 |
+
"R3194": [
|
| 922 |
+
"R8004",
|
| 923 |
+
"R7449"
|
| 924 |
+
],
|
| 925 |
+
"R7449": [
|
| 926 |
+
"R3194",
|
| 927 |
+
"R2063"
|
| 928 |
+
],
|
| 929 |
+
"R2063": [
|
| 930 |
+
"R5459",
|
| 931 |
+
"R7449"
|
| 932 |
+
],
|
| 933 |
+
"R5459": [
|
| 934 |
+
"R2063",
|
| 935 |
+
"R2782"
|
| 936 |
+
],
|
| 937 |
+
"R2782": [
|
| 938 |
+
"R5459",
|
| 939 |
+
"R2743"
|
| 940 |
+
],
|
| 941 |
+
"R2743": [
|
| 942 |
+
"R2782"
|
| 943 |
+
],
|
| 944 |
+
"R5748": [
|
| 945 |
+
"R7113",
|
| 946 |
+
"R7528"
|
| 947 |
+
],
|
| 948 |
+
"R7113": [
|
| 949 |
+
"R7111",
|
| 950 |
+
"R5748"
|
| 951 |
+
],
|
| 952 |
+
"R7111": [
|
| 953 |
+
"R7113",
|
| 954 |
+
"R8506"
|
| 955 |
+
],
|
| 956 |
+
"R8506": [
|
| 957 |
+
"R5351",
|
| 958 |
+
"R7111"
|
| 959 |
+
],
|
| 960 |
+
"R5351": [
|
| 961 |
+
"R8506",
|
| 962 |
+
"R7337"
|
| 963 |
+
],
|
| 964 |
+
"R7337": [
|
| 965 |
+
"R3175",
|
| 966 |
+
"R5351"
|
| 967 |
+
],
|
| 968 |
+
"R3175": [
|
| 969 |
+
"R7337",
|
| 970 |
+
"R8621"
|
| 971 |
+
],
|
| 972 |
+
"R8621": [
|
| 973 |
+
"R4296",
|
| 974 |
+
"R3175"
|
| 975 |
+
],
|
| 976 |
+
"R4296": [
|
| 977 |
+
"R8151",
|
| 978 |
+
"R8621"
|
| 979 |
+
],
|
| 980 |
+
"R8151": [
|
| 981 |
+
"R4296"
|
| 982 |
+
],
|
| 983 |
+
"R3904": [
|
| 984 |
+
"R9874",
|
| 985 |
+
"R9481"
|
| 986 |
+
],
|
| 987 |
+
"R9874": [
|
| 988 |
+
"R4143",
|
| 989 |
+
"R3904"
|
| 990 |
+
],
|
| 991 |
+
"R4143": [
|
| 992 |
+
"R5052",
|
| 993 |
+
"R9874"
|
| 994 |
+
],
|
| 995 |
+
"R5052": [
|
| 996 |
+
"R4143",
|
| 997 |
+
"R6836"
|
| 998 |
+
],
|
| 999 |
+
"R6836": [
|
| 1000 |
+
"R5052",
|
| 1001 |
+
"R4369"
|
| 1002 |
+
],
|
| 1003 |
+
"R4369": [
|
| 1004 |
+
"R6836",
|
| 1005 |
+
"R1616"
|
| 1006 |
+
],
|
| 1007 |
+
"R1616": [
|
| 1008 |
+
"R4369",
|
| 1009 |
+
"R9043"
|
| 1010 |
+
],
|
| 1011 |
+
"R9043": [
|
| 1012 |
+
"R7261",
|
| 1013 |
+
"R1616"
|
| 1014 |
+
],
|
| 1015 |
+
"R7261": [
|
| 1016 |
+
"R9043",
|
| 1017 |
+
"R4923"
|
| 1018 |
+
],
|
| 1019 |
+
"R4923": [
|
| 1020 |
+
"R7261"
|
| 1021 |
+
],
|
| 1022 |
+
"R4519": [
|
| 1023 |
+
"R4024",
|
| 1024 |
+
"R9481"
|
| 1025 |
+
],
|
| 1026 |
+
"R4024": [
|
| 1027 |
+
"R8453",
|
| 1028 |
+
"R4519"
|
| 1029 |
+
],
|
| 1030 |
+
"R8453": [
|
| 1031 |
+
"R8428",
|
| 1032 |
+
"R4024"
|
| 1033 |
+
],
|
| 1034 |
+
"R8428": [
|
| 1035 |
+
"R8372",
|
| 1036 |
+
"R8453"
|
| 1037 |
+
],
|
| 1038 |
+
"R8372": [
|
| 1039 |
+
"R4657",
|
| 1040 |
+
"R8428"
|
| 1041 |
+
],
|
| 1042 |
+
"R4657": [
|
| 1043 |
+
"R9796",
|
| 1044 |
+
"R8372"
|
| 1045 |
+
],
|
| 1046 |
+
"R9796": [
|
| 1047 |
+
"R4945",
|
| 1048 |
+
"R4657"
|
| 1049 |
+
],
|
| 1050 |
+
"R4945": [
|
| 1051 |
+
"R9796",
|
| 1052 |
+
"R2399"
|
| 1053 |
+
],
|
| 1054 |
+
"R2399": [
|
| 1055 |
+
"R4945",
|
| 1056 |
+
"R1247"
|
| 1057 |
+
],
|
| 1058 |
+
"R1247": [
|
| 1059 |
+
"R2399"
|
| 1060 |
+
],
|
| 1061 |
+
"R1429": [
|
| 1062 |
+
"R9481",
|
| 1063 |
+
"R9055"
|
| 1064 |
+
],
|
| 1065 |
+
"R9055": [
|
| 1066 |
+
"R1429",
|
| 1067 |
+
"R9410"
|
| 1068 |
+
],
|
| 1069 |
+
"R9410": [
|
| 1070 |
+
"R9055",
|
| 1071 |
+
"R8670"
|
| 1072 |
+
],
|
| 1073 |
+
"R8670": [
|
| 1074 |
+
"R5410",
|
| 1075 |
+
"R9410"
|
| 1076 |
+
],
|
| 1077 |
+
"R5410": [
|
| 1078 |
+
"R3942",
|
| 1079 |
+
"R8670"
|
| 1080 |
+
],
|
| 1081 |
+
"R3942": [
|
| 1082 |
+
"R8265",
|
| 1083 |
+
"R5410"
|
| 1084 |
+
],
|
| 1085 |
+
"R8265": [
|
| 1086 |
+
"R5868",
|
| 1087 |
+
"R3942"
|
| 1088 |
+
],
|
| 1089 |
+
"R5868": [
|
| 1090 |
+
"R3740",
|
| 1091 |
+
"R8265"
|
| 1092 |
+
],
|
| 1093 |
+
"R3740": [
|
| 1094 |
+
"R5868",
|
| 1095 |
+
"R5278"
|
| 1096 |
+
],
|
| 1097 |
+
"R5278": [
|
| 1098 |
+
"R3740"
|
| 1099 |
+
],
|
| 1100 |
+
"R2209": [
|
| 1101 |
+
"R4960",
|
| 1102 |
+
"R7061"
|
| 1103 |
+
],
|
| 1104 |
+
"R4960": [
|
| 1105 |
+
"R7009",
|
| 1106 |
+
"R2209"
|
| 1107 |
+
],
|
| 1108 |
+
"R7009": [
|
| 1109 |
+
"R4960",
|
| 1110 |
+
"R5148"
|
| 1111 |
+
],
|
| 1112 |
+
"R5148": [
|
| 1113 |
+
"R7009",
|
| 1114 |
+
"R7997"
|
| 1115 |
+
],
|
| 1116 |
+
"R7997": [
|
| 1117 |
+
"R5148",
|
| 1118 |
+
"R9783"
|
| 1119 |
+
],
|
| 1120 |
+
"R9783": [
|
| 1121 |
+
"R1113",
|
| 1122 |
+
"R7997"
|
| 1123 |
+
],
|
| 1124 |
+
"R1113": [
|
| 1125 |
+
"R5583",
|
| 1126 |
+
"R9783"
|
| 1127 |
+
],
|
| 1128 |
+
"R5583": [
|
| 1129 |
+
"R1113",
|
| 1130 |
+
"R6683"
|
| 1131 |
+
],
|
| 1132 |
+
"R6683": [
|
| 1133 |
+
"R8614",
|
| 1134 |
+
"R5583"
|
| 1135 |
+
],
|
| 1136 |
+
"R8614": [
|
| 1137 |
+
"R6683"
|
| 1138 |
+
],
|
| 1139 |
+
"R7725": [
|
| 1140 |
+
"R3412",
|
| 1141 |
+
"R7061"
|
| 1142 |
+
],
|
| 1143 |
+
"R3412": [
|
| 1144 |
+
"R4116",
|
| 1145 |
+
"R7725"
|
| 1146 |
+
],
|
| 1147 |
+
"R4116": [
|
| 1148 |
+
"R3412",
|
| 1149 |
+
"R7094"
|
| 1150 |
+
],
|
| 1151 |
+
"R7094": [
|
| 1152 |
+
"R4116",
|
| 1153 |
+
"R5111"
|
| 1154 |
+
],
|
| 1155 |
+
"R5111": [
|
| 1156 |
+
"R7094",
|
| 1157 |
+
"R2217"
|
| 1158 |
+
],
|
| 1159 |
+
"R2217": [
|
| 1160 |
+
"R2122",
|
| 1161 |
+
"R5111"
|
| 1162 |
+
],
|
| 1163 |
+
"R2122": [
|
| 1164 |
+
"R2217",
|
| 1165 |
+
"R4450"
|
| 1166 |
+
],
|
| 1167 |
+
"R4450": [
|
| 1168 |
+
"R3374",
|
| 1169 |
+
"R2122"
|
| 1170 |
+
],
|
| 1171 |
+
"R3374": [
|
| 1172 |
+
"R3676",
|
| 1173 |
+
"R4450"
|
| 1174 |
+
],
|
| 1175 |
+
"R3676": [
|
| 1176 |
+
"R3374"
|
| 1177 |
+
],
|
| 1178 |
+
"R5978": [
|
| 1179 |
+
"R6395",
|
| 1180 |
+
"R7061"
|
| 1181 |
+
],
|
| 1182 |
+
"R6395": [
|
| 1183 |
+
"R5978",
|
| 1184 |
+
"R2003"
|
| 1185 |
+
],
|
| 1186 |
+
"R2003": [
|
| 1187 |
+
"R6395",
|
| 1188 |
+
"R7208"
|
| 1189 |
+
],
|
| 1190 |
+
"R7208": [
|
| 1191 |
+
"R4830",
|
| 1192 |
+
"R2003"
|
| 1193 |
+
],
|
| 1194 |
+
"R4830": [
|
| 1195 |
+
"R2283",
|
| 1196 |
+
"R7208"
|
| 1197 |
+
],
|
| 1198 |
+
"R2283": [
|
| 1199 |
+
"R4314",
|
| 1200 |
+
"R4830"
|
| 1201 |
+
],
|
| 1202 |
+
"R4314": [
|
| 1203 |
+
"R2283",
|
| 1204 |
+
"R6641"
|
| 1205 |
+
],
|
| 1206 |
+
"R6641": [
|
| 1207 |
+
"R4787",
|
| 1208 |
+
"R4314"
|
| 1209 |
+
],
|
| 1210 |
+
"R4787": [
|
| 1211 |
+
"R6641",
|
| 1212 |
+
"R1301"
|
| 1213 |
+
],
|
| 1214 |
+
"R1301": [
|
| 1215 |
+
"R4787"
|
| 1216 |
+
],
|
| 1217 |
+
"R6604": [
|
| 1218 |
+
"R8629",
|
| 1219 |
+
"R4114"
|
| 1220 |
+
],
|
| 1221 |
+
"R4114": [
|
| 1222 |
+
"R4085",
|
| 1223 |
+
"R6604"
|
| 1224 |
+
],
|
| 1225 |
+
"R4085": [
|
| 1226 |
+
"R4114",
|
| 1227 |
+
"R5911"
|
| 1228 |
+
],
|
| 1229 |
+
"R5911": [
|
| 1230 |
+
"R3091",
|
| 1231 |
+
"R4085"
|
| 1232 |
+
],
|
| 1233 |
+
"R3091": [
|
| 1234 |
+
"R5911",
|
| 1235 |
+
"R1788"
|
| 1236 |
+
],
|
| 1237 |
+
"R1788": [
|
| 1238 |
+
"R2916",
|
| 1239 |
+
"R3091"
|
| 1240 |
+
],
|
| 1241 |
+
"R2916": [
|
| 1242 |
+
"R1788",
|
| 1243 |
+
"R4872"
|
| 1244 |
+
],
|
| 1245 |
+
"R4872": [
|
| 1246 |
+
"R2210",
|
| 1247 |
+
"R2916"
|
| 1248 |
+
],
|
| 1249 |
+
"R2210": [
|
| 1250 |
+
"R4872",
|
| 1251 |
+
"R4977"
|
| 1252 |
+
],
|
| 1253 |
+
"R4977": [
|
| 1254 |
+
"R2210"
|
| 1255 |
+
],
|
| 1256 |
+
"R1220": [
|
| 1257 |
+
"R8629",
|
| 1258 |
+
"R9815"
|
| 1259 |
+
],
|
| 1260 |
+
"R9815": [
|
| 1261 |
+
"R6462",
|
| 1262 |
+
"R1220"
|
| 1263 |
+
],
|
| 1264 |
+
"R6462": [
|
| 1265 |
+
"R9815",
|
| 1266 |
+
"R1972"
|
| 1267 |
+
],
|
| 1268 |
+
"R1972": [
|
| 1269 |
+
"R6462",
|
| 1270 |
+
"R1891"
|
| 1271 |
+
],
|
| 1272 |
+
"R1891": [
|
| 1273 |
+
"R7786",
|
| 1274 |
+
"R1972"
|
| 1275 |
+
],
|
| 1276 |
+
"R7786": [
|
| 1277 |
+
"R1891",
|
| 1278 |
+
"R5542"
|
| 1279 |
+
],
|
| 1280 |
+
"R5542": [
|
| 1281 |
+
"R5426",
|
| 1282 |
+
"R7786"
|
| 1283 |
+
],
|
| 1284 |
+
"R5426": [
|
| 1285 |
+
"R7045",
|
| 1286 |
+
"R5542"
|
| 1287 |
+
],
|
| 1288 |
+
"R7045": [
|
| 1289 |
+
"R5426",
|
| 1290 |
+
"R1251"
|
| 1291 |
+
],
|
| 1292 |
+
"R1251": [
|
| 1293 |
+
"R7045"
|
| 1294 |
+
],
|
| 1295 |
+
"R8387": [
|
| 1296 |
+
"R5108",
|
| 1297 |
+
"R8629"
|
| 1298 |
+
],
|
| 1299 |
+
"R5108": [
|
| 1300 |
+
"R8387",
|
| 1301 |
+
"R3964"
|
| 1302 |
+
],
|
| 1303 |
+
"R3964": [
|
| 1304 |
+
"R4076",
|
| 1305 |
+
"R5108"
|
| 1306 |
+
],
|
| 1307 |
+
"R4076": [
|
| 1308 |
+
"R7846",
|
| 1309 |
+
"R3964"
|
| 1310 |
+
],
|
| 1311 |
+
"R7846": [
|
| 1312 |
+
"R4076",
|
| 1313 |
+
"R8612"
|
| 1314 |
+
],
|
| 1315 |
+
"R8612": [
|
| 1316 |
+
"R7120",
|
| 1317 |
+
"R7846"
|
| 1318 |
+
],
|
| 1319 |
+
"R7120": [
|
| 1320 |
+
"R7604",
|
| 1321 |
+
"R8612"
|
| 1322 |
+
],
|
| 1323 |
+
"R7604": [
|
| 1324 |
+
"R7120",
|
| 1325 |
+
"R6323"
|
| 1326 |
+
],
|
| 1327 |
+
"R6323": [
|
| 1328 |
+
"R9601",
|
| 1329 |
+
"R7604"
|
| 1330 |
+
],
|
| 1331 |
+
"R9601": [
|
| 1332 |
+
"R6323"
|
| 1333 |
+
],
|
| 1334 |
+
"R1983": [
|
| 1335 |
+
"R4360",
|
| 1336 |
+
"R9882"
|
| 1337 |
+
],
|
| 1338 |
+
"R4360": [
|
| 1339 |
+
"R1539",
|
| 1340 |
+
"R1983"
|
| 1341 |
+
],
|
| 1342 |
+
"R1539": [
|
| 1343 |
+
"R7651",
|
| 1344 |
+
"R4360"
|
| 1345 |
+
],
|
| 1346 |
+
"R7651": [
|
| 1347 |
+
"R1539",
|
| 1348 |
+
"R2538"
|
| 1349 |
+
],
|
| 1350 |
+
"R2538": [
|
| 1351 |
+
"R6565",
|
| 1352 |
+
"R7651"
|
| 1353 |
+
],
|
| 1354 |
+
"R6565": [
|
| 1355 |
+
"R2538",
|
| 1356 |
+
"R8046"
|
| 1357 |
+
],
|
| 1358 |
+
"R8046": [
|
| 1359 |
+
"R5010",
|
| 1360 |
+
"R6565"
|
| 1361 |
+
],
|
| 1362 |
+
"R5010": [
|
| 1363 |
+
"R4223",
|
| 1364 |
+
"R8046"
|
| 1365 |
+
],
|
| 1366 |
+
"R4223": [
|
| 1367 |
+
"R5010",
|
| 1368 |
+
"R4480"
|
| 1369 |
+
],
|
| 1370 |
+
"R4480": [
|
| 1371 |
+
"R4223"
|
| 1372 |
+
],
|
| 1373 |
+
"R1817": [
|
| 1374 |
+
"R9573",
|
| 1375 |
+
"R9882"
|
| 1376 |
+
],
|
| 1377 |
+
"R9573": [
|
| 1378 |
+
"R6916",
|
| 1379 |
+
"R1817"
|
| 1380 |
+
],
|
| 1381 |
+
"R6916": [
|
| 1382 |
+
"R5183",
|
| 1383 |
+
"R9573"
|
| 1384 |
+
],
|
| 1385 |
+
"R5183": [
|
| 1386 |
+
"R9185",
|
| 1387 |
+
"R6916"
|
| 1388 |
+
],
|
| 1389 |
+
"R9185": [
|
| 1390 |
+
"R9360",
|
| 1391 |
+
"R5183"
|
| 1392 |
+
],
|
| 1393 |
+
"R9360": [
|
| 1394 |
+
"R7610",
|
| 1395 |
+
"R9185"
|
| 1396 |
+
],
|
| 1397 |
+
"R7610": [
|
| 1398 |
+
"R1456",
|
| 1399 |
+
"R9360"
|
| 1400 |
+
],
|
| 1401 |
+
"R1456": [
|
| 1402 |
+
"R1620",
|
| 1403 |
+
"R7610"
|
| 1404 |
+
],
|
| 1405 |
+
"R1620": [
|
| 1406 |
+
"R3940",
|
| 1407 |
+
"R1456"
|
| 1408 |
+
],
|
| 1409 |
+
"R3940": [
|
| 1410 |
+
"R1620"
|
| 1411 |
+
],
|
| 1412 |
+
"R1096": [
|
| 1413 |
+
"R5144",
|
| 1414 |
+
"R9882"
|
| 1415 |
+
],
|
| 1416 |
+
"R5144": [
|
| 1417 |
+
"R1096",
|
| 1418 |
+
"R1902"
|
| 1419 |
+
],
|
| 1420 |
+
"R1902": [
|
| 1421 |
+
"R8334",
|
| 1422 |
+
"R5144"
|
| 1423 |
+
],
|
| 1424 |
+
"R8334": [
|
| 1425 |
+
"R6551",
|
| 1426 |
+
"R1902"
|
| 1427 |
+
],
|
| 1428 |
+
"R6551": [
|
| 1429 |
+
"R8468",
|
| 1430 |
+
"R8334"
|
| 1431 |
+
],
|
| 1432 |
+
"R8468": [
|
| 1433 |
+
"R1324",
|
| 1434 |
+
"R6551"
|
| 1435 |
+
],
|
| 1436 |
+
"R1324": [
|
| 1437 |
+
"R5225",
|
| 1438 |
+
"R8468"
|
| 1439 |
+
],
|
| 1440 |
+
"R5225": [
|
| 1441 |
+
"R1324",
|
| 1442 |
+
"R4741"
|
| 1443 |
+
],
|
| 1444 |
+
"R4741": [
|
| 1445 |
+
"R9364",
|
| 1446 |
+
"R5225"
|
| 1447 |
+
],
|
| 1448 |
+
"R9364": [
|
| 1449 |
+
"R4741"
|
| 1450 |
+
],
|
| 1451 |
+
"R2838": [
|
| 1452 |
+
"R2507",
|
| 1453 |
+
"R6073"
|
| 1454 |
+
],
|
| 1455 |
+
"R2507": [
|
| 1456 |
+
"R2838",
|
| 1457 |
+
"R8192"
|
| 1458 |
+
],
|
| 1459 |
+
"R8192": [
|
| 1460 |
+
"R6438",
|
| 1461 |
+
"R2507"
|
| 1462 |
+
],
|
| 1463 |
+
"R6438": [
|
| 1464 |
+
"R8192",
|
| 1465 |
+
"R9628"
|
| 1466 |
+
],
|
| 1467 |
+
"R9628": [
|
| 1468 |
+
"R8862",
|
| 1469 |
+
"R6438"
|
| 1470 |
+
],
|
| 1471 |
+
"R8862": [
|
| 1472 |
+
"R6044",
|
| 1473 |
+
"R9628"
|
| 1474 |
+
],
|
| 1475 |
+
"R6044": [
|
| 1476 |
+
"R6835",
|
| 1477 |
+
"R8862"
|
| 1478 |
+
],
|
| 1479 |
+
"R6835": [
|
| 1480 |
+
"R5678",
|
| 1481 |
+
"R6044"
|
| 1482 |
+
],
|
| 1483 |
+
"R5678": [
|
| 1484 |
+
"R4248",
|
| 1485 |
+
"R6835"
|
| 1486 |
+
],
|
| 1487 |
+
"R4248": [
|
| 1488 |
+
"R5678"
|
| 1489 |
+
],
|
| 1490 |
+
"R2864": [
|
| 1491 |
+
"R3673",
|
| 1492 |
+
"R6073"
|
| 1493 |
+
],
|
| 1494 |
+
"R3673": [
|
| 1495 |
+
"R6676",
|
| 1496 |
+
"R2864"
|
| 1497 |
+
],
|
| 1498 |
+
"R6676": [
|
| 1499 |
+
"R2265",
|
| 1500 |
+
"R3673"
|
| 1501 |
+
],
|
| 1502 |
+
"R2265": [
|
| 1503 |
+
"R6676",
|
| 1504 |
+
"R3612"
|
| 1505 |
+
],
|
| 1506 |
+
"R3612": [
|
| 1507 |
+
"R9927",
|
| 1508 |
+
"R2265"
|
| 1509 |
+
],
|
| 1510 |
+
"R9927": [
|
| 1511 |
+
"R3612",
|
| 1512 |
+
"R6684"
|
| 1513 |
+
],
|
| 1514 |
+
"R6684": [
|
| 1515 |
+
"R9927",
|
| 1516 |
+
"R4779"
|
| 1517 |
+
],
|
| 1518 |
+
"R4779": [
|
| 1519 |
+
"R2484",
|
| 1520 |
+
"R6684"
|
| 1521 |
+
],
|
| 1522 |
+
"R2484": [
|
| 1523 |
+
"R2599",
|
| 1524 |
+
"R4779"
|
| 1525 |
+
],
|
| 1526 |
+
"R2599": [
|
| 1527 |
+
"R2484"
|
| 1528 |
+
],
|
| 1529 |
+
"R3968": [
|
| 1530 |
+
"R6073",
|
| 1531 |
+
"R9809"
|
| 1532 |
+
],
|
| 1533 |
+
"R9809": [
|
| 1534 |
+
"R3968",
|
| 1535 |
+
"R7041"
|
| 1536 |
+
],
|
| 1537 |
+
"R7041": [
|
| 1538 |
+
"R2293",
|
| 1539 |
+
"R9809"
|
| 1540 |
+
],
|
| 1541 |
+
"R2293": [
|
| 1542 |
+
"R7041",
|
| 1543 |
+
"R8785"
|
| 1544 |
+
],
|
| 1545 |
+
"R8785": [
|
| 1546 |
+
"R2293",
|
| 1547 |
+
"R6879"
|
| 1548 |
+
],
|
| 1549 |
+
"R6879": [
|
| 1550 |
+
"R9148",
|
| 1551 |
+
"R8785"
|
| 1552 |
+
],
|
| 1553 |
+
"R9148": [
|
| 1554 |
+
"R8750",
|
| 1555 |
+
"R6879"
|
| 1556 |
+
],
|
| 1557 |
+
"R8750": [
|
| 1558 |
+
"R3373",
|
| 1559 |
+
"R9148"
|
| 1560 |
+
],
|
| 1561 |
+
"R3373": [
|
| 1562 |
+
"R3003",
|
| 1563 |
+
"R8750"
|
| 1564 |
+
],
|
| 1565 |
+
"R3003": [
|
| 1566 |
+
"R3373"
|
| 1567 |
+
]
|
| 1568 |
+
}
|
| 1569 |
+
}
|
tasks/maze-t32/instruction.md
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Find the exit of the maze
|
| 2 |
+
|
| 3 |
+
You are exploring a maze of rooms connected by doors to find the exit. The maze is a tree: from
|
| 4 |
+
the start room, corridors of rooms lead to junctions where the way divides, and the exit is one
|
| 5 |
+
of the dead ends at the far ends of the corridors. Every agent on your team starts in the same
|
| 6 |
+
room, in its own copy of the same maze: the same rooms, with the same doors listed in the same
|
| 7 |
+
order. Your position is your own: moving never moves a teammate.
|
| 8 |
+
|
| 9 |
+
Explore with the `maze` command in your shell:
|
| 10 |
+
|
| 11 |
+
- `maze look` describes your current room again, without moving;
|
| 12 |
+
- `maze move ROOM` walks through a door of your current room into the named adjacent room.
|
| 13 |
+
|
| 14 |
+
Each prints JSON: the room you are in (`room`), its doors (`doors`), whether it is the exit
|
| 15 |
+
(`exit`), the room you arrived from (`arrived_from`) and how many moves you have left
|
| 16 |
+
(`moves_left`), with a `notice` at a dead end. Only the doors listed for your current room are
|
| 17 |
+
reachable in one move; to go back, move to the room you arrived from. Room names carry no
|
| 18 |
+
information about where the exit is.
|
| 19 |
+
|
| 20 |
+
You can make at most 210 moves. Looking is free, and a refused move (into a room that is not
|
| 21 |
+
one of your doors) costs nothing.
|
| 22 |
+
|
| 23 |
+
Reaching the exit solves the task for the whole team and ends the run. If you have teammates
|
| 24 |
+
(your instructions name them), they are searching the same maze: what one of you learns about it
|
| 25 |
+
holds for everyone. Use the message board to share what you find and to read what they find.
|
| 26 |
+
Once you reach the exit, post that you have, then stop.
|
tasks/maze-t32/solution/solve.sh
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: walk the shortest path to the exit with `maze move`, from its own copy of the path.
|
| 3 |
+
set -e
|
| 4 |
+
for room in R2910 R7888 R6453 R3041 R2369 R7832 R4985 R6154 R2058 R6282 R9737 R9385 R2041 R3980 R7852 R6429 R9698 R8681 R1900 R7061 R7725 R3412 R4116 R7094 R5111 R2217 R2122 R4450 R3374 R3676; do
|
| 5 |
+
maze move "$room" > /dev/null
|
| 6 |
+
done
|
| 7 |
+
maze look
|
tasks/maze-t32/task.toml
ADDED
|
@@ -0,0 +1,48 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
# The maze service's own record of the walk, exported by its collect hook below once the agent
|
| 4 |
+
# is done: the grader's only input besides tests/expected.json.
|
| 5 |
+
[[artifacts]]
|
| 6 |
+
source = "/evidence/final.json"
|
| 7 |
+
service = "maze"
|
| 8 |
+
|
| 9 |
+
[[artifacts]]
|
| 10 |
+
source = "/evidence/moves.jsonl"
|
| 11 |
+
service = "maze"
|
| 12 |
+
|
| 13 |
+
[task]
|
| 14 |
+
name = "HuggingFaceSwarms/maze-t32"
|
| 15 |
+
version = "0.1.0"
|
| 16 |
+
description = "s3-maze: agents search their own copies of one maze; the first one out wins."
|
| 17 |
+
keywords = ["multi-agent", "message-board", "s3", "maze", "exploration"]
|
| 18 |
+
|
| 19 |
+
[metadata]
|
| 20 |
+
tree = 32
|
| 21 |
+
seed = 115
|
| 22 |
+
branching = 3
|
| 23 |
+
corridor = 10
|
| 24 |
+
depth = 3
|
| 25 |
+
rooms = 391
|
| 26 |
+
dead_ends = 27
|
| 27 |
+
shortest_path = 30
|
| 28 |
+
full_search = 780
|
| 29 |
+
move_budget = 210
|
| 30 |
+
|
| 31 |
+
[agent]
|
| 32 |
+
timeout_sec = 3600
|
| 33 |
+
|
| 34 |
+
[environment]
|
| 35 |
+
build_timeout_sec = 900
|
| 36 |
+
cpus = 1
|
| 37 |
+
memory_mb = 1024
|
| 38 |
+
|
| 39 |
+
[verifier]
|
| 40 |
+
# The grader runs in its own container (tests/Dockerfile) after the agent's has stopped, on
|
| 41 |
+
# what the maze service exported: nothing the agent's container holds reaches it.
|
| 42 |
+
environment_mode = "separate"
|
| 43 |
+
timeout_sec = 120
|
| 44 |
+
|
| 45 |
+
[[verifier.collect]]
|
| 46 |
+
service = "maze"
|
| 47 |
+
command = "python3 -I -S /app/export.py"
|
| 48 |
+
timeout_sec = 30
|
tasks/maze-t32/tests/Dockerfile
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.13-slim-bookworm@sha256:281d39ff02e3b389401586134ff9e6572954687822a58055ec07a60ded4e0b7f
|
| 2 |
+
# The verifier's own container (environment_mode = "separate"): the grader and the task's
|
| 3 |
+
# answer, never in the agent's container. Harbor adds /evidence from the maze service.
|
| 4 |
+
COPY test.sh grade.py expected.json /tests/
|
| 5 |
+
RUN chmod 755 /tests/test.sh
|
tasks/maze-t32/tests/expected.json
ADDED
|
@@ -0,0 +1,6 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"start": "R8064",
|
| 3 |
+
"exit": "R3676",
|
| 4 |
+
"budget": 210,
|
| 5 |
+
"tree_sha256": "cf627e17c96be3167567ab44d515ef26c2df3caf3fbf1fe48a0d9f0af0315428"
|
| 6 |
+
}
|
tasks/maze-t32/tests/grade.py
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""s3-maze's grader: reward 1 if the agent's walk reached the exit, from the maze service's own
|
| 2 |
+
record. Run by test.sh as `python3 -I -S grade.py`, in a fresh verifier container (the task's
|
| 3 |
+
`environment_mode = "separate"`), after the agent's container has stopped.
|
| 4 |
+
|
| 5 |
+
It reads only /evidence/final.json and /evidence/moves.jsonl, which the maze service exported
|
| 6 |
+
(export.py, Harbor's collect hook) and Harbor carried over, and expected.json (this folder,
|
| 7 |
+
never in the agent's container). Reward 1 needs all of: the export is the service's
|
| 8 |
+
(`exported_by`), for this task's tree (its sha256), start and move budget; the service says the
|
| 9 |
+
exit was reached and the walk ends there; and the move log's accepted moves are one unbroken
|
| 10 |
+
walk from the start to the exit, within the budget, as many as the service counted. Anything
|
| 11 |
+
else, a missing, unreadable or malformed file included, scores 0.
|
| 12 |
+
|
| 13 |
+
Each file counts only as a regular file of its own at exactly its path: no link anywhere on the
|
| 14 |
+
path is followed, and a FIFO cannot block the read. The reward file is written 0 first and
|
| 15 |
+
never through a link. Copies of both files stay in the verifier's folder, for the metrics.
|
| 16 |
+
EVIDENCE_DIR, EXPECTED and VERIFIER_DIR override the paths (no links in them), to test locally.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
import json
|
| 20 |
+
import os
|
| 21 |
+
import stat
|
| 22 |
+
|
| 23 |
+
EVIDENCE = os.environ.get("EVIDENCE_DIR", "/evidence")
|
| 24 |
+
EXPECTED = os.environ.get("EXPECTED", "/tests/expected.json")
|
| 25 |
+
VERIFIER = os.environ.get("VERIFIER_DIR", "/logs/verifier")
|
| 26 |
+
LIMIT = 16 << 20 # bytes
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def read_own(path: str) -> bytes:
|
| 30 |
+
"""The bytes of the regular file at exactly `path`: every folder on the way is opened
|
| 31 |
+
without following a link, and so is the file (a FIFO cannot block it); one link only."""
|
| 32 |
+
parts = os.path.abspath(path).split("/")[1:]
|
| 33 |
+
folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY)
|
| 34 |
+
try:
|
| 35 |
+
for part in parts[:-1]:
|
| 36 |
+
inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder)
|
| 37 |
+
os.close(folder)
|
| 38 |
+
folder = inner
|
| 39 |
+
fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder)
|
| 40 |
+
finally:
|
| 41 |
+
os.close(folder)
|
| 42 |
+
with os.fdopen(fd, "rb") as stream:
|
| 43 |
+
info = os.fstat(stream.fileno())
|
| 44 |
+
if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1:
|
| 45 |
+
raise ValueError("not a regular file of its own")
|
| 46 |
+
data = stream.read(LIMIT + 1)
|
| 47 |
+
if len(data) > LIMIT:
|
| 48 |
+
raise ValueError("too large")
|
| 49 |
+
return data
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def write_new(name: str, data: bytes) -> None:
|
| 53 |
+
path = os.path.join(VERIFIER, name)
|
| 54 |
+
try:
|
| 55 |
+
os.unlink(path) # never written through a link
|
| 56 |
+
except FileNotFoundError:
|
| 57 |
+
pass
|
| 58 |
+
fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644)
|
| 59 |
+
with os.fdopen(fd, "wb") as stream:
|
| 60 |
+
stream.write(data)
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def reject_constant(name):
|
| 64 |
+
raise ValueError(f"{name} is not JSON")
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def parse(data: bytes):
|
| 68 |
+
return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def walk_reaches_exit(final: dict, records: list, expected: dict) -> bool:
|
| 72 |
+
room, moves = expected["start"], 0
|
| 73 |
+
for record in records:
|
| 74 |
+
if not isinstance(record, dict) or record.get("ok") not in (True, False):
|
| 75 |
+
return False
|
| 76 |
+
if record["ok"] is True:
|
| 77 |
+
if record.get("from") != room or not isinstance(record.get("to"), str):
|
| 78 |
+
return False
|
| 79 |
+
room, moves = record["to"], moves + 1
|
| 80 |
+
return (room == expected["exit"] and moves == final.get("moves")
|
| 81 |
+
and 0 < moves <= expected["budget"])
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
def grade() -> bool:
|
| 85 |
+
expected = parse(read_own(EXPECTED))
|
| 86 |
+
final_data = read_own(os.path.join(EVIDENCE, "final.json"))
|
| 87 |
+
moves_data = read_own(os.path.join(EVIDENCE, "moves.jsonl"))
|
| 88 |
+
write_new("final.json", final_data)
|
| 89 |
+
write_new("moves.jsonl", moves_data)
|
| 90 |
+
final = parse(final_data)
|
| 91 |
+
records = [parse(line) for line in moves_data.splitlines() if line.strip()]
|
| 92 |
+
return (
|
| 93 |
+
isinstance(final, dict)
|
| 94 |
+
and final.get("exported_by") == "maze"
|
| 95 |
+
and final.get("tree_sha256") == expected["tree_sha256"]
|
| 96 |
+
and final.get("start") == expected["start"]
|
| 97 |
+
and final.get("budget") == expected["budget"]
|
| 98 |
+
and final.get("reached") is True
|
| 99 |
+
and final.get("room") == expected["exit"]
|
| 100 |
+
and walk_reaches_exit(final, records, expected)
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
os.makedirs(VERIFIER, exist_ok=True)
|
| 105 |
+
for name in ("reward.txt", "reward.json"):
|
| 106 |
+
try:
|
| 107 |
+
os.unlink(os.path.join(VERIFIER, name))
|
| 108 |
+
except FileNotFoundError:
|
| 109 |
+
pass
|
| 110 |
+
write_new("reward.txt", b"0")
|
| 111 |
+
try:
|
| 112 |
+
valid = grade()
|
| 113 |
+
except Exception: # missing, a link, not regular, invalid UTF-8 or JSON, a wrong shape
|
| 114 |
+
valid = False
|
| 115 |
+
if valid:
|
| 116 |
+
write_new("reward.txt", b"1")
|
| 117 |
+
print("reward:", 1 if valid else 0)
|
tasks/maze-t32/tests/test.sh
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# s3-maze's verifier, in a fresh container built from this folder (environment_mode =
|
| 3 |
+
# "separate"): reward 1 if the maze service's own record shows the agent's walk reached the exit
|
| 4 |
+
# (grade.py has the rules). Reward 0 is written before anything is checked, so a crash of the
|
| 5 |
+
# check also scores 0. Python runs isolated (-I -S): no module from the working directory,
|
| 6 |
+
# PYTHON* variables or site hooks can change what it imports. Besides bash, python3 is the only
|
| 7 |
+
# command this script runs.
|
| 8 |
+
case $0 in */*) here=${0%/*} ;; *) here=. ;; esac
|
| 9 |
+
export EXPECTED=${EXPECTED:-$here/expected.json}
|
| 10 |
+
export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}
|
| 11 |
+
[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"
|
| 12 |
+
python3 -I -S "$here/grade.py" || true
|
template/environment/agent/Dockerfile
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.13-slim-bookworm@sha256:281d39ff02e3b389401586134ff9e6572954687822a58055ec07a60ded4e0b7f
|
| 2 |
+
# The agent's container: only the `maze` command, which talks to the maze service. The tree and
|
| 3 |
+
# the exit are never here.
|
| 4 |
+
RUN apt-get update && apt-get install -y --no-install-recommends bash curl ca-certificates \
|
| 5 |
+
&& rm -rf /var/lib/apt/lists/*
|
| 6 |
+
COPY maze /usr/local/bin/maze
|
| 7 |
+
RUN chmod 755 /usr/local/bin/maze
|
| 8 |
+
WORKDIR /app
|
template/environment/agent/maze
ADDED
|
@@ -0,0 +1,53 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/usr/bin/env python3
|
| 2 |
+
"""maze look | maze move ROOM: explore the maze through its service (standard library only).
|
| 3 |
+
|
| 4 |
+
Prints the service's JSON for your current room: `room`, its `doors`, whether it is the `exit`,
|
| 5 |
+
the room you `arrived_from` and your `moves_left` (a dead end adds a `notice`). A refused move
|
| 6 |
+
adds an `error` and exits 1; the service unreachable exits 2.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
import json
|
| 10 |
+
import os
|
| 11 |
+
import sys
|
| 12 |
+
import time
|
| 13 |
+
import urllib.error
|
| 14 |
+
import urllib.request
|
| 15 |
+
|
| 16 |
+
URL = os.environ.get("MAZE_URL", "http://maze:8000").rstrip("/")
|
| 17 |
+
USAGE = "usage: maze look | maze move ROOM"
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def call(request: urllib.request.Request) -> tuple[int, dict]:
|
| 21 |
+
deadline = time.monotonic() + 30 # the service may still be starting
|
| 22 |
+
while True:
|
| 23 |
+
try:
|
| 24 |
+
with urllib.request.urlopen(request, timeout=30) as response:
|
| 25 |
+
return response.status, json.load(response)
|
| 26 |
+
except urllib.error.HTTPError as e:
|
| 27 |
+
try:
|
| 28 |
+
return e.code, json.load(e)
|
| 29 |
+
except ValueError:
|
| 30 |
+
return e.code, {"error": f"HTTP {e.code} from the maze service"}
|
| 31 |
+
except (urllib.error.URLError, ConnectionError, TimeoutError) as e:
|
| 32 |
+
if time.monotonic() > deadline:
|
| 33 |
+
return 0, {"error": f"the maze service is unreachable: {e}"}
|
| 34 |
+
time.sleep(1)
|
| 35 |
+
|
| 36 |
+
|
| 37 |
+
def main(argv: list[str]) -> int:
|
| 38 |
+
if argv == ["look"]:
|
| 39 |
+
request = urllib.request.Request(URL + "/look")
|
| 40 |
+
elif len(argv) == 2 and argv[0] == "move":
|
| 41 |
+
request = urllib.request.Request(
|
| 42 |
+
URL + "/move", data=json.dumps({"room": argv[1]}).encode(), method="POST",
|
| 43 |
+
headers={"Content-Type": "application/json"})
|
| 44 |
+
else:
|
| 45 |
+
print(USAGE, file=sys.stderr)
|
| 46 |
+
return 2
|
| 47 |
+
status, body = call(request)
|
| 48 |
+
print(json.dumps(body))
|
| 49 |
+
return 0 if status == 200 else 1 if status in (400, 409) else 2
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
if __name__ == "__main__":
|
| 53 |
+
sys.exit(main(sys.argv[1:]))
|
template/environment/maze/Dockerfile
ADDED
|
@@ -0,0 +1,9 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.13-slim-bookworm@sha256:281d39ff02e3b389401586134ff9e6572954687822a58055ec07a60ded4e0b7f
|
| 2 |
+
# The maze service: the tree (private, never in the agent's container), the walk's state and
|
| 3 |
+
# move log, the success check and the collect hook. Standard library only.
|
| 4 |
+
COPY engine.py service.py success.py export.py /app/
|
| 5 |
+
COPY tree.json /private/tree.json
|
| 6 |
+
RUN mkdir -p /var/lib/maze /evidence && chmod 0700 /private /var/lib/maze
|
| 7 |
+
ENV MAZE_TREE=/private/tree.json MAZE_STATE_DIR=/var/lib/maze
|
| 8 |
+
WORKDIR /app
|
| 9 |
+
CMD ["python3", "-I", "-S", "-B", "/app/service.py"]
|
template/environment/maze/engine.py
ADDED
|
@@ -0,0 +1,93 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""The maze: one agent's walk through its own copy of a tree of rooms (s3-maze).
|
| 2 |
+
|
| 3 |
+
The service (service.py) holds one Walk per Trial; budget.py simulates searches on this same
|
| 4 |
+
code. Python 3.10+, standard library only.
|
| 5 |
+
|
| 6 |
+
A tree is `{"start", "exit", "budget", "doors": {room: [neighbour, ...]}}`: each room lists its
|
| 7 |
+
doors in the order fixed when the tree was generated, the same for every agent and every visit.
|
| 8 |
+
"""
|
| 9 |
+
|
| 10 |
+
import json
|
| 11 |
+
|
| 12 |
+
DEAD_END = "Dead end: its only door leads back the way you came."
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
class Maze:
|
| 16 |
+
def __init__(self, tree: dict):
|
| 17 |
+
self.start = tree["start"]
|
| 18 |
+
self.exit = tree["exit"]
|
| 19 |
+
self.budget = int(tree["budget"])
|
| 20 |
+
self.doors = {room: list(doors) for room, doors in tree["doors"].items()}
|
| 21 |
+
|
| 22 |
+
@classmethod
|
| 23 |
+
def load(cls, path: str) -> "Maze":
|
| 24 |
+
with open(path, encoding="utf-8") as f:
|
| 25 |
+
return cls(json.load(f))
|
| 26 |
+
|
| 27 |
+
|
| 28 |
+
class Walk:
|
| 29 |
+
"""One agent's position and its accepted moves. Looking is free; a refused move costs
|
| 30 |
+
nothing; at most `budget` moves are accepted, and none once the exit is reached."""
|
| 31 |
+
|
| 32 |
+
def __init__(self, maze: Maze, room: str | None = None, arrived_from: str | None = None,
|
| 33 |
+
moves: int = 0, refused: int = 0):
|
| 34 |
+
self.maze = maze
|
| 35 |
+
self.room = room or maze.start
|
| 36 |
+
self.arrived_from = arrived_from
|
| 37 |
+
self.moves = moves
|
| 38 |
+
self.refused = refused
|
| 39 |
+
|
| 40 |
+
@property
|
| 41 |
+
def reached(self) -> bool:
|
| 42 |
+
return self.room == self.maze.exit
|
| 43 |
+
|
| 44 |
+
def look(self) -> dict:
|
| 45 |
+
"""The paper's observation (s3, Appendix H), plus the moves left."""
|
| 46 |
+
doors = self.maze.doors[self.room]
|
| 47 |
+
out = {"room": self.room, "doors": list(doors), "exit": self.reached,
|
| 48 |
+
"arrived_from": self.arrived_from, "moves_left": self.maze.budget - self.moves}
|
| 49 |
+
if len(doors) == 1 and not self.reached:
|
| 50 |
+
out["notice"] = DEAD_END
|
| 51 |
+
return out
|
| 52 |
+
|
| 53 |
+
def refusal(self, room) -> str | None:
|
| 54 |
+
"""Why a move into `room` is refused (a short code), or None."""
|
| 55 |
+
if self.reached:
|
| 56 |
+
return "at_exit"
|
| 57 |
+
if self.moves >= self.maze.budget:
|
| 58 |
+
return "no_moves_left"
|
| 59 |
+
if not isinstance(room, str) or room not in self.maze.doors[self.room]:
|
| 60 |
+
return "not_a_door"
|
| 61 |
+
return None
|
| 62 |
+
|
| 63 |
+
def move(self, room) -> tuple[dict, str | None]:
|
| 64 |
+
"""(the observation after moving into `room`, None), or (an error and the current
|
| 65 |
+
observation, the refusal's code)."""
|
| 66 |
+
why = self.refusal(room)
|
| 67 |
+
if why is not None:
|
| 68 |
+
self.refused += 1
|
| 69 |
+
return {"error": MESSAGES[why].format(room=_short(room), here=self.room,
|
| 70 |
+
budget=self.maze.budget), **self.look()}, why
|
| 71 |
+
self.arrived_from, self.room = self.room, room
|
| 72 |
+
self.moves += 1
|
| 73 |
+
return self.look(), None
|
| 74 |
+
|
| 75 |
+
def state(self) -> dict:
|
| 76 |
+
return {"room": self.room, "arrived_from": self.arrived_from, "moves": self.moves,
|
| 77 |
+
"refused": self.refused, "reached": self.reached}
|
| 78 |
+
|
| 79 |
+
@classmethod
|
| 80 |
+
def from_state(cls, maze: Maze, state: dict) -> "Walk":
|
| 81 |
+
return cls(maze, state["room"], state["arrived_from"], state["moves"], state["refused"])
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
MESSAGES = {
|
| 85 |
+
"at_exit": "You are at the exit: the task is solved.",
|
| 86 |
+
"no_moves_left": "No moves left: your budget of {budget} moves is used up.",
|
| 87 |
+
"not_a_door": "{room} is not a door of {here}: move into one of the doors listed for it.",
|
| 88 |
+
}
|
| 89 |
+
|
| 90 |
+
|
| 91 |
+
def _short(value) -> str:
|
| 92 |
+
text = value if isinstance(value, str) else json.dumps(value)
|
| 93 |
+
return text if len(text) <= 40 else text[:40] + "..."
|
template/environment/maze/export.py
ADDED
|
@@ -0,0 +1,40 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""Harbor's [[verifier.collect]] hook for s3-maze, run in this maze service once the agent is done
|
| 2 |
+
(its container already stopped): `python3 -I -S /app/export.py`.
|
| 3 |
+
|
| 4 |
+
Writes the service's own record of the walk to /evidence, which Harbor collects as artifacts
|
| 5 |
+
and hands to the grader in a fresh container: `final.json` (the state file, marked as exported
|
| 6 |
+
here) and `moves.jsonl` (the move log). Nothing in /evidence comes from the agent's container.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
import json
|
| 10 |
+
import os
|
| 11 |
+
|
| 12 |
+
STATE_DIR = os.environ.get("MAZE_STATE_DIR", "/var/lib/maze")
|
| 13 |
+
EVIDENCE = os.environ.get("MAZE_EVIDENCE_DIR", "/evidence")
|
| 14 |
+
LIMIT = 16 << 20
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
def read(name: str) -> bytes:
|
| 18 |
+
fd = os.open(os.path.join(STATE_DIR, name), os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK)
|
| 19 |
+
with os.fdopen(fd, "rb") as f:
|
| 20 |
+
return f.read(LIMIT)
|
| 21 |
+
|
| 22 |
+
|
| 23 |
+
def write(name: str, data: bytes) -> None:
|
| 24 |
+
path = os.path.join(EVIDENCE, name)
|
| 25 |
+
temp = path + ".tmp"
|
| 26 |
+
fd = os.open(temp, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644)
|
| 27 |
+
with os.fdopen(fd, "wb") as f:
|
| 28 |
+
f.write(data)
|
| 29 |
+
os.replace(temp, path)
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
os.makedirs(EVIDENCE, exist_ok=True)
|
| 33 |
+
state = json.loads(read("state.json"))
|
| 34 |
+
try:
|
| 35 |
+
moves = read("moves.jsonl")
|
| 36 |
+
except FileNotFoundError: # no move was ever asked for
|
| 37 |
+
moves = b""
|
| 38 |
+
write("moves.jsonl", moves)
|
| 39 |
+
write("final.json", json.dumps({**state, "exported_by": "maze"}).encode())
|
| 40 |
+
print("exported", state.get("moves"), "moves; exit reached:", state.get("reached"))
|
template/environment/maze/service.py
ADDED
|
@@ -0,0 +1,167 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""The maze service: one agent's own copy of the maze, behind `maze look` and `maze move ROOM`.
|
| 2 |
+
|
| 3 |
+
Two routes answer, `GET /look` and `POST /move` (`{"room": <a door>}`), each with the current
|
| 4 |
+
room's observation (engine.Walk.look); every other request gets a 404 that names nothing. So the
|
| 5 |
+
tree and the exit stay in this container: an agent learns a room's doors only by standing in it,
|
| 6 |
+
and that a room is the exit only by reaching it.
|
| 7 |
+
|
| 8 |
+
Every move, accepted or refused, is appended to the move log (agent, from, to, time) before it is
|
| 9 |
+
answered, and the walk's state file is replaced after it: success.py (flock's success_check)
|
| 10 |
+
and export.py (Harbor's collect hook, for the grader) read those two files. A restarted
|
| 11 |
+
container resumes from them. Python 3.10+, standard library only.
|
| 12 |
+
"""
|
| 13 |
+
|
| 14 |
+
import hashlib
|
| 15 |
+
import json
|
| 16 |
+
import os
|
| 17 |
+
import sys
|
| 18 |
+
import threading
|
| 19 |
+
from datetime import datetime, timezone
|
| 20 |
+
from http.server import BaseHTTPRequestHandler, ThreadingHTTPServer
|
| 21 |
+
|
| 22 |
+
sys.dont_write_bytecode = True # -I ignores PYTHONDONTWRITEBYTECODE
|
| 23 |
+
sys.path.insert(0, os.path.dirname(os.path.abspath(__file__)))
|
| 24 |
+
from engine import Maze, Walk # noqa: E402
|
| 25 |
+
|
| 26 |
+
TREE = os.environ.get("MAZE_TREE", "/private/tree.json")
|
| 27 |
+
STATE_DIR = os.environ.get("MAZE_STATE_DIR", "/var/lib/maze")
|
| 28 |
+
PORT = int(os.environ.get("MAZE_PORT", "8000"))
|
| 29 |
+
# The Trial whose maze this is: compose's project name, `<swarm>-<agent>-tN__env`
|
| 30 |
+
AGENT = os.environ.get("MAZE_AGENT", "").removesuffix("__env") or "agent"
|
| 31 |
+
BODY_LIMIT = 4096
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
def now() -> str:
|
| 35 |
+
return datetime.now(timezone.utc).isoformat(timespec="milliseconds")
|
| 36 |
+
|
| 37 |
+
|
| 38 |
+
class Service:
|
| 39 |
+
def __init__(self, tree_path: str, state_dir: str, agent: str):
|
| 40 |
+
with open(tree_path, "rb") as f:
|
| 41 |
+
raw = f.read()
|
| 42 |
+
self.maze = Maze(json.loads(raw))
|
| 43 |
+
self.tree_sha256 = hashlib.sha256(raw).hexdigest()
|
| 44 |
+
self.agent = agent
|
| 45 |
+
self.state_path = os.path.join(state_dir, "state.json")
|
| 46 |
+
self.log_path = os.path.join(state_dir, "moves.jsonl")
|
| 47 |
+
self.lock = threading.Lock()
|
| 48 |
+
os.makedirs(state_dir, exist_ok=True)
|
| 49 |
+
self.reached_at = None
|
| 50 |
+
if os.path.exists(self.state_path): # a restarted container
|
| 51 |
+
with open(self.state_path, encoding="utf-8") as f:
|
| 52 |
+
saved = json.load(f)
|
| 53 |
+
self.walk = Walk.from_state(self.maze, saved)
|
| 54 |
+
self.reached_at = saved.get("reached_at")
|
| 55 |
+
else:
|
| 56 |
+
self.walk = Walk(self.maze)
|
| 57 |
+
self.save()
|
| 58 |
+
|
| 59 |
+
def save(self) -> None:
|
| 60 |
+
state = {"agent": self.agent, "start": self.maze.start, "budget": self.maze.budget,
|
| 61 |
+
"tree_sha256": self.tree_sha256, **self.walk.state(),
|
| 62 |
+
"reached_at": self.reached_at}
|
| 63 |
+
temp = self.state_path + ".tmp"
|
| 64 |
+
with open(temp, "w", encoding="utf-8") as f:
|
| 65 |
+
json.dump(state, f)
|
| 66 |
+
f.flush()
|
| 67 |
+
os.fsync(f.fileno())
|
| 68 |
+
os.replace(temp, self.state_path)
|
| 69 |
+
|
| 70 |
+
def look(self) -> dict:
|
| 71 |
+
with self.lock:
|
| 72 |
+
return self.walk.look()
|
| 73 |
+
|
| 74 |
+
def move(self, room) -> tuple[dict, str | None]:
|
| 75 |
+
with self.lock:
|
| 76 |
+
here = self.walk.room
|
| 77 |
+
body, why = self.walk.move(room)
|
| 78 |
+
if why is None and self.walk.reached:
|
| 79 |
+
self.reached_at = now()
|
| 80 |
+
self.log(here, _logged(room), why)
|
| 81 |
+
return body, why
|
| 82 |
+
|
| 83 |
+
def bad_request(self) -> None:
|
| 84 |
+
"""A move request without a room: refused, and logged like any other."""
|
| 85 |
+
with self.lock:
|
| 86 |
+
self.walk.refused += 1
|
| 87 |
+
self.log(self.walk.room, None, "bad_request")
|
| 88 |
+
|
| 89 |
+
def log(self, here: str, to, why: str | None) -> None:
|
| 90 |
+
record = {"agent": self.agent, "from": here, "to": to, "time": now(), "ok": why is None,
|
| 91 |
+
"moves": self.walk.moves}
|
| 92 |
+
if why is not None:
|
| 93 |
+
record["refused"] = why
|
| 94 |
+
with open(self.log_path, "a", encoding="utf-8") as f:
|
| 95 |
+
f.write(json.dumps(record) + "\n")
|
| 96 |
+
f.flush()
|
| 97 |
+
os.fsync(f.fileno())
|
| 98 |
+
self.save()
|
| 99 |
+
|
| 100 |
+
|
| 101 |
+
def _logged(room):
|
| 102 |
+
"""What the agent asked to move into, as the log keeps it (a string, at most 64 chars)."""
|
| 103 |
+
text = room if isinstance(room, str) else json.dumps(room)
|
| 104 |
+
return text[:64]
|
| 105 |
+
|
| 106 |
+
|
| 107 |
+
def handler(service: Service):
|
| 108 |
+
class Handler(BaseHTTPRequestHandler):
|
| 109 |
+
server_version = "maze"
|
| 110 |
+
sys_version = ""
|
| 111 |
+
|
| 112 |
+
def reply(self, code: int, body: dict) -> None:
|
| 113 |
+
data = json.dumps(body).encode()
|
| 114 |
+
self.send_response(code)
|
| 115 |
+
self.send_header("Content-Type", "application/json")
|
| 116 |
+
self.send_header("Content-Length", str(len(data)))
|
| 117 |
+
self.end_headers()
|
| 118 |
+
self.wfile.write(data)
|
| 119 |
+
|
| 120 |
+
def not_found(self) -> None:
|
| 121 |
+
self.reply(404, {"error": "not found: use `maze look` or `maze move ROOM`"})
|
| 122 |
+
|
| 123 |
+
def do_GET(self): # noqa: N802
|
| 124 |
+
if self.path == "/look":
|
| 125 |
+
self.reply(200, service.look())
|
| 126 |
+
else:
|
| 127 |
+
self.not_found()
|
| 128 |
+
|
| 129 |
+
def do_POST(self): # noqa: N802
|
| 130 |
+
if self.path != "/move":
|
| 131 |
+
return self.not_found()
|
| 132 |
+
try:
|
| 133 |
+
length = int(self.headers.get("Content-Length") or 0)
|
| 134 |
+
except ValueError:
|
| 135 |
+
length = -1
|
| 136 |
+
room = None
|
| 137 |
+
if 0 < length <= BODY_LIMIT:
|
| 138 |
+
try:
|
| 139 |
+
room = json.loads(self.rfile.read(length)).get("room")
|
| 140 |
+
except (ValueError, AttributeError):
|
| 141 |
+
pass
|
| 142 |
+
if room is None:
|
| 143 |
+
service.bad_request()
|
| 144 |
+
return self.reply(400, {"error": 'send {"room": "<a door of your room>"}'})
|
| 145 |
+
body, why = service.move(room)
|
| 146 |
+
self.reply(200 if why is None else 409, body)
|
| 147 |
+
|
| 148 |
+
def do_PUT(self): # noqa: N802
|
| 149 |
+
self.not_found()
|
| 150 |
+
|
| 151 |
+
do_DELETE = do_PATCH = do_HEAD = do_OPTIONS = do_PUT # noqa: N815
|
| 152 |
+
|
| 153 |
+
def log_message(self, *args): # the move log is the record
|
| 154 |
+
pass
|
| 155 |
+
|
| 156 |
+
return Handler
|
| 157 |
+
|
| 158 |
+
|
| 159 |
+
def main() -> None:
|
| 160 |
+
service = Service(TREE, STATE_DIR, AGENT)
|
| 161 |
+
server = ThreadingHTTPServer(("0.0.0.0", PORT), handler(service))
|
| 162 |
+
server.daemon_threads = True
|
| 163 |
+
server.serve_forever()
|
| 164 |
+
|
| 165 |
+
|
| 166 |
+
if __name__ == "__main__":
|
| 167 |
+
main()
|
template/environment/maze/success.py
ADDED
|
@@ -0,0 +1,29 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""flock's success_check for s3-maze (`stop_on_success`), run in this maze service, never in the
|
| 2 |
+
agent's container: `python3 -I -S /app/success.py`.
|
| 3 |
+
|
| 4 |
+
Read-only: it prints `{"success": <the exit was reached>, "evidence": {...}}` from the walk's
|
| 5 |
+
state file, which only service.py writes. No state yet, or one that can't be read, is not a
|
| 6 |
+
success.
|
| 7 |
+
"""
|
| 8 |
+
|
| 9 |
+
import json
|
| 10 |
+
import os
|
| 11 |
+
|
| 12 |
+
STATE = os.environ.get("MAZE_STATE_DIR", "/var/lib/maze") + "/state.json"
|
| 13 |
+
|
| 14 |
+
|
| 15 |
+
def read_state() -> dict | None:
|
| 16 |
+
try:
|
| 17 |
+
fd = os.open(STATE, os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK)
|
| 18 |
+
with os.fdopen(fd, "rb") as f:
|
| 19 |
+
state = json.loads(f.read(1 << 16))
|
| 20 |
+
return state if isinstance(state, dict) else None
|
| 21 |
+
except (OSError, ValueError):
|
| 22 |
+
return None
|
| 23 |
+
|
| 24 |
+
|
| 25 |
+
state = read_state()
|
| 26 |
+
reached = bool(state) and state.get("reached") is True
|
| 27 |
+
evidence = ({"exit_reached": reached, "moves": state.get("moves"),
|
| 28 |
+
"reached_at": state.get("reached_at")} if state else {"state": "unreadable"})
|
| 29 |
+
print(json.dumps({"success": reached, "evidence": evidence}))
|
template/tests/Dockerfile
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
FROM python:3.13-slim-bookworm@sha256:281d39ff02e3b389401586134ff9e6572954687822a58055ec07a60ded4e0b7f
|
| 2 |
+
# The verifier's own container (environment_mode = "separate"): the grader and the task's
|
| 3 |
+
# answer, never in the agent's container. Harbor adds /evidence from the maze service.
|
| 4 |
+
COPY test.sh grade.py expected.json /tests/
|
| 5 |
+
RUN chmod 755 /tests/test.sh
|
template/tests/grade.py
ADDED
|
@@ -0,0 +1,117 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
"""s3-maze's grader: reward 1 if the agent's walk reached the exit, from the maze service's own
|
| 2 |
+
record. Run by test.sh as `python3 -I -S grade.py`, in a fresh verifier container (the task's
|
| 3 |
+
`environment_mode = "separate"`), after the agent's container has stopped.
|
| 4 |
+
|
| 5 |
+
It reads only /evidence/final.json and /evidence/moves.jsonl, which the maze service exported
|
| 6 |
+
(export.py, Harbor's collect hook) and Harbor carried over, and expected.json (this folder,
|
| 7 |
+
never in the agent's container). Reward 1 needs all of: the export is the service's
|
| 8 |
+
(`exported_by`), for this task's tree (its sha256), start and move budget; the service says the
|
| 9 |
+
exit was reached and the walk ends there; and the move log's accepted moves are one unbroken
|
| 10 |
+
walk from the start to the exit, within the budget, as many as the service counted. Anything
|
| 11 |
+
else, a missing, unreadable or malformed file included, scores 0.
|
| 12 |
+
|
| 13 |
+
Each file counts only as a regular file of its own at exactly its path: no link anywhere on the
|
| 14 |
+
path is followed, and a FIFO cannot block the read. The reward file is written 0 first and
|
| 15 |
+
never through a link. Copies of both files stay in the verifier's folder, for the metrics.
|
| 16 |
+
EVIDENCE_DIR, EXPECTED and VERIFIER_DIR override the paths (no links in them), to test locally.
|
| 17 |
+
"""
|
| 18 |
+
|
| 19 |
+
import json
|
| 20 |
+
import os
|
| 21 |
+
import stat
|
| 22 |
+
|
| 23 |
+
EVIDENCE = os.environ.get("EVIDENCE_DIR", "/evidence")
|
| 24 |
+
EXPECTED = os.environ.get("EXPECTED", "/tests/expected.json")
|
| 25 |
+
VERIFIER = os.environ.get("VERIFIER_DIR", "/logs/verifier")
|
| 26 |
+
LIMIT = 16 << 20 # bytes
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def read_own(path: str) -> bytes:
|
| 30 |
+
"""The bytes of the regular file at exactly `path`: every folder on the way is opened
|
| 31 |
+
without following a link, and so is the file (a FIFO cannot block it); one link only."""
|
| 32 |
+
parts = os.path.abspath(path).split("/")[1:]
|
| 33 |
+
folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY)
|
| 34 |
+
try:
|
| 35 |
+
for part in parts[:-1]:
|
| 36 |
+
inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder)
|
| 37 |
+
os.close(folder)
|
| 38 |
+
folder = inner
|
| 39 |
+
fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder)
|
| 40 |
+
finally:
|
| 41 |
+
os.close(folder)
|
| 42 |
+
with os.fdopen(fd, "rb") as stream:
|
| 43 |
+
info = os.fstat(stream.fileno())
|
| 44 |
+
if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1:
|
| 45 |
+
raise ValueError("not a regular file of its own")
|
| 46 |
+
data = stream.read(LIMIT + 1)
|
| 47 |
+
if len(data) > LIMIT:
|
| 48 |
+
raise ValueError("too large")
|
| 49 |
+
return data
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
def write_new(name: str, data: bytes) -> None:
|
| 53 |
+
path = os.path.join(VERIFIER, name)
|
| 54 |
+
try:
|
| 55 |
+
os.unlink(path) # never written through a link
|
| 56 |
+
except FileNotFoundError:
|
| 57 |
+
pass
|
| 58 |
+
fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_EXCL | os.O_NOFOLLOW, 0o644)
|
| 59 |
+
with os.fdopen(fd, "wb") as stream:
|
| 60 |
+
stream.write(data)
|
| 61 |
+
|
| 62 |
+
|
| 63 |
+
def reject_constant(name):
|
| 64 |
+
raise ValueError(f"{name} is not JSON")
|
| 65 |
+
|
| 66 |
+
|
| 67 |
+
def parse(data: bytes):
|
| 68 |
+
return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
|
| 69 |
+
|
| 70 |
+
|
| 71 |
+
def walk_reaches_exit(final: dict, records: list, expected: dict) -> bool:
|
| 72 |
+
room, moves = expected["start"], 0
|
| 73 |
+
for record in records:
|
| 74 |
+
if not isinstance(record, dict) or record.get("ok") not in (True, False):
|
| 75 |
+
return False
|
| 76 |
+
if record["ok"] is True:
|
| 77 |
+
if record.get("from") != room or not isinstance(record.get("to"), str):
|
| 78 |
+
return False
|
| 79 |
+
room, moves = record["to"], moves + 1
|
| 80 |
+
return (room == expected["exit"] and moves == final.get("moves")
|
| 81 |
+
and 0 < moves <= expected["budget"])
|
| 82 |
+
|
| 83 |
+
|
| 84 |
+
def grade() -> bool:
|
| 85 |
+
expected = parse(read_own(EXPECTED))
|
| 86 |
+
final_data = read_own(os.path.join(EVIDENCE, "final.json"))
|
| 87 |
+
moves_data = read_own(os.path.join(EVIDENCE, "moves.jsonl"))
|
| 88 |
+
write_new("final.json", final_data)
|
| 89 |
+
write_new("moves.jsonl", moves_data)
|
| 90 |
+
final = parse(final_data)
|
| 91 |
+
records = [parse(line) for line in moves_data.splitlines() if line.strip()]
|
| 92 |
+
return (
|
| 93 |
+
isinstance(final, dict)
|
| 94 |
+
and final.get("exported_by") == "maze"
|
| 95 |
+
and final.get("tree_sha256") == expected["tree_sha256"]
|
| 96 |
+
and final.get("start") == expected["start"]
|
| 97 |
+
and final.get("budget") == expected["budget"]
|
| 98 |
+
and final.get("reached") is True
|
| 99 |
+
and final.get("room") == expected["exit"]
|
| 100 |
+
and walk_reaches_exit(final, records, expected)
|
| 101 |
+
)
|
| 102 |
+
|
| 103 |
+
|
| 104 |
+
os.makedirs(VERIFIER, exist_ok=True)
|
| 105 |
+
for name in ("reward.txt", "reward.json"):
|
| 106 |
+
try:
|
| 107 |
+
os.unlink(os.path.join(VERIFIER, name))
|
| 108 |
+
except FileNotFoundError:
|
| 109 |
+
pass
|
| 110 |
+
write_new("reward.txt", b"0")
|
| 111 |
+
try:
|
| 112 |
+
valid = grade()
|
| 113 |
+
except Exception: # missing, a link, not regular, invalid UTF-8 or JSON, a wrong shape
|
| 114 |
+
valid = False
|
| 115 |
+
if valid:
|
| 116 |
+
write_new("reward.txt", b"1")
|
| 117 |
+
print("reward:", 1 if valid else 0)
|
template/tests/test.sh
ADDED
|
@@ -0,0 +1,12 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# s3-maze's verifier, in a fresh container built from this folder (environment_mode =
|
| 3 |
+
# "separate"): reward 1 if the maze service's own record shows the agent's walk reached the exit
|
| 4 |
+
# (grade.py has the rules). Reward 0 is written before anything is checked, so a crash of the
|
| 5 |
+
# check also scores 0. Python runs isolated (-I -S): no module from the working directory,
|
| 6 |
+
# PYTHON* variables or site hooks can change what it imports. Besides bash, python3 is the only
|
| 7 |
+
# command this script runs.
|
| 8 |
+
case $0 in */*) here=${0%/*} ;; *) here=. ;; esac
|
| 9 |
+
export EXPECTED=${EXPECTED:-$here/expected.json}
|
| 10 |
+
export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}
|
| 11 |
+
[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"
|
| 12 |
+
python3 -I -S "$here/grade.py" || true
|