diff --git a/tasks/agg-p23-n01/tests/test.sh b/tasks/agg-p23-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p23-n01/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p23-n02/instruction.md b/tasks/agg-p23-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p23-n02/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 2 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 2 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p23-n02/solution/solve.sh b/tasks/agg-p23-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..f8abcd3bf694c2c4ed964d96ab8d1dce68e85607 --- /dev/null +++ b/tasks/agg-p23-n02/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[20, 55]' > "$answer" diff --git a/tasks/agg-p23-n02/task.toml b/tasks/agg-p23-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..92954b9733f57194f0c93ef225bf0e1e035f1dd0 --- /dev/null +++ b/tasks/agg-p23-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p23-n02" +version = "0.1.0" +description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 23 +agents = 2 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p23-n02/tests/expected.json b/tasks/agg-p23-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..42116719ac2dea49c2f4cbbfc161333c8a1b6efd --- /dev/null +++ b/tasks/agg-p23-n02/tests/expected.json @@ -0,0 +1 @@ +[20, 55] diff --git a/tasks/agg-p23-n02/tests/test.sh b/tasks/agg-p23-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p23-n02/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p23-n04/instruction.md b/tasks/agg-p23-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p23-n04/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 4 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 4 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p23-n04/solution/solve.sh b/tasks/agg-p23-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..3a6b3b52c1f096bc5fc425aa49fc9a56123ac38a --- /dev/null +++ b/tasks/agg-p23-n04/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[1, 20, 45, 55]' > "$answer" diff --git a/tasks/agg-p23-n04/task.toml b/tasks/agg-p23-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..a7d09fb19d3e0dae9b0e863a9ef1be67efe9518a --- /dev/null +++ b/tasks/agg-p23-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p23-n04" +version = "0.1.0" +description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 23 +agents = 4 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p23-n04/tests/expected.json b/tasks/agg-p23-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..e2143f92b768e31ad3de3d168e191a7108207ec1 --- /dev/null +++ b/tasks/agg-p23-n04/tests/expected.json @@ -0,0 +1 @@ +[1, 20, 45, 55] diff --git a/tasks/agg-p23-n04/tests/test.sh b/tasks/agg-p23-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p23-n04/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p23-n08/instruction.md b/tasks/agg-p23-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p23-n08/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 8 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 8 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p23-n08/solution/solve.sh b/tasks/agg-p23-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c94b622afc835393f4e8c1c9539254251dc571e9 --- /dev/null +++ b/tasks/agg-p23-n08/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[1, 20, 30, 45, 55, 79, 81, 84]' > "$answer" diff --git a/tasks/agg-p23-n08/task.toml b/tasks/agg-p23-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5b673f7a927ecdfad8e2c3aa5aea99c32a61d076 --- /dev/null +++ b/tasks/agg-p23-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p23-n08" +version = "0.1.0" +description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 23 +agents = 8 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p23-n08/tests/expected.json b/tasks/agg-p23-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..e6aeb10d434a656d42907f64c4695dfd40536548 --- /dev/null +++ b/tasks/agg-p23-n08/tests/expected.json @@ -0,0 +1 @@ +[1, 20, 30, 45, 55, 79, 81, 84] diff --git a/tasks/agg-p23-n08/tests/test.sh b/tasks/agg-p23-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p23-n08/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p23-n16/instruction.md b/tasks/agg-p23-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p23-n16/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 16 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 16 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p23-n16/solution/solve.sh b/tasks/agg-p23-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..0fe85c5005bfb3fb5f503913158eb430478b4ef9 --- /dev/null +++ b/tasks/agg-p23-n16/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[1, 3, 7, 16, 20, 30, 35, 45, 51, 52, 55, 69, 79, 81, 84, 96]' > "$answer" diff --git a/tasks/agg-p23-n16/task.toml b/tasks/agg-p23-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..abc637fe756ac092661ce2b73ea98df0e90d5224 --- /dev/null +++ b/tasks/agg-p23-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p23-n16" +version = "0.1.0" +description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 23 +agents = 16 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p23-n16/tests/expected.json b/tasks/agg-p23-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..c3a941386d4fd31d1d4404a0d80d94e09fbdaf69 --- /dev/null +++ b/tasks/agg-p23-n16/tests/expected.json @@ -0,0 +1 @@ +[1, 3, 7, 16, 20, 30, 35, 45, 51, 52, 55, 69, 79, 81, 84, 96] diff --git a/tasks/agg-p23-n16/tests/test.sh b/tasks/agg-p23-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p23-n16/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p24-n01/instruction.md b/tasks/agg-p24-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p24-n01/instruction.md @@ -0,0 +1,8 @@ +# Sort the team's private numbers + +You are the only agent on this team, solving a private-information number sorting task. You +hold one private integer from 1 to 99, written in English words. It is in your instructions, +under "Your private number". + +Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric +value, as digits. Then stop. diff --git a/tasks/agg-p24-n01/solution/solve.sh b/tasks/agg-p24-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..3f59dc1ea733dbd58972e372ed249b64099bd401 --- /dev/null +++ b/tasks/agg-p24-n01/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[95]' > "$answer" diff --git a/tasks/agg-p24-n01/task.toml b/tasks/agg-p24-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..0680cb3f9f3b706db2924d2439de0c7248697f11 --- /dev/null +++ b/tasks/agg-p24-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p24-n01" +version = "0.1.0" +description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 24 +agents = 1 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p24-n01/tests/expected.json b/tasks/agg-p24-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..9129c6cccfeeb3d97eff36cd8e3b51cb25f44caa --- /dev/null +++ b/tasks/agg-p24-n01/tests/expected.json @@ -0,0 +1 @@ +[95] diff --git a/tasks/agg-p24-n01/tests/test.sh b/tasks/agg-p24-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p24-n01/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p24-n02/instruction.md b/tasks/agg-p24-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p24-n02/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 2 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 2 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p24-n02/solution/solve.sh b/tasks/agg-p24-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..5c3886d27183f6967a2a37cadc883fdd4095a7ef --- /dev/null +++ b/tasks/agg-p24-n02/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[82, 95]' > "$answer" diff --git a/tasks/agg-p24-n02/task.toml b/tasks/agg-p24-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..102e3831529041fe447628b06a61ec0a323bb6da --- /dev/null +++ b/tasks/agg-p24-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p24-n02" +version = "0.1.0" +description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 24 +agents = 2 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p24-n02/tests/expected.json b/tasks/agg-p24-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..ef5abaa4404694c8459ac2d6491c8ddb13a0a6c9 --- /dev/null +++ b/tasks/agg-p24-n02/tests/expected.json @@ -0,0 +1 @@ +[82, 95] diff --git a/tasks/agg-p24-n02/tests/test.sh b/tasks/agg-p24-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p24-n02/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p24-n04/instruction.md b/tasks/agg-p24-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p24-n04/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 4 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 4 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p24-n04/solution/solve.sh b/tasks/agg-p24-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..dc22ec77166fbfa88335eaec942fde2e005c7710 --- /dev/null +++ b/tasks/agg-p24-n04/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[5, 50, 82, 95]' > "$answer" diff --git a/tasks/agg-p24-n04/task.toml b/tasks/agg-p24-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..37cd3063329eb8752d7c146d4dd473814136fc3c --- /dev/null +++ b/tasks/agg-p24-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p24-n04" +version = "0.1.0" +description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 24 +agents = 4 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p24-n04/tests/expected.json b/tasks/agg-p24-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..a17a729fd51d44adbe1124c26548616b4f4bde08 --- /dev/null +++ b/tasks/agg-p24-n04/tests/expected.json @@ -0,0 +1 @@ +[5, 50, 82, 95] diff --git a/tasks/agg-p24-n04/tests/test.sh b/tasks/agg-p24-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p24-n04/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p24-n08/instruction.md b/tasks/agg-p24-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p24-n08/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 8 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 8 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p24-n08/solution/solve.sh b/tasks/agg-p24-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..b47fcd0c7117484d9703c89621d6b9dd5ebf1f30 --- /dev/null +++ b/tasks/agg-p24-n08/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[5, 38, 50, 82, 87, 89, 95, 95]' > "$answer" diff --git a/tasks/agg-p24-n08/task.toml b/tasks/agg-p24-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8291aa96f55e37fa9e2abe7519c21457a169ab19 --- /dev/null +++ b/tasks/agg-p24-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p24-n08" +version = "0.1.0" +description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 24 +agents = 8 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p24-n08/tests/expected.json b/tasks/agg-p24-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..27ba6694a97ea284193dc5b475d1721f6d228847 --- /dev/null +++ b/tasks/agg-p24-n08/tests/expected.json @@ -0,0 +1 @@ +[5, 38, 50, 82, 87, 89, 95, 95] diff --git a/tasks/agg-p24-n08/tests/test.sh b/tasks/agg-p24-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p24-n08/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p24-n16/instruction.md b/tasks/agg-p24-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p24-n16/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 16 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 16 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p24-n16/solution/solve.sh b/tasks/agg-p24-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..f4d55b266431c21865235d6c8b77515368879db0 --- /dev/null +++ b/tasks/agg-p24-n16/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[5, 10, 37, 38, 39, 39, 50, 67, 82, 87, 87, 89, 92, 92, 95, 95]' > "$answer" diff --git a/tasks/agg-p24-n16/task.toml b/tasks/agg-p24-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..d410a311bbd4caca27f1d58cf5f8683d20d89f9c --- /dev/null +++ b/tasks/agg-p24-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p24-n16" +version = "0.1.0" +description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 24 +agents = 16 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p24-n16/tests/expected.json b/tasks/agg-p24-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..ce7db3d1f7debd128fd833ce320b7002ae88561e --- /dev/null +++ b/tasks/agg-p24-n16/tests/expected.json @@ -0,0 +1 @@ +[5, 10, 37, 38, 39, 39, 50, 67, 82, 87, 87, 89, 92, 92, 95, 95] diff --git a/tasks/agg-p24-n16/tests/test.sh b/tasks/agg-p24-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p24-n16/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p25-n01/instruction.md b/tasks/agg-p25-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p25-n01/instruction.md @@ -0,0 +1,8 @@ +# Sort the team's private numbers + +You are the only agent on this team, solving a private-information number sorting task. You +hold one private integer from 1 to 99, written in English words. It is in your instructions, +under "Your private number". + +Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric +value, as digits. Then stop. diff --git a/tasks/agg-p25-n01/solution/solve.sh b/tasks/agg-p25-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..6804262b24ad73a07be9d7d3797651659f396963 --- /dev/null +++ b/tasks/agg-p25-n01/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[33]' > "$answer" diff --git a/tasks/agg-p25-n01/task.toml b/tasks/agg-p25-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..b05879ac7c60371788980b892b359f083d213f1e --- /dev/null +++ b/tasks/agg-p25-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p25-n01" +version = "0.1.0" +description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 25 +agents = 1 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p25-n01/tests/expected.json b/tasks/agg-p25-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..bb02c5912714ac0fc5fa9fc6bac286bc28a01972 --- /dev/null +++ b/tasks/agg-p25-n01/tests/expected.json @@ -0,0 +1 @@ +[33] diff --git a/tasks/agg-p25-n01/tests/test.sh b/tasks/agg-p25-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p25-n01/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p25-n02/instruction.md b/tasks/agg-p25-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p25-n02/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 2 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 2 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p25-n02/solution/solve.sh b/tasks/agg-p25-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..9846b8c57c45d8bc3f83cb19f99bc062c3cee828 --- /dev/null +++ b/tasks/agg-p25-n02/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[22, 33]' > "$answer" diff --git a/tasks/agg-p25-n02/task.toml b/tasks/agg-p25-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..fb93a86f17b8919b652bdc76c4e0c8f89d969ebb --- /dev/null +++ b/tasks/agg-p25-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p25-n02" +version = "0.1.0" +description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 25 +agents = 2 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p25-n02/tests/expected.json b/tasks/agg-p25-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..ce655c8ef6784f969ff3e8bc52845c81291b6ebd --- /dev/null +++ b/tasks/agg-p25-n02/tests/expected.json @@ -0,0 +1 @@ +[22, 33] diff --git a/tasks/agg-p25-n02/tests/test.sh b/tasks/agg-p25-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p25-n02/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p25-n04/instruction.md b/tasks/agg-p25-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p25-n04/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 4 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 4 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p25-n04/solution/solve.sh b/tasks/agg-p25-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..248486b59eabf0f72e960ee0512ed3fe32c6f087 --- /dev/null +++ b/tasks/agg-p25-n04/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[18, 22, 33, 88]' > "$answer" diff --git a/tasks/agg-p25-n04/task.toml b/tasks/agg-p25-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..498c62bfe8c0c8326219458feef8530f4fc6a0ab --- /dev/null +++ b/tasks/agg-p25-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p25-n04" +version = "0.1.0" +description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 25 +agents = 4 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p25-n04/tests/expected.json b/tasks/agg-p25-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..b35ffe4186d9d34ac8d3dbefc44f450f9c485105 --- /dev/null +++ b/tasks/agg-p25-n04/tests/expected.json @@ -0,0 +1 @@ +[18, 22, 33, 88] diff --git a/tasks/agg-p25-n04/tests/test.sh b/tasks/agg-p25-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p25-n04/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p25-n08/instruction.md b/tasks/agg-p25-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p25-n08/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 8 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 8 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p25-n08/solution/solve.sh b/tasks/agg-p25-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..813ad3155b4db1cf6585b611945aaa4e9248af7e --- /dev/null +++ b/tasks/agg-p25-n08/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[2, 6, 18, 22, 33, 46, 73, 88]' > "$answer" diff --git a/tasks/agg-p25-n08/task.toml b/tasks/agg-p25-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..91b5046575622d0c6938129ab5122287424addec --- /dev/null +++ b/tasks/agg-p25-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p25-n08" +version = "0.1.0" +description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 25 +agents = 8 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p25-n08/tests/expected.json b/tasks/agg-p25-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..02dbdce6ffce318fe47d0c4bc708e2ac2eff1406 --- /dev/null +++ b/tasks/agg-p25-n08/tests/expected.json @@ -0,0 +1 @@ +[2, 6, 18, 22, 33, 46, 73, 88] diff --git a/tasks/agg-p25-n08/tests/test.sh b/tasks/agg-p25-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p25-n08/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p25-n16/instruction.md b/tasks/agg-p25-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p25-n16/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 16 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 16 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p25-n16/solution/solve.sh b/tasks/agg-p25-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c0f746d228faebc81bc78b6c9f224a38d8260244 --- /dev/null +++ b/tasks/agg-p25-n16/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[2, 3, 6, 6, 18, 19, 21, 21, 21, 22, 33, 46, 57, 73, 73, 88]' > "$answer" diff --git a/tasks/agg-p25-n16/task.toml b/tasks/agg-p25-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..352aa0752aec9e043a48a7577100917be0b2be5b --- /dev/null +++ b/tasks/agg-p25-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p25-n16" +version = "0.1.0" +description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 25 +agents = 16 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p25-n16/tests/expected.json b/tasks/agg-p25-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..e244ac949db663aeb3cc93b195e6abffd220e157 --- /dev/null +++ b/tasks/agg-p25-n16/tests/expected.json @@ -0,0 +1 @@ +[2, 3, 6, 6, 18, 19, 21, 21, 21, 22, 33, 46, 57, 73, 73, 88] diff --git a/tasks/agg-p25-n16/tests/test.sh b/tasks/agg-p25-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p25-n16/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p26-n01/instruction.md b/tasks/agg-p26-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p26-n01/instruction.md @@ -0,0 +1,8 @@ +# Sort the team's private numbers + +You are the only agent on this team, solving a private-information number sorting task. You +hold one private integer from 1 to 99, written in English words. It is in your instructions, +under "Your private number". + +Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric +value, as digits. Then stop. diff --git a/tasks/agg-p26-n01/solution/solve.sh b/tasks/agg-p26-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..4bb31f5d7b314d539e99e23d3f974987bfed9e48 --- /dev/null +++ b/tasks/agg-p26-n01/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[21]' > "$answer" diff --git a/tasks/agg-p26-n01/task.toml b/tasks/agg-p26-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..c4528e9a4e2aae8905ea4a3a7a7901f2ddfdb8a8 --- /dev/null +++ b/tasks/agg-p26-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p26-n01" +version = "0.1.0" +description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 26 +agents = 1 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p26-n01/tests/expected.json b/tasks/agg-p26-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..2136d173d26ec45cbbb4a515fa8f404fba85494b --- /dev/null +++ b/tasks/agg-p26-n01/tests/expected.json @@ -0,0 +1 @@ +[21] diff --git a/tasks/agg-p26-n01/tests/test.sh b/tasks/agg-p26-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p26-n01/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p26-n02/instruction.md b/tasks/agg-p26-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p26-n02/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 2 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 2 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p26-n02/solution/solve.sh b/tasks/agg-p26-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..ba5c7de9e7c0fd2e3102a51017f2e4300f68a105 --- /dev/null +++ b/tasks/agg-p26-n02/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[20, 21]' > "$answer" diff --git a/tasks/agg-p26-n02/task.toml b/tasks/agg-p26-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..99cf41a59ce49cf473a6e91298b0e9071ae2dd8d --- /dev/null +++ b/tasks/agg-p26-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p26-n02" +version = "0.1.0" +description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 26 +agents = 2 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p26-n02/tests/expected.json b/tasks/agg-p26-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..f6e89c4d3a009a35d8843e4e6592395a37e81538 --- /dev/null +++ b/tasks/agg-p26-n02/tests/expected.json @@ -0,0 +1 @@ +[20, 21] diff --git a/tasks/agg-p26-n02/tests/test.sh b/tasks/agg-p26-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p26-n02/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p26-n04/instruction.md b/tasks/agg-p26-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p26-n04/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 4 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 4 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p26-n04/solution/solve.sh b/tasks/agg-p26-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..7abc85d74049cab1c00eb4742fd256990357a4a8 --- /dev/null +++ b/tasks/agg-p26-n04/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[1, 4, 20, 21]' > "$answer" diff --git a/tasks/agg-p26-n04/task.toml b/tasks/agg-p26-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1354c66ecd787c67d70c2fbb73daee4812dfec64 --- /dev/null +++ b/tasks/agg-p26-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p26-n04" +version = "0.1.0" +description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 26 +agents = 4 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p26-n04/tests/expected.json b/tasks/agg-p26-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..fa26725eff6ef7279aa8b421717bbf2430fe828e --- /dev/null +++ b/tasks/agg-p26-n04/tests/expected.json @@ -0,0 +1 @@ +[1, 4, 20, 21] diff --git a/tasks/agg-p26-n04/tests/test.sh b/tasks/agg-p26-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p26-n04/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p26-n08/instruction.md b/tasks/agg-p26-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p26-n08/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 8 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 8 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p26-n08/solution/solve.sh b/tasks/agg-p26-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..6ef27874cb7c0b72b2cbccae110b1874259e8522 --- /dev/null +++ b/tasks/agg-p26-n08/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[1, 4, 12, 20, 21, 36, 37, 66]' > "$answer" diff --git a/tasks/agg-p26-n08/task.toml b/tasks/agg-p26-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..3dc6eb73929bb3bed043f648b2ad967a1d9c0232 --- /dev/null +++ b/tasks/agg-p26-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p26-n08" +version = "0.1.0" +description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 26 +agents = 8 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p26-n08/tests/expected.json b/tasks/agg-p26-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..45b4d2f190a0760c4417769d616d0a7cc8e02d2f --- /dev/null +++ b/tasks/agg-p26-n08/tests/expected.json @@ -0,0 +1 @@ +[1, 4, 12, 20, 21, 36, 37, 66] diff --git a/tasks/agg-p26-n08/tests/test.sh b/tasks/agg-p26-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p26-n08/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p26-n16/instruction.md b/tasks/agg-p26-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p26-n16/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 16 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 16 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p26-n16/solution/solve.sh b/tasks/agg-p26-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..83cf45db19f33d5f78f4f9c2d880ebad85c660bc --- /dev/null +++ b/tasks/agg-p26-n16/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[1, 2, 4, 12, 20, 21, 22, 28, 36, 37, 47, 66, 75, 77, 94, 97]' > "$answer" diff --git a/tasks/agg-p26-n16/task.toml b/tasks/agg-p26-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..c130a849b6387a56d916beff88d97a1e00d73785 --- /dev/null +++ b/tasks/agg-p26-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p26-n16" +version = "0.1.0" +description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 26 +agents = 16 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p26-n16/tests/expected.json b/tasks/agg-p26-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..cbc3fe371d00556117df4b252dcc9857a400745d --- /dev/null +++ b/tasks/agg-p26-n16/tests/expected.json @@ -0,0 +1 @@ +[1, 2, 4, 12, 20, 21, 22, 28, 36, 37, 47, 66, 75, 77, 94, 97] diff --git a/tasks/agg-p26-n16/tests/test.sh b/tasks/agg-p26-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p26-n16/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p27-n01/instruction.md b/tasks/agg-p27-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p27-n01/instruction.md @@ -0,0 +1,8 @@ +# Sort the team's private numbers + +You are the only agent on this team, solving a private-information number sorting task. You +hold one private integer from 1 to 99, written in English words. It is in your instructions, +under "Your private number". + +Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric +value, as digits. Then stop. diff --git a/tasks/agg-p27-n01/solution/solve.sh b/tasks/agg-p27-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..5bf480180f5d39415320eb66dbc1489b60ff44bf --- /dev/null +++ b/tasks/agg-p27-n01/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[99]' > "$answer" diff --git a/tasks/agg-p27-n01/task.toml b/tasks/agg-p27-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..986acd8998dfa23415cf249df9a042697c40cdc7 --- /dev/null +++ b/tasks/agg-p27-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p27-n01" +version = "0.1.0" +description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 27 +agents = 1 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p27-n01/tests/expected.json b/tasks/agg-p27-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..91c37e883fcd441c6ac7f9218c433153b41f20c7 --- /dev/null +++ b/tasks/agg-p27-n01/tests/expected.json @@ -0,0 +1 @@ +[99] diff --git a/tasks/agg-p27-n01/tests/test.sh b/tasks/agg-p27-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p27-n01/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p27-n02/instruction.md b/tasks/agg-p27-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p27-n02/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 2 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 2 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p27-n02/solution/solve.sh b/tasks/agg-p27-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..2cf0dc25ca740d6a3f2fb207102b009bbdb3aefa --- /dev/null +++ b/tasks/agg-p27-n02/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[74, 99]' > "$answer" diff --git a/tasks/agg-p27-n02/task.toml b/tasks/agg-p27-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..ad1c087b3d01632abce206df775892b633d69723 --- /dev/null +++ b/tasks/agg-p27-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p27-n02" +version = "0.1.0" +description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 27 +agents = 2 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p27-n02/tests/expected.json b/tasks/agg-p27-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..ac74ccca5fd0cc604e41869f7b86499aa4b1257d --- /dev/null +++ b/tasks/agg-p27-n02/tests/expected.json @@ -0,0 +1 @@ +[74, 99] diff --git a/tasks/agg-p27-n02/tests/test.sh b/tasks/agg-p27-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p27-n02/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p27-n04/instruction.md b/tasks/agg-p27-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p27-n04/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 4 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 4 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p27-n04/solution/solve.sh b/tasks/agg-p27-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..326c3f5bf164f073210d7bf7197e2a3351f77432 --- /dev/null +++ b/tasks/agg-p27-n04/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[15, 74, 86, 99]' > "$answer" diff --git a/tasks/agg-p27-n04/task.toml b/tasks/agg-p27-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..2fe2f48289f53bdd03108e8f48fb408eeff81921 --- /dev/null +++ b/tasks/agg-p27-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p27-n04" +version = "0.1.0" +description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 27 +agents = 4 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p27-n04/tests/expected.json b/tasks/agg-p27-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..1cfabeba2566aad1408f7ff12b9af885aa0a03b4 --- /dev/null +++ b/tasks/agg-p27-n04/tests/expected.json @@ -0,0 +1 @@ +[15, 74, 86, 99] diff --git a/tasks/agg-p27-n04/tests/test.sh b/tasks/agg-p27-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p27-n04/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p27-n08/instruction.md b/tasks/agg-p27-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p27-n08/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 8 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 8 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p27-n08/solution/solve.sh b/tasks/agg-p27-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..632e4592bc5f5014c981f3efb8775b27a9b5e1a1 --- /dev/null +++ b/tasks/agg-p27-n08/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[14, 15, 47, 74, 83, 86, 95, 99]' > "$answer" diff --git a/tasks/agg-p27-n08/task.toml b/tasks/agg-p27-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..c67ae3cd17c722d154610401d9a5ec6c1319d647 --- /dev/null +++ b/tasks/agg-p27-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p27-n08" +version = "0.1.0" +description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 27 +agents = 8 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p27-n08/tests/expected.json b/tasks/agg-p27-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..dafb9672f1ce35b73d6e1cc1668170156a548c5e --- /dev/null +++ b/tasks/agg-p27-n08/tests/expected.json @@ -0,0 +1 @@ +[14, 15, 47, 74, 83, 86, 95, 99] diff --git a/tasks/agg-p27-n08/tests/test.sh b/tasks/agg-p27-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p27-n08/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p27-n16/instruction.md b/tasks/agg-p27-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p27-n16/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 16 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 16 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p27-n16/solution/solve.sh b/tasks/agg-p27-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..5e32726731c044deae7287067001ec46e9af1931 --- /dev/null +++ b/tasks/agg-p27-n16/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[6, 7, 12, 14, 15, 47, 56, 60, 74, 83, 84, 86, 88, 95, 96, 99]' > "$answer" diff --git a/tasks/agg-p27-n16/task.toml b/tasks/agg-p27-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..4fee766f3732a9e101ab3a561440b284e01fd85a --- /dev/null +++ b/tasks/agg-p27-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p27-n16" +version = "0.1.0" +description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 27 +agents = 16 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p27-n16/tests/expected.json b/tasks/agg-p27-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..e14312b519661a30e8c4eb67f783e502840ae4df --- /dev/null +++ b/tasks/agg-p27-n16/tests/expected.json @@ -0,0 +1 @@ +[6, 7, 12, 14, 15, 47, 56, 60, 74, 83, 84, 86, 88, 95, 96, 99] diff --git a/tasks/agg-p27-n16/tests/test.sh b/tasks/agg-p27-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p27-n16/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p28-n01/instruction.md b/tasks/agg-p28-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p28-n01/instruction.md @@ -0,0 +1,8 @@ +# Sort the team's private numbers + +You are the only agent on this team, solving a private-information number sorting task. You +hold one private integer from 1 to 99, written in English words. It is in your instructions, +under "Your private number". + +Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric +value, as digits. Then stop. diff --git a/tasks/agg-p28-n01/solution/solve.sh b/tasks/agg-p28-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..aff3a28820e216370759fb50e233678c09dcc8f1 --- /dev/null +++ b/tasks/agg-p28-n01/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[58]' > "$answer" diff --git a/tasks/agg-p28-n01/task.toml b/tasks/agg-p28-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8f5eed0301ee6731c100dc9b563b723866e50aed --- /dev/null +++ b/tasks/agg-p28-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p28-n01" +version = "0.1.0" +description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 28 +agents = 1 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p28-n01/tests/expected.json b/tasks/agg-p28-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..b7a676de451ff5a0bfc2f31ab270c96387332f68 --- /dev/null +++ b/tasks/agg-p28-n01/tests/expected.json @@ -0,0 +1 @@ +[58] diff --git a/tasks/agg-p28-n01/tests/test.sh b/tasks/agg-p28-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p28-n01/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p28-n02/instruction.md b/tasks/agg-p28-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p28-n02/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 2 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 2 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p28-n02/solution/solve.sh b/tasks/agg-p28-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..bb1f029717af932c23927a1b06c827dfe5a974c1 --- /dev/null +++ b/tasks/agg-p28-n02/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[38, 58]' > "$answer" diff --git a/tasks/agg-p28-n02/task.toml b/tasks/agg-p28-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..26b7ee6be06790c538ab689915c1e69daca2086c --- /dev/null +++ b/tasks/agg-p28-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p28-n02" +version = "0.1.0" +description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 28 +agents = 2 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p28-n02/tests/expected.json b/tasks/agg-p28-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..4fe49703be6da2b486fe31f12732616f5310d02c --- /dev/null +++ b/tasks/agg-p28-n02/tests/expected.json @@ -0,0 +1 @@ +[38, 58] diff --git a/tasks/agg-p28-n02/tests/test.sh b/tasks/agg-p28-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p28-n02/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p28-n04/instruction.md b/tasks/agg-p28-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p28-n04/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 4 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 4 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p28-n04/solution/solve.sh b/tasks/agg-p28-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..fd1e2ce732dabd037fb9b962776735f3efddecd9 --- /dev/null +++ b/tasks/agg-p28-n04/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[38, 58, 67, 70]' > "$answer" diff --git a/tasks/agg-p28-n04/task.toml b/tasks/agg-p28-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..9c377fc15ac9f33608bebf36cd885170f541a8a9 --- /dev/null +++ b/tasks/agg-p28-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p28-n04" +version = "0.1.0" +description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 28 +agents = 4 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p28-n04/tests/expected.json b/tasks/agg-p28-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..70d8b738bfba2ca87e762a792a2eb554ee8e100e --- /dev/null +++ b/tasks/agg-p28-n04/tests/expected.json @@ -0,0 +1 @@ +[38, 58, 67, 70] diff --git a/tasks/agg-p28-n04/tests/test.sh b/tasks/agg-p28-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p28-n04/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p28-n08/instruction.md b/tasks/agg-p28-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p28-n08/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 8 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 8 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p28-n08/solution/solve.sh b/tasks/agg-p28-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e66c9c0152d7ac51a91d96394a29a03450d00c47 --- /dev/null +++ b/tasks/agg-p28-n08/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[12, 33, 38, 58, 67, 70, 77, 93]' > "$answer" diff --git a/tasks/agg-p28-n08/task.toml b/tasks/agg-p28-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6f095db2f13968e583e8bcd13debb345fc64465c --- /dev/null +++ b/tasks/agg-p28-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p28-n08" +version = "0.1.0" +description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 28 +agents = 8 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p28-n08/tests/expected.json b/tasks/agg-p28-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..f0a5a06ae7524323576c7049155dfaf47916c6d1 --- /dev/null +++ b/tasks/agg-p28-n08/tests/expected.json @@ -0,0 +1 @@ +[12, 33, 38, 58, 67, 70, 77, 93] diff --git a/tasks/agg-p28-n08/tests/test.sh b/tasks/agg-p28-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p28-n08/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p28-n16/instruction.md b/tasks/agg-p28-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p28-n16/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 16 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 16 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p28-n16/solution/solve.sh b/tasks/agg-p28-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..61413919d5408a86a4066f0c214b895506f06be0 --- /dev/null +++ b/tasks/agg-p28-n16/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[7, 8, 12, 15, 24, 33, 38, 53, 58, 63, 67, 70, 77, 92, 93, 94]' > "$answer" diff --git a/tasks/agg-p28-n16/task.toml b/tasks/agg-p28-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..cc569937142fe4282d2e4655dec703acd9c2e8ab --- /dev/null +++ b/tasks/agg-p28-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p28-n16" +version = "0.1.0" +description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 28 +agents = 16 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p28-n16/tests/expected.json b/tasks/agg-p28-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..56d15abf862ff99339e5f553d4ebb7468de2c422 --- /dev/null +++ b/tasks/agg-p28-n16/tests/expected.json @@ -0,0 +1 @@ +[7, 8, 12, 15, 24, 33, 38, 53, 58, 63, 67, 70, 77, 92, 93, 94] diff --git a/tasks/agg-p28-n16/tests/test.sh b/tasks/agg-p28-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p28-n16/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p29-n01/instruction.md b/tasks/agg-p29-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p29-n01/instruction.md @@ -0,0 +1,8 @@ +# Sort the team's private numbers + +You are the only agent on this team, solving a private-information number sorting task. You +hold one private integer from 1 to 99, written in English words. It is in your instructions, +under "Your private number". + +Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric +value, as digits. Then stop. diff --git a/tasks/agg-p29-n01/solution/solve.sh b/tasks/agg-p29-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..6fdda444f48b237298ddd0fedda55ecce36055d1 --- /dev/null +++ b/tasks/agg-p29-n01/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[23]' > "$answer" diff --git a/tasks/agg-p29-n01/task.toml b/tasks/agg-p29-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6ef49b0a8590d7891b406b33c4576f047954c9b4 --- /dev/null +++ b/tasks/agg-p29-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p29-n01" +version = "0.1.0" +description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 29 +agents = 1 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p29-n01/tests/expected.json b/tasks/agg-p29-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..9333cd7224ae5b3a9336ac022dc3baf7aea7f8df --- /dev/null +++ b/tasks/agg-p29-n01/tests/expected.json @@ -0,0 +1 @@ +[23] diff --git a/tasks/agg-p29-n01/tests/test.sh b/tasks/agg-p29-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p29-n01/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p29-n02/instruction.md b/tasks/agg-p29-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p29-n02/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 2 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 2 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p29-n02/solution/solve.sh b/tasks/agg-p29-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..11be4d1bb64acd7021ca2f03426d8e21800b21fe --- /dev/null +++ b/tasks/agg-p29-n02/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[22, 23]' > "$answer" diff --git a/tasks/agg-p29-n02/task.toml b/tasks/agg-p29-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..f5b8468c8db2a84dcf8a56d8071840a286e2827c --- /dev/null +++ b/tasks/agg-p29-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p29-n02" +version = "0.1.0" +description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 29 +agents = 2 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p29-n02/tests/expected.json b/tasks/agg-p29-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..36b73a8b100d1ff03721c4d8cb6746bcb109dabf --- /dev/null +++ b/tasks/agg-p29-n02/tests/expected.json @@ -0,0 +1 @@ +[22, 23] diff --git a/tasks/agg-p29-n02/tests/test.sh b/tasks/agg-p29-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p29-n02/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p29-n04/instruction.md b/tasks/agg-p29-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p29-n04/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 4 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 4 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p29-n04/solution/solve.sh b/tasks/agg-p29-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..836374959a0e1e6531ffa1fd3251705616d477e3 --- /dev/null +++ b/tasks/agg-p29-n04/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[22, 23, 45, 82]' > "$answer" diff --git a/tasks/agg-p29-n04/task.toml b/tasks/agg-p29-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1e03002368f9653e6516a3e444caeb32ed507000 --- /dev/null +++ b/tasks/agg-p29-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p29-n04" +version = "0.1.0" +description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 29 +agents = 4 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p29-n04/tests/expected.json b/tasks/agg-p29-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..d34de342240c3b365487b2a0ab3489be08bc8ec1 --- /dev/null +++ b/tasks/agg-p29-n04/tests/expected.json @@ -0,0 +1 @@ +[22, 23, 45, 82] diff --git a/tasks/agg-p29-n04/tests/test.sh b/tasks/agg-p29-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p29-n04/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p29-n08/instruction.md b/tasks/agg-p29-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p29-n08/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 8 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 8 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p29-n08/solution/solve.sh b/tasks/agg-p29-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..131ca7038bf9dd34007c14d1822b7323112c644d --- /dev/null +++ b/tasks/agg-p29-n08/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[22, 23, 38, 45, 56, 82, 89, 92]' > "$answer" diff --git a/tasks/agg-p29-n08/task.toml b/tasks/agg-p29-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..db1809af2f8caab56474d8a51a0a4f3d1bc7471a --- /dev/null +++ b/tasks/agg-p29-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p29-n08" +version = "0.1.0" +description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 29 +agents = 8 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p29-n08/tests/expected.json b/tasks/agg-p29-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..bd968721202d49309ea4231ed42d7cf0346bdefc --- /dev/null +++ b/tasks/agg-p29-n08/tests/expected.json @@ -0,0 +1 @@ +[22, 23, 38, 45, 56, 82, 89, 92] diff --git a/tasks/agg-p29-n08/tests/test.sh b/tasks/agg-p29-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p29-n08/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p29-n16/instruction.md b/tasks/agg-p29-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p29-n16/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 16 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 16 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p29-n16/solution/solve.sh b/tasks/agg-p29-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..f5576e6859c8be3c5695fa8b21fb1e26146d1a65 --- /dev/null +++ b/tasks/agg-p29-n16/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[6, 12, 12, 22, 23, 38, 43, 45, 56, 63, 68, 76, 82, 84, 89, 92]' > "$answer" diff --git a/tasks/agg-p29-n16/task.toml b/tasks/agg-p29-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..87b0771efda0b4c78707b24288d4e72fa07dd14d --- /dev/null +++ b/tasks/agg-p29-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p29-n16" +version = "0.1.0" +description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 29 +agents = 16 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p29-n16/tests/expected.json b/tasks/agg-p29-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..b8165aae921aeeb41a626b6470e16d99cfa23a2b --- /dev/null +++ b/tasks/agg-p29-n16/tests/expected.json @@ -0,0 +1 @@ +[6, 12, 12, 22, 23, 38, 43, 45, 56, 63, 68, 76, 82, 84, 89, 92] diff --git a/tasks/agg-p29-n16/tests/test.sh b/tasks/agg-p29-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p29-n16/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p30-n01/instruction.md b/tasks/agg-p30-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p30-n01/instruction.md @@ -0,0 +1,8 @@ +# Sort the team's private numbers + +You are the only agent on this team, solving a private-information number sorting task. You +hold one private integer from 1 to 99, written in English words. It is in your instructions, +under "Your private number". + +Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric +value, as digits. Then stop. diff --git a/tasks/agg-p30-n01/solution/solve.sh b/tasks/agg-p30-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..4bb31f5d7b314d539e99e23d3f974987bfed9e48 --- /dev/null +++ b/tasks/agg-p30-n01/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[21]' > "$answer" diff --git a/tasks/agg-p30-n01/task.toml b/tasks/agg-p30-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..671b422cc436cc34bfc5163434e6378be70ef6ea --- /dev/null +++ b/tasks/agg-p30-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p30-n01" +version = "0.1.0" +description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 30 +agents = 1 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p30-n01/tests/expected.json b/tasks/agg-p30-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..2136d173d26ec45cbbb4a515fa8f404fba85494b --- /dev/null +++ b/tasks/agg-p30-n01/tests/expected.json @@ -0,0 +1 @@ +[21] diff --git a/tasks/agg-p30-n01/tests/test.sh b/tasks/agg-p30-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p30-n01/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p30-n02/instruction.md b/tasks/agg-p30-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p30-n02/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 2 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 2 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p30-n02/solution/solve.sh b/tasks/agg-p30-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..95c7096b9585a44fe48b65f2d06629dbd47be20a --- /dev/null +++ b/tasks/agg-p30-n02/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[21, 65]' > "$answer" diff --git a/tasks/agg-p30-n02/task.toml b/tasks/agg-p30-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..cc68df6c503fcb507eb798df32716aede54f6806 --- /dev/null +++ b/tasks/agg-p30-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p30-n02" +version = "0.1.0" +description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 30 +agents = 2 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p30-n02/tests/expected.json b/tasks/agg-p30-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..a869a1b6a834d94f58c6e3a198cd760eaf8c7978 --- /dev/null +++ b/tasks/agg-p30-n02/tests/expected.json @@ -0,0 +1 @@ +[21, 65] diff --git a/tasks/agg-p30-n02/tests/test.sh b/tasks/agg-p30-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p30-n02/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p30-n04/instruction.md b/tasks/agg-p30-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p30-n04/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 4 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 4 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p30-n04/solution/solve.sh b/tasks/agg-p30-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..64a93d158f25200926be39f902ea725b4ce8fbf1 --- /dev/null +++ b/tasks/agg-p30-n04/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[21, 65, 74, 74]' > "$answer" diff --git a/tasks/agg-p30-n04/task.toml b/tasks/agg-p30-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..0514acc7a85d51e5ba351747fb0e9c7e980fc919 --- /dev/null +++ b/tasks/agg-p30-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p30-n04" +version = "0.1.0" +description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 30 +agents = 4 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p30-n04/tests/expected.json b/tasks/agg-p30-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..d7fa402448966b74110da737b9285b739a0c38ce --- /dev/null +++ b/tasks/agg-p30-n04/tests/expected.json @@ -0,0 +1 @@ +[21, 65, 74, 74] diff --git a/tasks/agg-p30-n04/tests/test.sh b/tasks/agg-p30-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p30-n04/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p30-n08/instruction.md b/tasks/agg-p30-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p30-n08/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 8 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 8 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p30-n08/solution/solve.sh b/tasks/agg-p30-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..ab2c712febbc5b3c377c23d86bda73a003c9b1c9 --- /dev/null +++ b/tasks/agg-p30-n08/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[21, 41, 43, 53, 65, 74, 74, 87]' > "$answer" diff --git a/tasks/agg-p30-n08/task.toml b/tasks/agg-p30-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..ec13bdeba5e93ce9c8420a0bd7831443edec2715 --- /dev/null +++ b/tasks/agg-p30-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p30-n08" +version = "0.1.0" +description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 30 +agents = 8 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p30-n08/tests/expected.json b/tasks/agg-p30-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..5c84b06904320b9bc287de74ecfdccde64b773cd --- /dev/null +++ b/tasks/agg-p30-n08/tests/expected.json @@ -0,0 +1 @@ +[21, 41, 43, 53, 65, 74, 74, 87] diff --git a/tasks/agg-p30-n08/tests/test.sh b/tasks/agg-p30-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p30-n08/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p30-n16/instruction.md b/tasks/agg-p30-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p30-n16/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 16 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 16 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p30-n16/solution/solve.sh b/tasks/agg-p30-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..027e0d2cb2568a9dba5a41d1e18734a05224dca6 --- /dev/null +++ b/tasks/agg-p30-n16/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[3, 21, 36, 41, 43, 43, 43, 53, 61, 65, 65, 74, 74, 87, 89, 97]' > "$answer" diff --git a/tasks/agg-p30-n16/task.toml b/tasks/agg-p30-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..66b3627b978ed40c972cbbdfadce734233616c47 --- /dev/null +++ b/tasks/agg-p30-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p30-n16" +version = "0.1.0" +description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 30 +agents = 16 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p30-n16/tests/expected.json b/tasks/agg-p30-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..9bad1516af64f3eae067fddce959ea6289c39e36 --- /dev/null +++ b/tasks/agg-p30-n16/tests/expected.json @@ -0,0 +1 @@ +[3, 21, 36, 41, 43, 43, 43, 53, 61, 65, 65, 74, 74, 87, 89, 97] diff --git a/tasks/agg-p30-n16/tests/test.sh b/tasks/agg-p30-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p30-n16/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p31-n01/instruction.md b/tasks/agg-p31-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p31-n01/instruction.md @@ -0,0 +1,8 @@ +# Sort the team's private numbers + +You are the only agent on this team, solving a private-information number sorting task. You +hold one private integer from 1 to 99, written in English words. It is in your instructions, +under "Your private number". + +Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric +value, as digits. Then stop. diff --git a/tasks/agg-p31-n01/solution/solve.sh b/tasks/agg-p31-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..efe3a38bddd125049ea9508c1d9b53eb4d7db43b --- /dev/null +++ b/tasks/agg-p31-n01/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[25]' > "$answer" diff --git a/tasks/agg-p31-n01/task.toml b/tasks/agg-p31-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e8ddd198dbe71812c1790122912ac2be4758b28c --- /dev/null +++ b/tasks/agg-p31-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p31-n01" +version = "0.1.0" +description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 31 +agents = 1 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p31-n01/tests/expected.json b/tasks/agg-p31-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..d73e3eae51f3e59cab1b2128e0da049f4a0dcd72 --- /dev/null +++ b/tasks/agg-p31-n01/tests/expected.json @@ -0,0 +1 @@ +[25] diff --git a/tasks/agg-p31-n01/tests/test.sh b/tasks/agg-p31-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p31-n01/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p31-n02/instruction.md b/tasks/agg-p31-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p31-n02/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 2 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 2 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p31-n02/solution/solve.sh b/tasks/agg-p31-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..dc5088f397c0cec7b000cba99d384fab48e9032b --- /dev/null +++ b/tasks/agg-p31-n02/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[23, 25]' > "$answer" diff --git a/tasks/agg-p31-n02/task.toml b/tasks/agg-p31-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..06f56035b1d14d964b945646ae2254b1e7832647 --- /dev/null +++ b/tasks/agg-p31-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p31-n02" +version = "0.1.0" +description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 31 +agents = 2 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p31-n02/tests/expected.json b/tasks/agg-p31-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..d5f47c38b2774196c7385d362a36b39f6dcb62f7 --- /dev/null +++ b/tasks/agg-p31-n02/tests/expected.json @@ -0,0 +1 @@ +[23, 25] diff --git a/tasks/agg-p31-n02/tests/test.sh b/tasks/agg-p31-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p31-n02/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p31-n04/instruction.md b/tasks/agg-p31-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p31-n04/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 4 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 4 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p31-n04/solution/solve.sh b/tasks/agg-p31-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..f59b1e1c5b49fdcacc4523a07b855b015c083eab --- /dev/null +++ b/tasks/agg-p31-n04/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[4, 23, 25, 36]' > "$answer" diff --git a/tasks/agg-p31-n04/task.toml b/tasks/agg-p31-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..8e42d9a72f3d2913010cfdb97ecff1a81bcc1156 --- /dev/null +++ b/tasks/agg-p31-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p31-n04" +version = "0.1.0" +description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 31 +agents = 4 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p31-n04/tests/expected.json b/tasks/agg-p31-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..0361eb5f6e07eae894b08398b51ae081bf739b4b --- /dev/null +++ b/tasks/agg-p31-n04/tests/expected.json @@ -0,0 +1 @@ +[4, 23, 25, 36] diff --git a/tasks/agg-p31-n04/tests/test.sh b/tasks/agg-p31-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p31-n04/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p31-n08/instruction.md b/tasks/agg-p31-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p31-n08/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 8 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 8 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p31-n08/solution/solve.sh b/tasks/agg-p31-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..80b5f4de32367e9728fa318372b7f03a3bd48ccd --- /dev/null +++ b/tasks/agg-p31-n08/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[3, 4, 23, 25, 28, 36, 51, 82]' > "$answer" diff --git a/tasks/agg-p31-n08/task.toml b/tasks/agg-p31-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..204fc79015a7f129d4c025d6c561a973037eb0ee --- /dev/null +++ b/tasks/agg-p31-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p31-n08" +version = "0.1.0" +description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 31 +agents = 8 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p31-n08/tests/expected.json b/tasks/agg-p31-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..d545f2dc7b8b67e3264d64b52acc3d7b0b38c9bc --- /dev/null +++ b/tasks/agg-p31-n08/tests/expected.json @@ -0,0 +1 @@ +[3, 4, 23, 25, 28, 36, 51, 82] diff --git a/tasks/agg-p31-n08/tests/test.sh b/tasks/agg-p31-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p31-n08/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p31-n16/instruction.md b/tasks/agg-p31-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p31-n16/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 16 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 16 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p31-n16/solution/solve.sh b/tasks/agg-p31-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..28ca805e9c1071cb9c900def05cd26121e3ae0f6 --- /dev/null +++ b/tasks/agg-p31-n16/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[2, 3, 4, 14, 16, 23, 25, 27, 28, 36, 39, 50, 51, 63, 76, 82]' > "$answer" diff --git a/tasks/agg-p31-n16/task.toml b/tasks/agg-p31-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..7cdfb1309082750677600aef97af18cf36a16630 --- /dev/null +++ b/tasks/agg-p31-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p31-n16" +version = "0.1.0" +description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 31 +agents = 16 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p31-n16/tests/expected.json b/tasks/agg-p31-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..a5a4d364f9dbf87f6f80e4eb2e116a1d1c1992f1 --- /dev/null +++ b/tasks/agg-p31-n16/tests/expected.json @@ -0,0 +1 @@ +[2, 3, 4, 14, 16, 23, 25, 27, 28, 36, 39, 50, 51, 63, 76, 82] diff --git a/tasks/agg-p31-n16/tests/test.sh b/tasks/agg-p31-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p31-n16/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p32-n01/instruction.md b/tasks/agg-p32-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p32-n01/instruction.md @@ -0,0 +1,8 @@ +# Sort the team's private numbers + +You are the only agent on this team, solving a private-information number sorting task. You +hold one private integer from 1 to 99, written in English words. It is in your instructions, +under "Your private number". + +Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numeric +value, as digits. Then stop. diff --git a/tasks/agg-p32-n01/solution/solve.sh b/tasks/agg-p32-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c2da1de78c4e4594059a5ac83f645ee2dfc08177 --- /dev/null +++ b/tasks/agg-p32-n01/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[65]' > "$answer" diff --git a/tasks/agg-p32-n01/task.toml b/tasks/agg-p32-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..48a792c70f3edecc1bb9e37859507d698acf7952 --- /dev/null +++ b/tasks/agg-p32-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p32-n01" +version = "0.1.0" +description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 32 +agents = 1 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p32-n01/tests/expected.json b/tasks/agg-p32-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..21ad18b3d452d574148baee69415e15f9165fb88 --- /dev/null +++ b/tasks/agg-p32-n01/tests/expected.json @@ -0,0 +1 @@ +[65] diff --git a/tasks/agg-p32-n01/tests/test.sh b/tasks/agg-p32-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p32-n01/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p32-n02/instruction.md b/tasks/agg-p32-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p32-n02/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 2 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 2 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 2 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p32-n02/solution/solve.sh b/tasks/agg-p32-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..135d1ee61ae258fdcc7e8f6b35c7ae4953594e6f --- /dev/null +++ b/tasks/agg-p32-n02/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[65, 80]' > "$answer" diff --git a/tasks/agg-p32-n02/task.toml b/tasks/agg-p32-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..9e1108aade5ce699d7c17ed1696e7b0121744c32 --- /dev/null +++ b/tasks/agg-p32-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p32-n02" +version = "0.1.0" +description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 32 +agents = 2 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p32-n02/tests/expected.json b/tasks/agg-p32-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..2d6ba4560d35487cac7bc7dc2c686e7cd251076a --- /dev/null +++ b/tasks/agg-p32-n02/tests/expected.json @@ -0,0 +1 @@ +[65, 80] diff --git a/tasks/agg-p32-n02/tests/test.sh b/tasks/agg-p32-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p32-n02/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p32-n04/instruction.md b/tasks/agg-p32-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p32-n04/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 4 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 4 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 4 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p32-n04/solution/solve.sh b/tasks/agg-p32-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..3e28095974c399c1be3b5ef798c0e4efc94ad4c4 --- /dev/null +++ b/tasks/agg-p32-n04/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[43, 65, 80, 85]' > "$answer" diff --git a/tasks/agg-p32-n04/task.toml b/tasks/agg-p32-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..18dbf801798ed533d5ce810880f89bcfc16d2e20 --- /dev/null +++ b/tasks/agg-p32-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p32-n04" +version = "0.1.0" +description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 32 +agents = 4 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p32-n04/tests/expected.json b/tasks/agg-p32-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..747b0091d2619d4687de6a279a8300868b045b55 --- /dev/null +++ b/tasks/agg-p32-n04/tests/expected.json @@ -0,0 +1 @@ +[43, 65, 80, 85] diff --git a/tasks/agg-p32-n04/tests/test.sh b/tasks/agg-p32-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p32-n04/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p32-n08/instruction.md b/tasks/agg-p32-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p32-n08/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 8 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 8 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 8 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p32-n08/solution/solve.sh b/tasks/agg-p32-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..b0ac6536e2f56d395d5b0f068a9fcab5ab2adf79 --- /dev/null +++ b/tasks/agg-p32-n08/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[43, 58, 61, 65, 80, 85, 86, 89]' > "$answer" diff --git a/tasks/agg-p32-n08/task.toml b/tasks/agg-p32-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..4db7f33325554c68518ea85dc624e1db4021c004 --- /dev/null +++ b/tasks/agg-p32-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p32-n08" +version = "0.1.0" +description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 32 +agents = 8 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p32-n08/tests/expected.json b/tasks/agg-p32-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..13692c858e96cabbc72357156bf2c2a994a6dcf7 --- /dev/null +++ b/tasks/agg-p32-n08/tests/expected.json @@ -0,0 +1 @@ +[43, 58, 61, 65, 80, 85, 86, 89] diff --git a/tasks/agg-p32-n08/tests/test.sh b/tasks/agg-p32-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p32-n08/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY diff --git a/tasks/agg-p32-n16/instruction.md b/tasks/agg-p32-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p32-n16/instruction.md @@ -0,0 +1,20 @@ +# Sort the team's private numbers + +You are on a team of 16 agents solving a private-information number sorting task. Each agent +holds one private integer from 1 to 99, written in English words. Yours is in your instructions, +under "Your private number". You know only your own number, and the others don't know it unless +you tell them. + +The team must find all 16 numbers and list their numeric values in ascending order. Keep equal +numbers from different agents as separate entries: each agent's number appears once in the list, +even when another agent holds the same value. + +1. Share your number with the team on the message board. +2. Read the board for the other participants' numbers. Note which participant each number came + from, so that a number posted more than once is counted once. +3. Once you have one number from every participant, yourself included, write `/app/answer.json` + (create `/app` if needed): a JSON array of the 16 integers, as digits, in ascending order. + Then stop. + +Any agent may write the full answer, and the team succeeds if at least one agent's answer is +correct. Your instructions name the other participants and explain the board's tools. diff --git a/tasks/agg-p32-n16/solution/solve.sh b/tasks/agg-p32-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..3083b02b9299ca6cc8e69048d93880ee9ca32985 --- /dev/null +++ b/tasks/agg-p32-n16/solution/solve.sh @@ -0,0 +1,5 @@ +#!/bin/bash +# Oracle: the team's answer from its own copy (not tests/), to validate the grader. +answer=${ANSWER:-/app/answer.json} +mkdir -p "$(dirname "$answer")" +echo '[8, 31, 42, 43, 58, 61, 65, 65, 67, 76, 80, 85, 86, 89, 91, 91]' > "$answer" diff --git a/tasks/agg-p32-n16/task.toml b/tasks/agg-p32-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..cf90ee1368c18a4510316f3a7d6a9f9253464e7f --- /dev/null +++ b/tasks/agg-p32-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p32-n16" +version = "0.1.0" +description = "s3-aggregation: 16 agents each hold a private number; the team lists them all in ascending order." +keywords = ["multi-agent", "message-board", "s3", "aggregation"] + +[metadata] +problem = 32 +agents = 16 +seed = 115 + +[agent] +timeout_sec = 1800 + +[environment] +# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it +# too. Nothing task-specific is in the container: each agent's number reaches it only through +# its own instructions (the flock role file), and tests/ arrive only when the agent is done. +docker_image = "python:3.12-slim" +cpus = 1 +memory_mb = 1024 + +[verifier] +timeout_sec = 60 diff --git a/tasks/agg-p32-n16/tests/expected.json b/tasks/agg-p32-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..82f46d59dbdb733fcbbf15660a112ca15dc9cda3 --- /dev/null +++ b/tasks/agg-p32-n16/tests/expected.json @@ -0,0 +1 @@ +[8, 31, 42, 43, 58, 61, 65, 65, 67, 76, 80, 85, 86, 89, 91, 91] diff --git a/tasks/agg-p32-n16/tests/test.sh b/tasks/agg-p32-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p32-n16/tests/test.sh @@ -0,0 +1,42 @@ +#!/bin/bash +# Reward 1 if /app/answer.json is exactly expected.json: a JSON array of the team's integers in +# ascending order, one per agent (equal numbers kept). Anything else scores 0: a missing or +# unreadable file, invalid UTF-8 or JSON, NaN or Infinity, a non-array, strings, floats or +# booleans, a missing, extra or dropped duplicate number, and a wrong order. The script writes 0 +# before it checks anything, so a crash of the check also leaves reward 0, and keeps a copy of +# the answer with the trial's results. ANSWER, EXPECTED and VERIFIER_DIR override the paths, to +# test the grader locally. +answer=${ANSWER:-/app/answer.json} +expected=${EXPECTED:-$(dirname "$0")/expected.json} +verifier=${VERIFIER_DIR:-/logs/verifier} +mkdir -p "$verifier" +echo 0 > "$verifier/reward.txt" +cp "$answer" "$verifier/answer.json" 2>/dev/null || true +ANSWER="$answer" EXPECTED="$expected" VERIFIER_DIR="$verifier" python3 - <<'PY' || true +import json +import os + + +def reject_constant(name): + raise ValueError(f"{name} is not JSON") + + +def load(path): + with open(path, "rb") as stream: + return json.loads(stream.read().decode("utf-8"), parse_constant=reject_constant) + + +try: + answer, expected = load(os.environ["ANSWER"]), load(os.environ["EXPECTED"]) + valid = ( + isinstance(answer, list) + and all(type(x) is int for x in answer) # not bool, float or str + and answer == expected + ) +except Exception: # missing file, invalid UTF-8 or JSON, NaN, RecursionError + valid = False +if valid: + with open(os.path.join(os.environ["VERIFIER_DIR"], "reward.txt"), "w") as stream: + stream.write("1") +print("reward:", 1 if valid else 0) +PY