s3-aggregation: 160 tasks from seed 115, role files, grader, oracle, checks (part 6)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
- tasks/agg-p23-n01/tests/test.sh +42 -0
- tasks/agg-p23-n02/instruction.md +20 -0
- tasks/agg-p23-n02/solution/solve.sh +5 -0
- tasks/agg-p23-n02/task.toml +26 -0
- tasks/agg-p23-n02/tests/expected.json +1 -0
- tasks/agg-p23-n02/tests/test.sh +42 -0
- tasks/agg-p23-n04/instruction.md +20 -0
- tasks/agg-p23-n04/solution/solve.sh +5 -0
- tasks/agg-p23-n04/task.toml +26 -0
- tasks/agg-p23-n04/tests/expected.json +1 -0
- tasks/agg-p23-n04/tests/test.sh +42 -0
- tasks/agg-p23-n08/instruction.md +20 -0
- tasks/agg-p23-n08/solution/solve.sh +5 -0
- tasks/agg-p23-n08/task.toml +26 -0
- tasks/agg-p23-n08/tests/expected.json +1 -0
- tasks/agg-p23-n08/tests/test.sh +42 -0
- tasks/agg-p23-n16/instruction.md +20 -0
- tasks/agg-p23-n16/solution/solve.sh +5 -0
- tasks/agg-p23-n16/task.toml +26 -0
- tasks/agg-p23-n16/tests/expected.json +1 -0
- tasks/agg-p23-n16/tests/test.sh +42 -0
- tasks/agg-p24-n01/instruction.md +8 -0
- tasks/agg-p24-n01/solution/solve.sh +5 -0
- tasks/agg-p24-n01/task.toml +26 -0
- tasks/agg-p24-n01/tests/expected.json +1 -0
- tasks/agg-p24-n01/tests/test.sh +42 -0
- tasks/agg-p24-n02/instruction.md +20 -0
- tasks/agg-p24-n02/solution/solve.sh +5 -0
- tasks/agg-p24-n02/task.toml +26 -0
- tasks/agg-p24-n02/tests/expected.json +1 -0
- tasks/agg-p24-n02/tests/test.sh +42 -0
- tasks/agg-p24-n04/instruction.md +20 -0
- tasks/agg-p24-n04/solution/solve.sh +5 -0
- tasks/agg-p24-n04/task.toml +26 -0
- tasks/agg-p24-n04/tests/expected.json +1 -0
- tasks/agg-p24-n04/tests/test.sh +42 -0
- tasks/agg-p24-n08/instruction.md +20 -0
- tasks/agg-p24-n08/solution/solve.sh +5 -0
- tasks/agg-p24-n08/task.toml +26 -0
- tasks/agg-p24-n08/tests/expected.json +1 -0
- tasks/agg-p24-n08/tests/test.sh +42 -0
- tasks/agg-p24-n16/instruction.md +20 -0
- tasks/agg-p24-n16/solution/solve.sh +5 -0
- tasks/agg-p24-n16/task.toml +26 -0
- tasks/agg-p24-n16/tests/expected.json +1 -0
- tasks/agg-p24-n16/tests/test.sh +42 -0
- tasks/agg-p25-n01/instruction.md +8 -0
- tasks/agg-p25-n01/solution/solve.sh +5 -0
- tasks/agg-p25-n01/task.toml +26 -0
- tasks/agg-p25-n01/tests/expected.json +1 -0
tasks/agg-p23-n01/tests/test.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in
|
| 3 |
+
# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or
|
| 4 |
+
# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or
|
| 5 |
+
# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0
|
| 6 |
+
# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of
|
| 7 |
+
# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to
|
| 8 |
+
# test the grader locally.
|
| 9 |
+
answer=${ANSWER:-/app/answer.json}
|
| 10 |
+
expected=${EXPECTED:-$(dirname "$0")/expected.json}
|
| 11 |
+
verifier=${VERIFIER_DIR:-/logs/verifier}
|
| 12 |
+
mkdir -p "$verifier"
|
| 13 |
+
echo 0 > "$verifier/reward.txt"
|
| 14 |
+
cp "$answer" "$verifier/answer.json" 2>/dev/null || true
|
| 15 |
+
ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def reject_constant(name):
|
| 21 |
+
raise ValueError(f"{name} is not JSON")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def load(path):
|
| 25 |
+
with open(path, "rb") as stream:
|
| 26 |
+
return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
try:
|
| 30 |
+
answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"])
|
| 31 |
+
valid = (
|
| 32 |
+
isinstance(answer, list)
|
| 33 |
+
and all(type(x) is int for x in answer) # not bool, float or str
|
| 34 |
+
and answer == expected
|
| 35 |
+
)
|
| 36 |
+
except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError
|
| 37 |
+
valid = False
|
| 38 |
+
if valid:
|
| 39 |
+
with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream:
|
| 40 |
+
stream.write("1")
|
| 41 |
+
print("reward:", 1 if valid else 0)
|
| 42 |
+
PY
|
tasks/agg-p23-n02/instruction.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sort the team's private numbers
|
| 2 |
+
|
| 3 |
+
You are on a team of 2 agents solving a private-information number sorting task. Each agent
|
| 4 |
+
holds one private integer from 1 to 99, written in English words. Yours is in your instructions,
|
| 5 |
+
under "Your private number". You know only your own number, and the others don't know it unless
|
| 6 |
+
you tell them.
|
| 7 |
+
|
| 8 |
+
The team must find all 2 numbers and list their numeric values in ascending order. Keep equal
|
| 9 |
+
numbers from different agents as separate entries: each agent's number appears once in the list,
|
| 10 |
+
even when another agent holds the same value.
|
| 11 |
+
|
| 12 |
+
1. Share your number with the team on the message board.
|
| 13 |
+
2. Read the board for the other participants' numbers. Note which participant each number came
|
| 14 |
+
from, so that a number posted more than once is counted once.
|
| 15 |
+
3. Once you have one number from every participant, yourself included, write `/app/answer.json`
|
| 16 |
+
(create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order.
|
| 17 |
+
Then stop.
|
| 18 |
+
|
| 19 |
+
Any agent may write the full answer, and the team succeeds if at least one agent's answer is
|
| 20 |
+
correct. Your instructions name the other participants and explain the board's tools.
|
tasks/agg-p23-n02/solution/solve.sh
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: the team's answer from its own copy (not tests/), to validate the grader.
|
| 3 |
+
answer=${ANSWER:-/app/answer.json}
|
| 4 |
+
mkdir -p "$(dirname "$answer")"
|
| 5 |
+
echo '[20, 55]' > "$answer"
|
tasks/agg-p23-n02/task.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "HuggingFaceSwarms/agg-p23-n02"
|
| 5 |
+
version = "0.1.0"
|
| 6 |
+
description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order."
|
| 7 |
+
keywords = ["multi-agent", "message-board", "s3", "aggregation"]
|
| 8 |
+
|
| 9 |
+
[metadata]
|
| 10 |
+
problem = 23
|
| 11 |
+
agents = 2
|
| 12 |
+
seed = 115
|
| 13 |
+
|
| 14 |
+
[agent]
|
| 15 |
+
timeout_sec = 1800
|
| 16 |
+
|
| 17 |
+
[environment]
|
| 18 |
+
# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it
|
| 19 |
+
# too. Nothing task-specific is in the container: each agent's number reaches it only through
|
| 20 |
+
# its own instructions (the flock role file), and tests/ arrive only when the agent is done.
|
| 21 |
+
docker_image = "python:3.12-slim"
|
| 22 |
+
cpus = 1
|
| 23 |
+
memory_mb = 1024
|
| 24 |
+
|
| 25 |
+
[verifier]
|
| 26 |
+
timeout_sec = 60
|
tasks/agg-p23-n02/tests/expected.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[20, 55]
|
tasks/agg-p23-n02/tests/test.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in
|
| 3 |
+
# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or
|
| 4 |
+
# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or
|
| 5 |
+
# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0
|
| 6 |
+
# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of
|
| 7 |
+
# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to
|
| 8 |
+
# test the grader locally.
|
| 9 |
+
answer=${ANSWER:-/app/answer.json}
|
| 10 |
+
expected=${EXPECTED:-$(dirname "$0")/expected.json}
|
| 11 |
+
verifier=${VERIFIER_DIR:-/logs/verifier}
|
| 12 |
+
mkdir -p "$verifier"
|
| 13 |
+
echo 0 > "$verifier/reward.txt"
|
| 14 |
+
cp "$answer" "$verifier/answer.json" 2>/dev/null || true
|
| 15 |
+
ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def reject_constant(name):
|
| 21 |
+
raise ValueError(f"{name} is not JSON")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def load(path):
|
| 25 |
+
with open(path, "rb") as stream:
|
| 26 |
+
return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
try:
|
| 30 |
+
answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"])
|
| 31 |
+
valid = (
|
| 32 |
+
isinstance(answer, list)
|
| 33 |
+
and all(type(x) is int for x in answer) # not bool, float or str
|
| 34 |
+
and answer == expected
|
| 35 |
+
)
|
| 36 |
+
except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError
|
| 37 |
+
valid = False
|
| 38 |
+
if valid:
|
| 39 |
+
with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream:
|
| 40 |
+
stream.write("1")
|
| 41 |
+
print("reward:", 1 if valid else 0)
|
| 42 |
+
PY
|
tasks/agg-p23-n04/instruction.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sort the team's private numbers
|
| 2 |
+
|
| 3 |
+
You are on a team of 4 agents solving a private-information number sorting task. Each agent
|
| 4 |
+
holds one private integer from 1 to 99, written in English words. Yours is in your instructions,
|
| 5 |
+
under "Your private number". You know only your own number, and the others don't know it unless
|
| 6 |
+
you tell them.
|
| 7 |
+
|
| 8 |
+
The team must find all 4 numbers and list their numeric values in ascending order. Keep equal
|
| 9 |
+
numbers from different agents as separate entries: each agent's number appears once in the list,
|
| 10 |
+
even when another agent holds the same value.
|
| 11 |
+
|
| 12 |
+
1. Share your number with the team on the message board.
|
| 13 |
+
2. Read the board for the other participants' numbers. Note which participant each number came
|
| 14 |
+
from, so that a number posted more than once is counted once.
|
| 15 |
+
3. Once you have one number from every participant, yourself included, write `/app/answer.json`
|
| 16 |
+
(create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order.
|
| 17 |
+
Then stop.
|
| 18 |
+
|
| 19 |
+
Any agent may write the full answer, and the team succeeds if at least one agent's answer is
|
| 20 |
+
correct. Your instructions name the other participants and explain the board's tools.
|
tasks/agg-p23-n04/solution/solve.sh
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: the team's answer from its own copy (not tests/), to validate the grader.
|
| 3 |
+
answer=${ANSWER:-/app/answer.json}
|
| 4 |
+
mkdir -p "$(dirname "$answer")"
|
| 5 |
+
echo '[1, 20, 45, 55]' > "$answer"
|
tasks/agg-p23-n04/task.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "HuggingFaceSwarms/agg-p23-n04"
|
| 5 |
+
version = "0.1.0"
|
| 6 |
+
description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order."
|
| 7 |
+
keywords = ["multi-agent", "message-board", "s3", "aggregation"]
|
| 8 |
+
|
| 9 |
+
[metadata]
|
| 10 |
+
problem = 23
|
| 11 |
+
agents = 4
|
| 12 |
+
seed = 115
|
| 13 |
+
|
| 14 |
+
[agent]
|
| 15 |
+
timeout_sec = 1800
|
| 16 |
+
|
| 17 |
+
[environment]
|
| 18 |
+
# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it
|
| 19 |
+
# too. Nothing task-specific is in the container: each agent's number reaches it only through
|
| 20 |
+
# its own instructions (the flock role file), and tests/ arrive only when the agent is done.
|
| 21 |
+
docker_image = "python:3.12-slim"
|
| 22 |
+
cpus = 1
|
| 23 |
+
memory_mb = 1024
|
| 24 |
+
|
| 25 |
+
[verifier]
|
| 26 |
+
timeout_sec = 60
|
tasks/agg-p23-n04/tests/expected.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[1, 20, 45, 55]
|
tasks/agg-p23-n04/tests/test.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in
|
| 3 |
+
# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or
|
| 4 |
+
# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or
|
| 5 |
+
# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0
|
| 6 |
+
# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of
|
| 7 |
+
# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to
|
| 8 |
+
# test the grader locally.
|
| 9 |
+
answer=${ANSWER:-/app/answer.json}
|
| 10 |
+
expected=${EXPECTED:-$(dirname "$0")/expected.json}
|
| 11 |
+
verifier=${VERIFIER_DIR:-/logs/verifier}
|
| 12 |
+
mkdir -p "$verifier"
|
| 13 |
+
echo 0 > "$verifier/reward.txt"
|
| 14 |
+
cp "$answer" "$verifier/answer.json" 2>/dev/null || true
|
| 15 |
+
ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def reject_constant(name):
|
| 21 |
+
raise ValueError(f"{name} is not JSON")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def load(path):
|
| 25 |
+
with open(path, "rb") as stream:
|
| 26 |
+
return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
try:
|
| 30 |
+
answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"])
|
| 31 |
+
valid = (
|
| 32 |
+
isinstance(answer, list)
|
| 33 |
+
and all(type(x) is int for x in answer) # not bool, float or str
|
| 34 |
+
and answer == expected
|
| 35 |
+
)
|
| 36 |
+
except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError
|
| 37 |
+
valid = False
|
| 38 |
+
if valid:
|
| 39 |
+
with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream:
|
| 40 |
+
stream.write("1")
|
| 41 |
+
print("reward:", 1 if valid else 0)
|
| 42 |
+
PY
|
tasks/agg-p23-n08/instruction.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sort the team's private numbers
|
| 2 |
+
|
| 3 |
+
You are on a team of 8 agents solving a private-information number sorting task. Each agent
|
| 4 |
+
holds one private integer from 1 to 99, written in English words. Yours is in your instructions,
|
| 5 |
+
under "Your private number". You know only your own number, and the others don't know it unless
|
| 6 |
+
you tell them.
|
| 7 |
+
|
| 8 |
+
The team must find all 8 numbers and list their numeric values in ascending order. Keep equal
|
| 9 |
+
numbers from different agents as separate entries: each agent's number appears once in the list,
|
| 10 |
+
even when another agent holds the same value.
|
| 11 |
+
|
| 12 |
+
1. Share your number with the team on the message board.
|
| 13 |
+
2. Read the board for the other participants' numbers. Note which participant each number came
|
| 14 |
+
from, so that a number posted more than once is counted once.
|
| 15 |
+
3. Once you have one number from every participant, yourself included, write `/app/answer.json`
|
| 16 |
+
(create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order.
|
| 17 |
+
Then stop.
|
| 18 |
+
|
| 19 |
+
Any agent may write the full answer, and the team succeeds if at least one agent's answer is
|
| 20 |
+
correct. Your instructions name the other participants and explain the board's tools.
|
tasks/agg-p23-n08/solution/solve.sh
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: the team's answer from its own copy (not tests/), to validate the grader.
|
| 3 |
+
answer=${ANSWER:-/app/answer.json}
|
| 4 |
+
mkdir -p "$(dirname "$answer")"
|
| 5 |
+
echo '[1, 20, 30, 45, 55, 79, 81, 84]' > "$answer"
|
tasks/agg-p23-n08/task.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "HuggingFaceSwarms/agg-p23-n08"
|
| 5 |
+
version = "0.1.0"
|
| 6 |
+
description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order."
|
| 7 |
+
keywords = ["multi-agent", "message-board", "s3", "aggregation"]
|
| 8 |
+
|
| 9 |
+
[metadata]
|
| 10 |
+
problem = 23
|
| 11 |
+
agents = 8
|
| 12 |
+
seed = 115
|
| 13 |
+
|
| 14 |
+
[agent]
|
| 15 |
+
timeout_sec = 1800
|
| 16 |
+
|
| 17 |
+
[environment]
|
| 18 |
+
# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it
|
| 19 |
+
# too. Nothing task-specific is in the container: each agent's number reaches it only through
|
| 20 |
+
# its own instructions (the flock role file), and tests/ arrive only when the agent is done.
|
| 21 |
+
docker_image = "python:3.12-slim"
|
| 22 |
+
cpus = 1
|
| 23 |
+
memory_mb = 1024
|
| 24 |
+
|
| 25 |
+
[verifier]
|
| 26 |
+
timeout_sec = 60
|
tasks/agg-p23-n08/tests/expected.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[1, 20, 30, 45, 55, 79, 81, 84]
|
tasks/agg-p23-n08/tests/test.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in
|
| 3 |
+
# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or
|
| 4 |
+
# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or
|
| 5 |
+
# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0
|
| 6 |
+
# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of
|
| 7 |
+
# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to
|
| 8 |
+
# test the grader locally.
|
| 9 |
+
answer=${ANSWER:-/app/answer.json}
|
| 10 |
+
expected=${EXPECTED:-$(dirname "$0")/expected.json}
|
| 11 |
+
verifier=${VERIFIER_DIR:-/logs/verifier}
|
| 12 |
+
mkdir -p "$verifier"
|
| 13 |
+
echo 0 > "$verifier/reward.txt"
|
| 14 |
+
cp "$answer" "$verifier/answer.json" 2>/dev/null || true
|
| 15 |
+
ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def reject_constant(name):
|
| 21 |
+
raise ValueError(f"{name} is not JSON")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def load(path):
|
| 25 |
+
with open(path, "rb") as stream:
|
| 26 |
+
return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
try:
|
| 30 |
+
answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"])
|
| 31 |
+
valid = (
|
| 32 |
+
isinstance(answer, list)
|
| 33 |
+
and all(type(x) is int for x in answer) # not bool, float or str
|
| 34 |
+
and answer == expected
|
| 35 |
+
)
|
| 36 |
+
except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError
|
| 37 |
+
valid = False
|
| 38 |
+
if valid:
|
| 39 |
+
with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream:
|
| 40 |
+
stream.write("1")
|
| 41 |
+
print("reward:", 1 if valid else 0)
|
| 42 |
+
PY
|
tasks/agg-p23-n16/instruction.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sort the team's private numbers
|
| 2 |
+
|
| 3 |
+
You are on a team of 16 agents solving a private-information number sorting task. Each agent
|
| 4 |
+
holds one private integer from 1 to 99, written in English words. Yours is in your instructions,
|
| 5 |
+
under "Your private number". You know only your own number, and the others don't know it unless
|
| 6 |
+
you tell them.
|
| 7 |
+
|
| 8 |
+
The team must find all 16 numbers and list their numeric values in ascending order. Keep equal
|
| 9 |
+
numbers from different agents as separate entries: each agent's number appears once in the list,
|
| 10 |
+
even when another agent holds the same value.
|
| 11 |
+
|
| 12 |
+
1. Share your number with the team on the message board.
|
| 13 |
+
2. Read the board for the other participants' numbers. Note which participant each number came
|
| 14 |
+
from, so that a number posted more than once is counted once.
|
| 15 |
+
3. Once you have one number from every participant, yourself included, write `/app/answer.json`
|
| 16 |
+
(create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order.
|
| 17 |
+
Then stop.
|
| 18 |
+
|
| 19 |
+
Any agent may write the full answer, and the team succeeds if at least one agent's answer is
|
| 20 |
+
correct. Your instructions name the other participants and explain the board's tools.
|
tasks/agg-p23-n16/solution/solve.sh
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: the team's answer from its own copy (not tests/), to validate the grader.
|
| 3 |
+
answer=${ANSWER:-/app/answer.json}
|
| 4 |
+
mkdir -p "$(dirname "$answer")"
|
| 5 |
+
echo '[1, 3, 7, 16, 20, 30, 35, 45, 51, 52, 55, 69, 79, 81, 84, 96]' > "$answer"
|
tasks/agg-p23-n16/task.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "HuggingFaceSwarms/agg-p23-n16"
|
| 5 |
+
version = "0.1.0"
|
| 6 |
+
description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order."
|
| 7 |
+
keywords = ["multi-agent", "message-board", "s3", "aggregation"]
|
| 8 |
+
|
| 9 |
+
[metadata]
|
| 10 |
+
problem = 23
|
| 11 |
+
agents = 16
|
| 12 |
+
seed = 115
|
| 13 |
+
|
| 14 |
+
[agent]
|
| 15 |
+
timeout_sec = 1800
|
| 16 |
+
|
| 17 |
+
[environment]
|
| 18 |
+
# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it
|
| 19 |
+
# too. Nothing task-specific is in the container: each agent's number reaches it only through
|
| 20 |
+
# its own instructions (the flock role file), and tests/ arrive only when the agent is done.
|
| 21 |
+
docker_image = "python:3.12-slim"
|
| 22 |
+
cpus = 1
|
| 23 |
+
memory_mb = 1024
|
| 24 |
+
|
| 25 |
+
[verifier]
|
| 26 |
+
timeout_sec = 60
|
tasks/agg-p23-n16/tests/expected.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[1, 3, 7, 16, 20, 30, 35, 45, 51, 52, 55, 69, 79, 81, 84, 96]
|
tasks/agg-p23-n16/tests/test.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in
|
| 3 |
+
# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or
|
| 4 |
+
# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or
|
| 5 |
+
# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0
|
| 6 |
+
# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of
|
| 7 |
+
# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to
|
| 8 |
+
# test the grader locally.
|
| 9 |
+
answer=${ANSWER:-/app/answer.json}
|
| 10 |
+
expected=${EXPECTED:-$(dirname "$0")/expected.json}
|
| 11 |
+
verifier=${VERIFIER_DIR:-/logs/verifier}
|
| 12 |
+
mkdir -p "$verifier"
|
| 13 |
+
echo 0 > "$verifier/reward.txt"
|
| 14 |
+
cp "$answer" "$verifier/answer.json" 2>/dev/null || true
|
| 15 |
+
ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def reject_constant(name):
|
| 21 |
+
raise ValueError(f"{name} is not JSON")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def load(path):
|
| 25 |
+
with open(path, "rb") as stream:
|
| 26 |
+
return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
try:
|
| 30 |
+
answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"])
|
| 31 |
+
valid = (
|
| 32 |
+
isinstance(answer, list)
|
| 33 |
+
and all(type(x) is int for x in answer) # not bool, float or str
|
| 34 |
+
and answer == expected
|
| 35 |
+
)
|
| 36 |
+
except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError
|
| 37 |
+
valid = False
|
| 38 |
+
if valid:
|
| 39 |
+
with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream:
|
| 40 |
+
stream.write("1")
|
| 41 |
+
print("reward:", 1 if valid else 0)
|
| 42 |
+
PY
|
tasks/agg-p24-n01/instruction.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sort the team's private numbers
|
| 2 |
+
|
| 3 |
+
You are the only agent on this team, solving a private-information number sorting task. You
|
| 4 |
+
hold one private integer from 1 to 99, written in English words. It is in your instructions,
|
| 5 |
+
under "Your private number".
|
| 6 |
+
|
| 7 |
+
Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric
|
| 8 |
+
value, as digits. Then stop.
|
tasks/agg-p24-n01/solution/solve.sh
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: the team's answer from its own copy (not tests/), to validate the grader.
|
| 3 |
+
answer=${ANSWER:-/app/answer.json}
|
| 4 |
+
mkdir -p "$(dirname "$answer")"
|
| 5 |
+
echo '[95]' > "$answer"
|
tasks/agg-p24-n01/task.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "HuggingFaceSwarms/agg-p24-n01"
|
| 5 |
+
version = "0.1.0"
|
| 6 |
+
description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order."
|
| 7 |
+
keywords = ["multi-agent", "message-board", "s3", "aggregation"]
|
| 8 |
+
|
| 9 |
+
[metadata]
|
| 10 |
+
problem = 24
|
| 11 |
+
agents = 1
|
| 12 |
+
seed = 115
|
| 13 |
+
|
| 14 |
+
[agent]
|
| 15 |
+
timeout_sec = 1800
|
| 16 |
+
|
| 17 |
+
[environment]
|
| 18 |
+
# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it
|
| 19 |
+
# too. Nothing task-specific is in the container: each agent's number reaches it only through
|
| 20 |
+
# its own instructions (the flock role file), and tests/ arrive only when the agent is done.
|
| 21 |
+
docker_image = "python:3.12-slim"
|
| 22 |
+
cpus = 1
|
| 23 |
+
memory_mb = 1024
|
| 24 |
+
|
| 25 |
+
[verifier]
|
| 26 |
+
timeout_sec = 60
|
tasks/agg-p24-n01/tests/expected.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[95]
|
tasks/agg-p24-n01/tests/test.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in
|
| 3 |
+
# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or
|
| 4 |
+
# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or
|
| 5 |
+
# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0
|
| 6 |
+
# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of
|
| 7 |
+
# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to
|
| 8 |
+
# test the grader locally.
|
| 9 |
+
answer=${ANSWER:-/app/answer.json}
|
| 10 |
+
expected=${EXPECTED:-$(dirname "$0")/expected.json}
|
| 11 |
+
verifier=${VERIFIER_DIR:-/logs/verifier}
|
| 12 |
+
mkdir -p "$verifier"
|
| 13 |
+
echo 0 > "$verifier/reward.txt"
|
| 14 |
+
cp "$answer" "$verifier/answer.json" 2>/dev/null || true
|
| 15 |
+
ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def reject_constant(name):
|
| 21 |
+
raise ValueError(f"{name} is not JSON")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def load(path):
|
| 25 |
+
with open(path, "rb") as stream:
|
| 26 |
+
return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
try:
|
| 30 |
+
answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"])
|
| 31 |
+
valid = (
|
| 32 |
+
isinstance(answer, list)
|
| 33 |
+
and all(type(x) is int for x in answer) # not bool, float or str
|
| 34 |
+
and answer == expected
|
| 35 |
+
)
|
| 36 |
+
except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError
|
| 37 |
+
valid = False
|
| 38 |
+
if valid:
|
| 39 |
+
with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream:
|
| 40 |
+
stream.write("1")
|
| 41 |
+
print("reward:", 1 if valid else 0)
|
| 42 |
+
PY
|
tasks/agg-p24-n02/instruction.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sort the team's private numbers
|
| 2 |
+
|
| 3 |
+
You are on a team of 2 agents solving a private-information number sorting task. Each agent
|
| 4 |
+
holds one private integer from 1 to 99, written in English words. Yours is in your instructions,
|
| 5 |
+
under "Your private number". You know only your own number, and the others don't know it unless
|
| 6 |
+
you tell them.
|
| 7 |
+
|
| 8 |
+
The team must find all 2 numbers and list their numeric values in ascending order. Keep equal
|
| 9 |
+
numbers from different agents as separate entries: each agent's number appears once in the list,
|
| 10 |
+
even when another agent holds the same value.
|
| 11 |
+
|
| 12 |
+
1. Share your number with the team on the message board.
|
| 13 |
+
2. Read the board for the other participants' numbers. Note which participant each number came
|
| 14 |
+
from, so that a number posted more than once is counted once.
|
| 15 |
+
3. Once you have one number from every participant, yourself included, write `/app/answer.json`
|
| 16 |
+
(create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order.
|
| 17 |
+
Then stop.
|
| 18 |
+
|
| 19 |
+
Any agent may write the full answer, and the team succeeds if at least one agent's answer is
|
| 20 |
+
correct. Your instructions name the other participants and explain the board's tools.
|
tasks/agg-p24-n02/solution/solve.sh
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: the team's answer from its own copy (not tests/), to validate the grader.
|
| 3 |
+
answer=${ANSWER:-/app/answer.json}
|
| 4 |
+
mkdir -p "$(dirname "$answer")"
|
| 5 |
+
echo '[82, 95]' > "$answer"
|
tasks/agg-p24-n02/task.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "HuggingFaceSwarms/agg-p24-n02"
|
| 5 |
+
version = "0.1.0"
|
| 6 |
+
description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order."
|
| 7 |
+
keywords = ["multi-agent", "message-board", "s3", "aggregation"]
|
| 8 |
+
|
| 9 |
+
[metadata]
|
| 10 |
+
problem = 24
|
| 11 |
+
agents = 2
|
| 12 |
+
seed = 115
|
| 13 |
+
|
| 14 |
+
[agent]
|
| 15 |
+
timeout_sec = 1800
|
| 16 |
+
|
| 17 |
+
[environment]
|
| 18 |
+
# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it
|
| 19 |
+
# too. Nothing task-specific is in the container: each agent's number reaches it only through
|
| 20 |
+
# its own instructions (the flock role file), and tests/ arrive only when the agent is done.
|
| 21 |
+
docker_image = "python:3.12-slim"
|
| 22 |
+
cpus = 1
|
| 23 |
+
memory_mb = 1024
|
| 24 |
+
|
| 25 |
+
[verifier]
|
| 26 |
+
timeout_sec = 60
|
tasks/agg-p24-n02/tests/expected.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[82, 95]
|
tasks/agg-p24-n02/tests/test.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in
|
| 3 |
+
# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or
|
| 4 |
+
# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or
|
| 5 |
+
# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0
|
| 6 |
+
# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of
|
| 7 |
+
# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to
|
| 8 |
+
# test the grader locally.
|
| 9 |
+
answer=${ANSWER:-/app/answer.json}
|
| 10 |
+
expected=${EXPECTED:-$(dirname "$0")/expected.json}
|
| 11 |
+
verifier=${VERIFIER_DIR:-/logs/verifier}
|
| 12 |
+
mkdir -p "$verifier"
|
| 13 |
+
echo 0 > "$verifier/reward.txt"
|
| 14 |
+
cp "$answer" "$verifier/answer.json" 2>/dev/null || true
|
| 15 |
+
ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def reject_constant(name):
|
| 21 |
+
raise ValueError(f"{name} is not JSON")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def load(path):
|
| 25 |
+
with open(path, "rb") as stream:
|
| 26 |
+
return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
try:
|
| 30 |
+
answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"])
|
| 31 |
+
valid = (
|
| 32 |
+
isinstance(answer, list)
|
| 33 |
+
and all(type(x) is int for x in answer) # not bool, float or str
|
| 34 |
+
and answer == expected
|
| 35 |
+
)
|
| 36 |
+
except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError
|
| 37 |
+
valid = False
|
| 38 |
+
if valid:
|
| 39 |
+
with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream:
|
| 40 |
+
stream.write("1")
|
| 41 |
+
print("reward:", 1 if valid else 0)
|
| 42 |
+
PY
|
tasks/agg-p24-n04/instruction.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sort the team's private numbers
|
| 2 |
+
|
| 3 |
+
You are on a team of 4 agents solving a private-information number sorting task. Each agent
|
| 4 |
+
holds one private integer from 1 to 99, written in English words. Yours is in your instructions,
|
| 5 |
+
under "Your private number". You know only your own number, and the others don't know it unless
|
| 6 |
+
you tell them.
|
| 7 |
+
|
| 8 |
+
The team must find all 4 numbers and list their numeric values in ascending order. Keep equal
|
| 9 |
+
numbers from different agents as separate entries: each agent's number appears once in the list,
|
| 10 |
+
even when another agent holds the same value.
|
| 11 |
+
|
| 12 |
+
1. Share your number with the team on the message board.
|
| 13 |
+
2. Read the board for the other participants' numbers. Note which participant each number came
|
| 14 |
+
from, so that a number posted more than once is counted once.
|
| 15 |
+
3. Once you have one number from every participant, yourself included, write `/app/answer.json`
|
| 16 |
+
(create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order.
|
| 17 |
+
Then stop.
|
| 18 |
+
|
| 19 |
+
Any agent may write the full answer, and the team succeeds if at least one agent's answer is
|
| 20 |
+
correct. Your instructions name the other participants and explain the board's tools.
|
tasks/agg-p24-n04/solution/solve.sh
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: the team's answer from its own copy (not tests/), to validate the grader.
|
| 3 |
+
answer=${ANSWER:-/app/answer.json}
|
| 4 |
+
mkdir -p "$(dirname "$answer")"
|
| 5 |
+
echo '[5, 50, 82, 95]' > "$answer"
|
tasks/agg-p24-n04/task.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "HuggingFaceSwarms/agg-p24-n04"
|
| 5 |
+
version = "0.1.0"
|
| 6 |
+
description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order."
|
| 7 |
+
keywords = ["multi-agent", "message-board", "s3", "aggregation"]
|
| 8 |
+
|
| 9 |
+
[metadata]
|
| 10 |
+
problem = 24
|
| 11 |
+
agents = 4
|
| 12 |
+
seed = 115
|
| 13 |
+
|
| 14 |
+
[agent]
|
| 15 |
+
timeout_sec = 1800
|
| 16 |
+
|
| 17 |
+
[environment]
|
| 18 |
+
# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it
|
| 19 |
+
# too. Nothing task-specific is in the container: each agent's number reaches it only through
|
| 20 |
+
# its own instructions (the flock role file), and tests/ arrive only when the agent is done.
|
| 21 |
+
docker_image = "python:3.12-slim"
|
| 22 |
+
cpus = 1
|
| 23 |
+
memory_mb = 1024
|
| 24 |
+
|
| 25 |
+
[verifier]
|
| 26 |
+
timeout_sec = 60
|
tasks/agg-p24-n04/tests/expected.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[5, 50, 82, 95]
|
tasks/agg-p24-n04/tests/test.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in
|
| 3 |
+
# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or
|
| 4 |
+
# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or
|
| 5 |
+
# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0
|
| 6 |
+
# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of
|
| 7 |
+
# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to
|
| 8 |
+
# test the grader locally.
|
| 9 |
+
answer=${ANSWER:-/app/answer.json}
|
| 10 |
+
expected=${EXPECTED:-$(dirname "$0")/expected.json}
|
| 11 |
+
verifier=${VERIFIER_DIR:-/logs/verifier}
|
| 12 |
+
mkdir -p "$verifier"
|
| 13 |
+
echo 0 > "$verifier/reward.txt"
|
| 14 |
+
cp "$answer" "$verifier/answer.json" 2>/dev/null || true
|
| 15 |
+
ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def reject_constant(name):
|
| 21 |
+
raise ValueError(f"{name} is not JSON")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def load(path):
|
| 25 |
+
with open(path, "rb") as stream:
|
| 26 |
+
return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
try:
|
| 30 |
+
answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"])
|
| 31 |
+
valid = (
|
| 32 |
+
isinstance(answer, list)
|
| 33 |
+
and all(type(x) is int for x in answer) # not bool, float or str
|
| 34 |
+
and answer == expected
|
| 35 |
+
)
|
| 36 |
+
except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError
|
| 37 |
+
valid = False
|
| 38 |
+
if valid:
|
| 39 |
+
with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream:
|
| 40 |
+
stream.write("1")
|
| 41 |
+
print("reward:", 1 if valid else 0)
|
| 42 |
+
PY
|
tasks/agg-p24-n08/instruction.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sort the team's private numbers
|
| 2 |
+
|
| 3 |
+
You are on a team of 8 agents solving a private-information number sorting task. Each agent
|
| 4 |
+
holds one private integer from 1 to 99, written in English words. Yours is in your instructions,
|
| 5 |
+
under "Your private number". You know only your own number, and the others don't know it unless
|
| 6 |
+
you tell them.
|
| 7 |
+
|
| 8 |
+
The team must find all 8 numbers and list their numeric values in ascending order. Keep equal
|
| 9 |
+
numbers from different agents as separate entries: each agent's number appears once in the list,
|
| 10 |
+
even when another agent holds the same value.
|
| 11 |
+
|
| 12 |
+
1. Share your number with the team on the message board.
|
| 13 |
+
2. Read the board for the other participants' numbers. Note which participant each number came
|
| 14 |
+
from, so that a number posted more than once is counted once.
|
| 15 |
+
3. Once you have one number from every participant, yourself included, write `/app/answer.json`
|
| 16 |
+
(create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order.
|
| 17 |
+
Then stop.
|
| 18 |
+
|
| 19 |
+
Any agent may write the full answer, and the team succeeds if at least one agent's answer is
|
| 20 |
+
correct. Your instructions name the other participants and explain the board's tools.
|
tasks/agg-p24-n08/solution/solve.sh
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: the team's answer from its own copy (not tests/), to validate the grader.
|
| 3 |
+
answer=${ANSWER:-/app/answer.json}
|
| 4 |
+
mkdir -p "$(dirname "$answer")"
|
| 5 |
+
echo '[5, 38, 50, 82, 87, 89, 95, 95]' > "$answer"
|
tasks/agg-p24-n08/task.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "HuggingFaceSwarms/agg-p24-n08"
|
| 5 |
+
version = "0.1.0"
|
| 6 |
+
description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order."
|
| 7 |
+
keywords = ["multi-agent", "message-board", "s3", "aggregation"]
|
| 8 |
+
|
| 9 |
+
[metadata]
|
| 10 |
+
problem = 24
|
| 11 |
+
agents = 8
|
| 12 |
+
seed = 115
|
| 13 |
+
|
| 14 |
+
[agent]
|
| 15 |
+
timeout_sec = 1800
|
| 16 |
+
|
| 17 |
+
[environment]
|
| 18 |
+
# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it
|
| 19 |
+
# too. Nothing task-specific is in the container: each agent's number reaches it only through
|
| 20 |
+
# its own instructions (the flock role file), and tests/ arrive only when the agent is done.
|
| 21 |
+
docker_image = "python:3.12-slim"
|
| 22 |
+
cpus = 1
|
| 23 |
+
memory_mb = 1024
|
| 24 |
+
|
| 25 |
+
[verifier]
|
| 26 |
+
timeout_sec = 60
|
tasks/agg-p24-n08/tests/expected.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[5, 38, 50, 82, 87, 89, 95, 95]
|
tasks/agg-p24-n08/tests/test.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in
|
| 3 |
+
# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or
|
| 4 |
+
# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or
|
| 5 |
+
# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0
|
| 6 |
+
# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of
|
| 7 |
+
# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to
|
| 8 |
+
# test the grader locally.
|
| 9 |
+
answer=${ANSWER:-/app/answer.json}
|
| 10 |
+
expected=${EXPECTED:-$(dirname "$0")/expected.json}
|
| 11 |
+
verifier=${VERIFIER_DIR:-/logs/verifier}
|
| 12 |
+
mkdir -p "$verifier"
|
| 13 |
+
echo 0 > "$verifier/reward.txt"
|
| 14 |
+
cp "$answer" "$verifier/answer.json" 2>/dev/null || true
|
| 15 |
+
ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def reject_constant(name):
|
| 21 |
+
raise ValueError(f"{name} is not JSON")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def load(path):
|
| 25 |
+
with open(path, "rb") as stream:
|
| 26 |
+
return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
try:
|
| 30 |
+
answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"])
|
| 31 |
+
valid = (
|
| 32 |
+
isinstance(answer, list)
|
| 33 |
+
and all(type(x) is int for x in answer) # not bool, float or str
|
| 34 |
+
and answer == expected
|
| 35 |
+
)
|
| 36 |
+
except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError
|
| 37 |
+
valid = False
|
| 38 |
+
if valid:
|
| 39 |
+
with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream:
|
| 40 |
+
stream.write("1")
|
| 41 |
+
print("reward:", 1 if valid else 0)
|
| 42 |
+
PY
|
tasks/agg-p24-n16/instruction.md
ADDED
|
@@ -0,0 +1,20 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sort the team's private numbers
|
| 2 |
+
|
| 3 |
+
You are on a team of 16 agents solving a private-information number sorting task. Each agent
|
| 4 |
+
holds one private integer from 1 to 99, written in English words. Yours is in your instructions,
|
| 5 |
+
under "Your private number". You know only your own number, and the others don't know it unless
|
| 6 |
+
you tell them.
|
| 7 |
+
|
| 8 |
+
The team must find all 16 numbers and list their numeric values in ascending order. Keep equal
|
| 9 |
+
numbers from different agents as separate entries: each agent's number appears once in the list,
|
| 10 |
+
even when another agent holds the same value.
|
| 11 |
+
|
| 12 |
+
1. Share your number with the team on the message board.
|
| 13 |
+
2. Read the board for the other participants' numbers. Note which participant each number came
|
| 14 |
+
from, so that a number posted more than once is counted once.
|
| 15 |
+
3. Once you have one number from every participant, yourself included, write `/app/answer.json`
|
| 16 |
+
(create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order.
|
| 17 |
+
Then stop.
|
| 18 |
+
|
| 19 |
+
Any agent may write the full answer, and the team succeeds if at least one agent's answer is
|
| 20 |
+
correct. Your instructions name the other participants and explain the board's tools.
|
tasks/agg-p24-n16/solution/solve.sh
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: the team's answer from its own copy (not tests/), to validate the grader.
|
| 3 |
+
answer=${ANSWER:-/app/answer.json}
|
| 4 |
+
mkdir -p "$(dirname "$answer")"
|
| 5 |
+
echo '[5, 10, 37, 38, 39, 39, 50, 67, 82, 87, 87, 89, 92, 92, 95, 95]' > "$answer"
|
tasks/agg-p24-n16/task.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "HuggingFaceSwarms/agg-p24-n16"
|
| 5 |
+
version = "0.1.0"
|
| 6 |
+
description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order."
|
| 7 |
+
keywords = ["multi-agent", "message-board", "s3", "aggregation"]
|
| 8 |
+
|
| 9 |
+
[metadata]
|
| 10 |
+
problem = 24
|
| 11 |
+
agents = 16
|
| 12 |
+
seed = 115
|
| 13 |
+
|
| 14 |
+
[agent]
|
| 15 |
+
timeout_sec = 1800
|
| 16 |
+
|
| 17 |
+
[environment]
|
| 18 |
+
# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it
|
| 19 |
+
# too. Nothing task-specific is in the container: each agent's number reaches it only through
|
| 20 |
+
# its own instructions (the flock role file), and tests/ arrive only when the agent is done.
|
| 21 |
+
docker_image = "python:3.12-slim"
|
| 22 |
+
cpus = 1
|
| 23 |
+
memory_mb = 1024
|
| 24 |
+
|
| 25 |
+
[verifier]
|
| 26 |
+
timeout_sec = 60
|
tasks/agg-p24-n16/tests/expected.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[5, 10, 37, 38, 39, 39, 50, 67, 82, 87, 87, 89, 92, 92, 95, 95]
|
tasks/agg-p24-n16/tests/test.sh
ADDED
|
@@ -0,0 +1,42 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in
|
| 3 |
+
# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or
|
| 4 |
+
# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or
|
| 5 |
+
# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0
|
| 6 |
+
# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of
|
| 7 |
+
# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to
|
| 8 |
+
# test the grader locally.
|
| 9 |
+
answer=${ANSWER:-/app/answer.json}
|
| 10 |
+
expected=${EXPECTED:-$(dirname "$0")/expected.json}
|
| 11 |
+
verifier=${VERIFIER_DIR:-/logs/verifier}
|
| 12 |
+
mkdir -p "$verifier"
|
| 13 |
+
echo 0 > "$verifier/reward.txt"
|
| 14 |
+
cp "$answer" "$verifier/answer.json" 2>/dev/null || true
|
| 15 |
+
ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true
|
| 16 |
+
import json
|
| 17 |
+
import os
|
| 18 |
+
|
| 19 |
+
|
| 20 |
+
def reject_constant(name):
|
| 21 |
+
raise ValueError(f"{name} is not JSON")
|
| 22 |
+
|
| 23 |
+
|
| 24 |
+
def load(path):
|
| 25 |
+
with open(path, "rb") as stream:
|
| 26 |
+
return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant)
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
try:
|
| 30 |
+
answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"])
|
| 31 |
+
valid = (
|
| 32 |
+
isinstance(answer, list)
|
| 33 |
+
and all(type(x) is int for x in answer) # not bool, float or str
|
| 34 |
+
and answer == expected
|
| 35 |
+
)
|
| 36 |
+
except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError
|
| 37 |
+
valid = False
|
| 38 |
+
if valid:
|
| 39 |
+
with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream:
|
| 40 |
+
stream.write("1")
|
| 41 |
+
print("reward:", 1 if valid else 0)
|
| 42 |
+
PY
|
tasks/agg-p25-n01/instruction.md
ADDED
|
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# Sort the team's private numbers
|
| 2 |
+
|
| 3 |
+
You are the only agent on this team, solving a private-information number sorting task. You
|
| 4 |
+
hold one private integer from 1 to 99, written in English words. It is in your instructions,
|
| 5 |
+
under "Your private number".
|
| 6 |
+
|
| 7 |
+
Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric
|
| 8 |
+
value, as digits. Then stop.
|
tasks/agg-p25-n01/solution/solve.sh
ADDED
|
@@ -0,0 +1,5 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
#!/bin/bash
|
| 2 |
+
# Oracle: the team's answer from its own copy (not tests/), to validate the grader.
|
| 3 |
+
answer=${ANSWER:-/app/answer.json}
|
| 4 |
+
mkdir -p "$(dirname "$answer")"
|
| 5 |
+
echo '[33]' > "$answer"
|
tasks/agg-p25-n01/task.toml
ADDED
|
@@ -0,0 +1,26 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
schema_version = "1.4"
|
| 2 |
+
|
| 3 |
+
[task]
|
| 4 |
+
name = "HuggingFaceSwarms/agg-p25-n01"
|
| 5 |
+
version = "0.1.0"
|
| 6 |
+
description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order."
|
| 7 |
+
keywords = ["multi-agent", "message-board", "s3", "aggregation"]
|
| 8 |
+
|
| 9 |
+
[metadata]
|
| 10 |
+
problem = 25
|
| 11 |
+
agents = 1
|
| 12 |
+
seed = 115
|
| 13 |
+
|
| 14 |
+
[agent]
|
| 15 |
+
timeout_sec = 1800
|
| 16 |
+
|
| 17 |
+
[environment]
|
| 18 |
+
# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it
|
| 19 |
+
# too. Nothing task-specific is in the container: each agent's number reaches it only through
|
| 20 |
+
# its own instructions (the flock role file), and tests/ arrive only when the agent is done.
|
| 21 |
+
docker_image = "python:3.12-slim"
|
| 22 |
+
cpus = 1
|
| 23 |
+
memory_mb = 1024
|
| 24 |
+
|
| 25 |
+
[verifier]
|
| 26 |
+
timeout_sec = 60
|
tasks/agg-p25-n01/tests/expected.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
[33]
|