diff --git a/tasks/agg-p07-n01/tests/test.sh b/tasks/agg-p07-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p07-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-p07-n02/instruction.md b/tasks/agg-p07-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p07-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-p07-n02/solution/solve.sh b/tasks/agg-p07-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..41264715a8fed5e68b7902ef11e16126b60c5893 --- /dev/null +++ b/tasks/agg-p07-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 '[36, 49]' > "$answer" diff --git a/tasks/agg-p07-n02/task.toml b/tasks/agg-p07-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..ed2edc301d25c2c4e6377dc36ad7b91113a7c9f2 --- /dev/null +++ b/tasks/agg-p07-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p07-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 = 7 +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-p07-n02/tests/expected.json b/tasks/agg-p07-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..63b6c9ea7c0f8ef8ffbe64e1558e95589cc6cf05 --- /dev/null +++ b/tasks/agg-p07-n02/tests/expected.json @@ -0,0 +1 @@ +[36, 49] diff --git a/tasks/agg-p07-n02/tests/test.sh b/tasks/agg-p07-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p07-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-p07-n04/instruction.md b/tasks/agg-p07-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p07-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-p07-n04/solution/solve.sh b/tasks/agg-p07-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..0d42d8b3ae74ac734712d43cc5663e75daa9498d --- /dev/null +++ b/tasks/agg-p07-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 '[36, 38, 48, 49]' > "$answer" diff --git a/tasks/agg-p07-n04/task.toml b/tasks/agg-p07-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..13d980335556ba987b60ff6a45e82c03b8c8c7a4 --- /dev/null +++ b/tasks/agg-p07-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p07-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 = 7 +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-p07-n04/tests/expected.json b/tasks/agg-p07-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..6e9e6c0e77833277d502024c79a279294b5e0ad3 --- /dev/null +++ b/tasks/agg-p07-n04/tests/expected.json @@ -0,0 +1 @@ +[36, 38, 48, 49] diff --git a/tasks/agg-p07-n04/tests/test.sh b/tasks/agg-p07-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p07-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-p07-n08/instruction.md b/tasks/agg-p07-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p07-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-p07-n08/solution/solve.sh b/tasks/agg-p07-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..d953957e592079c0c30fd41761129482f595eb0a --- /dev/null +++ b/tasks/agg-p07-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 '[8, 22, 36, 38, 48, 49, 54, 88]' > "$answer" diff --git a/tasks/agg-p07-n08/task.toml b/tasks/agg-p07-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..eb551b52ce492ccf9cb0fcea51d20736f36be50b --- /dev/null +++ b/tasks/agg-p07-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p07-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 = 7 +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-p07-n08/tests/expected.json b/tasks/agg-p07-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..61115a38af63f370bc83061ba9162c50108c9ecc --- /dev/null +++ b/tasks/agg-p07-n08/tests/expected.json @@ -0,0 +1 @@ +[8, 22, 36, 38, 48, 49, 54, 88] diff --git a/tasks/agg-p07-n08/tests/test.sh b/tasks/agg-p07-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p07-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-p07-n16/instruction.md b/tasks/agg-p07-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p07-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-p07-n16/solution/solve.sh b/tasks/agg-p07-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..bbc6ec3434080deae9d66ccdaf57b0497df668b4 --- /dev/null +++ b/tasks/agg-p07-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, 8, 9, 16, 22, 25, 36, 38, 42, 48, 49, 54, 66, 78, 86, 88]' > "$answer" diff --git a/tasks/agg-p07-n16/task.toml b/tasks/agg-p07-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..22d1015fd89b87ca8b16e3506a96c95904432cdf --- /dev/null +++ b/tasks/agg-p07-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p07-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 = 7 +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-p07-n16/tests/expected.json b/tasks/agg-p07-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..6d9a379feacf87b3e56dd889dd35e756431350e6 --- /dev/null +++ b/tasks/agg-p07-n16/tests/expected.json @@ -0,0 +1 @@ +[2, 8, 9, 16, 22, 25, 36, 38, 42, 48, 49, 54, 66, 78, 86, 88] diff --git a/tasks/agg-p07-n16/tests/test.sh b/tasks/agg-p07-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p07-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-p08-n01/instruction.md b/tasks/agg-p08-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p08-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-p08-n01/solution/solve.sh b/tasks/agg-p08-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..bfe3d1ef5329e0da4b2d43d67091b654fef0fa82 --- /dev/null +++ b/tasks/agg-p08-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 '[37]' > "$answer" diff --git a/tasks/agg-p08-n01/task.toml b/tasks/agg-p08-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..196161fc17e8fed0a89be6e8fbbad81d54e7089b --- /dev/null +++ b/tasks/agg-p08-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p08-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 = 8 +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-p08-n01/tests/expected.json b/tasks/agg-p08-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..8d06bb649bc6fe44dc0b60e2c2eacfbe5154fc54 --- /dev/null +++ b/tasks/agg-p08-n01/tests/expected.json @@ -0,0 +1 @@ +[37] diff --git a/tasks/agg-p08-n01/tests/test.sh b/tasks/agg-p08-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p08-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-p08-n02/instruction.md b/tasks/agg-p08-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p08-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-p08-n02/solution/solve.sh b/tasks/agg-p08-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..5660d0acd480f744e0a0558de97a5c1cd7ea3c3f --- /dev/null +++ b/tasks/agg-p08-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 '[37, 71]' > "$answer" diff --git a/tasks/agg-p08-n02/task.toml b/tasks/agg-p08-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e80c7f02ca68a7fd11ec182d02b1739ad3f340ad --- /dev/null +++ b/tasks/agg-p08-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p08-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 = 8 +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-p08-n02/tests/expected.json b/tasks/agg-p08-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..6214d194c3ddc9a34dd690889a4c9e23ab4c7b33 --- /dev/null +++ b/tasks/agg-p08-n02/tests/expected.json @@ -0,0 +1 @@ +[37, 71] diff --git a/tasks/agg-p08-n02/tests/test.sh b/tasks/agg-p08-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p08-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-p08-n04/instruction.md b/tasks/agg-p08-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p08-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-p08-n04/solution/solve.sh b/tasks/agg-p08-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..2ef637d3f5b791e756892854f28f286834fc075c --- /dev/null +++ b/tasks/agg-p08-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 '[37, 44, 71, 88]' > "$answer" diff --git a/tasks/agg-p08-n04/task.toml b/tasks/agg-p08-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..862771a919c1bd97863dade570bace1e6d49b0e9 --- /dev/null +++ b/tasks/agg-p08-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p08-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 = 8 +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-p08-n04/tests/expected.json b/tasks/agg-p08-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..bb28c46636293676e397566431ec95202b19b61b --- /dev/null +++ b/tasks/agg-p08-n04/tests/expected.json @@ -0,0 +1 @@ +[37, 44, 71, 88] diff --git a/tasks/agg-p08-n04/tests/test.sh b/tasks/agg-p08-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p08-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-p08-n08/instruction.md b/tasks/agg-p08-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p08-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-p08-n08/solution/solve.sh b/tasks/agg-p08-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..7052da51d2bb1e6347bdacc3f342d868d3d94a66 --- /dev/null +++ b/tasks/agg-p08-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 '[24, 35, 37, 44, 66, 68, 71, 88]' > "$answer" diff --git a/tasks/agg-p08-n08/task.toml b/tasks/agg-p08-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1fffc3aa8e73ae4a9cb076c5c0dfd95d120b846e --- /dev/null +++ b/tasks/agg-p08-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p08-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 = 8 +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-p08-n08/tests/expected.json b/tasks/agg-p08-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..9fd4d8c43a541b770ec7df7d23e030f6ea08f82e --- /dev/null +++ b/tasks/agg-p08-n08/tests/expected.json @@ -0,0 +1 @@ +[24, 35, 37, 44, 66, 68, 71, 88] diff --git a/tasks/agg-p08-n08/tests/test.sh b/tasks/agg-p08-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p08-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-p08-n16/instruction.md b/tasks/agg-p08-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p08-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-p08-n16/solution/solve.sh b/tasks/agg-p08-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..07dd93032767615c8fdb33d8648ecc9bdd9c8eea --- /dev/null +++ b/tasks/agg-p08-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 '[23, 24, 35, 37, 44, 56, 64, 66, 68, 70, 70, 71, 76, 84, 88, 92]' > "$answer" diff --git a/tasks/agg-p08-n16/task.toml b/tasks/agg-p08-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..f03cbd499cbae4a3155c93f5c4cd1721fe25e693 --- /dev/null +++ b/tasks/agg-p08-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p08-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 = 8 +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-p08-n16/tests/expected.json b/tasks/agg-p08-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..d554d648df52d88302dbfb2ceb602c86d48e61dc --- /dev/null +++ b/tasks/agg-p08-n16/tests/expected.json @@ -0,0 +1 @@ +[23, 24, 35, 37, 44, 56, 64, 66, 68, 70, 70, 71, 76, 84, 88, 92] diff --git a/tasks/agg-p08-n16/tests/test.sh b/tasks/agg-p08-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p08-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-p09-n01/instruction.md b/tasks/agg-p09-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p09-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-p09-n01/solution/solve.sh b/tasks/agg-p09-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..b0f6585a23e398321201c13c43d39e0c41cc7930 --- /dev/null +++ b/tasks/agg-p09-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 '[40]' > "$answer" diff --git a/tasks/agg-p09-n01/task.toml b/tasks/agg-p09-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6515c63759f77533db78c6480f4ddbbd63a4dfb3 --- /dev/null +++ b/tasks/agg-p09-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p09-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 = 9 +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-p09-n01/tests/expected.json b/tasks/agg-p09-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..83cb35fe9a3ae5497889d14ea34d7f86064fc095 --- /dev/null +++ b/tasks/agg-p09-n01/tests/expected.json @@ -0,0 +1 @@ +[40] diff --git a/tasks/agg-p09-n01/tests/test.sh b/tasks/agg-p09-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p09-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-p09-n02/instruction.md b/tasks/agg-p09-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p09-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-p09-n02/solution/solve.sh b/tasks/agg-p09-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..558f3bf2c0205dba2dad79a1c3609b8203ac3e6e --- /dev/null +++ b/tasks/agg-p09-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 '[40, 67]' > "$answer" diff --git a/tasks/agg-p09-n02/task.toml b/tasks/agg-p09-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5e46cc1a4e41ce249dccf4698575942d23f84cf7 --- /dev/null +++ b/tasks/agg-p09-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p09-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 = 9 +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-p09-n02/tests/expected.json b/tasks/agg-p09-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..65b3531906a73385b194984106ddd7b9b0a2d712 --- /dev/null +++ b/tasks/agg-p09-n02/tests/expected.json @@ -0,0 +1 @@ +[40, 67] diff --git a/tasks/agg-p09-n02/tests/test.sh b/tasks/agg-p09-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p09-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-p09-n04/instruction.md b/tasks/agg-p09-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p09-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-p09-n04/solution/solve.sh b/tasks/agg-p09-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..8be01ecbad13ef48605fa8444123e8bb0f0d2a90 --- /dev/null +++ b/tasks/agg-p09-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 '[40, 43, 65, 67]' > "$answer" diff --git a/tasks/agg-p09-n04/task.toml b/tasks/agg-p09-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..ea75d941afaba0012257568afd3c8232eb7b8ca7 --- /dev/null +++ b/tasks/agg-p09-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p09-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 = 9 +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-p09-n04/tests/expected.json b/tasks/agg-p09-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..58cb5f7760c651c834e6dde39cc0afabee3f1e1b --- /dev/null +++ b/tasks/agg-p09-n04/tests/expected.json @@ -0,0 +1 @@ +[40, 43, 65, 67] diff --git a/tasks/agg-p09-n04/tests/test.sh b/tasks/agg-p09-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p09-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-p09-n08/instruction.md b/tasks/agg-p09-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p09-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-p09-n08/solution/solve.sh b/tasks/agg-p09-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..5a1b7ff11b80e036e4936bf554aa74b9ffe196d6 --- /dev/null +++ b/tasks/agg-p09-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, 18, 40, 43, 60, 65, 66, 67]' > "$answer" diff --git a/tasks/agg-p09-n08/task.toml b/tasks/agg-p09-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..27c8ab9d67b209d1286a31a6ac6077e4d024a6d0 --- /dev/null +++ b/tasks/agg-p09-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p09-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 = 9 +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-p09-n08/tests/expected.json b/tasks/agg-p09-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..ab37f9fb33200147aff479b074573d0231b0947c --- /dev/null +++ b/tasks/agg-p09-n08/tests/expected.json @@ -0,0 +1 @@ +[14, 18, 40, 43, 60, 65, 66, 67] diff --git a/tasks/agg-p09-n08/tests/test.sh b/tasks/agg-p09-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p09-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-p09-n16/instruction.md b/tasks/agg-p09-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p09-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-p09-n16/solution/solve.sh b/tasks/agg-p09-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..1ee587de292ff6f488456ffb15da2cbc5c6d4ca7 --- /dev/null +++ b/tasks/agg-p09-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, 14, 14, 18, 20, 31, 40, 43, 60, 63, 65, 66, 67, 68, 81, 88]' > "$answer" diff --git a/tasks/agg-p09-n16/task.toml b/tasks/agg-p09-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..2123d45bb15885389f5faa92b4a9f6a9d12b1190 --- /dev/null +++ b/tasks/agg-p09-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p09-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 = 9 +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-p09-n16/tests/expected.json b/tasks/agg-p09-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..0c02fca6e1e13a216c0115dd582b115286fb02a4 --- /dev/null +++ b/tasks/agg-p09-n16/tests/expected.json @@ -0,0 +1 @@ +[8, 14, 14, 18, 20, 31, 40, 43, 60, 63, 65, 66, 67, 68, 81, 88] diff --git a/tasks/agg-p09-n16/tests/test.sh b/tasks/agg-p09-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p09-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-p10-n01/instruction.md b/tasks/agg-p10-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p10-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-p10-n01/solution/solve.sh b/tasks/agg-p10-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..cd1dae51294596dc4b50c099146cf19eb002fcd7 --- /dev/null +++ b/tasks/agg-p10-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 '[69]' > "$answer" diff --git a/tasks/agg-p10-n01/task.toml b/tasks/agg-p10-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1f1ad94a6c4fb3510305847f654c0ae867bb0895 --- /dev/null +++ b/tasks/agg-p10-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p10-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 = 10 +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-p10-n01/tests/expected.json b/tasks/agg-p10-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..12c6fd40d91a9cc97dbcd15fb8538f036c3ee2b7 --- /dev/null +++ b/tasks/agg-p10-n01/tests/expected.json @@ -0,0 +1 @@ +[69] diff --git a/tasks/agg-p10-n01/tests/test.sh b/tasks/agg-p10-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p10-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-p10-n02/instruction.md b/tasks/agg-p10-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p10-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-p10-n02/solution/solve.sh b/tasks/agg-p10-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..d50624204db94fd66730bc0e27254595c0ff4c68 --- /dev/null +++ b/tasks/agg-p10-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 '[5, 69]' > "$answer" diff --git a/tasks/agg-p10-n02/task.toml b/tasks/agg-p10-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..15a1269a97d9624a8511de76551c6269ecf2694c --- /dev/null +++ b/tasks/agg-p10-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p10-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 = 10 +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-p10-n02/tests/expected.json b/tasks/agg-p10-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..73f6b97992ede3ff5d3a7b457221622c9f8dd722 --- /dev/null +++ b/tasks/agg-p10-n02/tests/expected.json @@ -0,0 +1 @@ +[5, 69] diff --git a/tasks/agg-p10-n02/tests/test.sh b/tasks/agg-p10-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p10-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-p10-n04/instruction.md b/tasks/agg-p10-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p10-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-p10-n04/solution/solve.sh b/tasks/agg-p10-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..73413223c656bad54978a9c460aac1f7c63918c6 --- /dev/null +++ b/tasks/agg-p10-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, 12, 19, 69]' > "$answer" diff --git a/tasks/agg-p10-n04/task.toml b/tasks/agg-p10-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..4dc75019698c35fc3d3d4c1f9e3777fbd904c5be --- /dev/null +++ b/tasks/agg-p10-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p10-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 = 10 +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-p10-n04/tests/expected.json b/tasks/agg-p10-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..bb368696f19b56748e897001336bac39d815c347 --- /dev/null +++ b/tasks/agg-p10-n04/tests/expected.json @@ -0,0 +1 @@ +[5, 12, 19, 69] diff --git a/tasks/agg-p10-n04/tests/test.sh b/tasks/agg-p10-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p10-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-p10-n08/instruction.md b/tasks/agg-p10-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p10-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-p10-n08/solution/solve.sh b/tasks/agg-p10-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..f98f990da22167824944a6e27486bd94d9b22aec --- /dev/null +++ b/tasks/agg-p10-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, 12, 19, 32, 51, 63, 69, 79]' > "$answer" diff --git a/tasks/agg-p10-n08/task.toml b/tasks/agg-p10-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..b4f83e75fe064fb8f6bfac3fcc7ad27dff89e7be --- /dev/null +++ b/tasks/agg-p10-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p10-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 = 10 +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-p10-n08/tests/expected.json b/tasks/agg-p10-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..ddbf3a73a31c9bd4aa3e9533808d74d43af529e7 --- /dev/null +++ b/tasks/agg-p10-n08/tests/expected.json @@ -0,0 +1 @@ +[5, 12, 19, 32, 51, 63, 69, 79] diff --git a/tasks/agg-p10-n08/tests/test.sh b/tasks/agg-p10-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p10-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-p10-n16/instruction.md b/tasks/agg-p10-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p10-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-p10-n16/solution/solve.sh b/tasks/agg-p10-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..714ae793a2eced7f9cb82d4cea6fa736b95adcc7 --- /dev/null +++ b/tasks/agg-p10-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 '[4, 5, 12, 12, 19, 25, 32, 51, 56, 58, 63, 69, 75, 79, 86, 96]' > "$answer" diff --git a/tasks/agg-p10-n16/task.toml b/tasks/agg-p10-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..3f6f0d0361927c82b4d0a7117138da4d0494f749 --- /dev/null +++ b/tasks/agg-p10-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p10-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 = 10 +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-p10-n16/tests/expected.json b/tasks/agg-p10-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..dba4b92af6039be04ff666b1037960d3a96b27f2 --- /dev/null +++ b/tasks/agg-p10-n16/tests/expected.json @@ -0,0 +1 @@ +[4, 5, 12, 12, 19, 25, 32, 51, 56, 58, 63, 69, 75, 79, 86, 96] diff --git a/tasks/agg-p10-n16/tests/test.sh b/tasks/agg-p10-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p10-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-p11-n01/instruction.md b/tasks/agg-p11-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p11-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-p11-n01/solution/solve.sh b/tasks/agg-p11-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..9706b73a9542130b6ce99a8cbefb4e870f872fed --- /dev/null +++ b/tasks/agg-p11-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 '[12]' > "$answer" diff --git a/tasks/agg-p11-n01/task.toml b/tasks/agg-p11-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..902dd2efe5709140442060c21bbbb9474b672127 --- /dev/null +++ b/tasks/agg-p11-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p11-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 = 11 +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-p11-n01/tests/expected.json b/tasks/agg-p11-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..517042c5ae67f80608c9dfb57d71ed86c4d1ba05 --- /dev/null +++ b/tasks/agg-p11-n01/tests/expected.json @@ -0,0 +1 @@ +[12] diff --git a/tasks/agg-p11-n01/tests/test.sh b/tasks/agg-p11-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p11-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-p11-n02/instruction.md b/tasks/agg-p11-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p11-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-p11-n02/solution/solve.sh b/tasks/agg-p11-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..0d6583154e63d8cd6ed8b158b5494cf373fa0c7f --- /dev/null +++ b/tasks/agg-p11-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 '[12, 98]' > "$answer" diff --git a/tasks/agg-p11-n02/task.toml b/tasks/agg-p11-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..1a656c823fdfd926c02d15b43765b261e6bf2311 --- /dev/null +++ b/tasks/agg-p11-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p11-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 = 11 +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-p11-n02/tests/expected.json b/tasks/agg-p11-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..62866ef28dcc89eb377e87b1e43c381d0e43e957 --- /dev/null +++ b/tasks/agg-p11-n02/tests/expected.json @@ -0,0 +1 @@ +[12, 98] diff --git a/tasks/agg-p11-n02/tests/test.sh b/tasks/agg-p11-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p11-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-p11-n04/instruction.md b/tasks/agg-p11-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p11-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-p11-n04/solution/solve.sh b/tasks/agg-p11-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c97d99e003c77af1acab46808ce7c2b52c0ebd39 --- /dev/null +++ b/tasks/agg-p11-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 '[12, 75, 78, 98]' > "$answer" diff --git a/tasks/agg-p11-n04/task.toml b/tasks/agg-p11-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..586d27aecc5b8d3a0769d03272418a80a79feb76 --- /dev/null +++ b/tasks/agg-p11-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p11-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 = 11 +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-p11-n04/tests/expected.json b/tasks/agg-p11-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..b9e29e6a2f09da19dc5258cc718558fcc148cce3 --- /dev/null +++ b/tasks/agg-p11-n04/tests/expected.json @@ -0,0 +1 @@ +[12, 75, 78, 98] diff --git a/tasks/agg-p11-n04/tests/test.sh b/tasks/agg-p11-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p11-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-p11-n08/instruction.md b/tasks/agg-p11-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p11-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-p11-n08/solution/solve.sh b/tasks/agg-p11-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..859a43d30b55254cf1ed9f83c2e0e6ec4bb1a544 --- /dev/null +++ b/tasks/agg-p11-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 '[11, 12, 25, 67, 75, 78, 84, 98]' > "$answer" diff --git a/tasks/agg-p11-n08/task.toml b/tasks/agg-p11-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..69873a06b1d418436ca31f573683d53b46fb9d0b --- /dev/null +++ b/tasks/agg-p11-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p11-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 = 11 +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-p11-n08/tests/expected.json b/tasks/agg-p11-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..a245e64802546ed749b9ea910efbc61032dcfc69 --- /dev/null +++ b/tasks/agg-p11-n08/tests/expected.json @@ -0,0 +1 @@ +[11, 12, 25, 67, 75, 78, 84, 98] diff --git a/tasks/agg-p11-n08/tests/test.sh b/tasks/agg-p11-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p11-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-p11-n16/instruction.md b/tasks/agg-p11-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p11-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-p11-n16/solution/solve.sh b/tasks/agg-p11-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..7502bc1128aab2a6facab4fdb099bd6e3a3fb42f --- /dev/null +++ b/tasks/agg-p11-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 '[4, 11, 12, 16, 23, 25, 40, 42, 67, 74, 74, 75, 78, 84, 94, 98]' > "$answer" diff --git a/tasks/agg-p11-n16/task.toml b/tasks/agg-p11-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..285af5c27536b7cb2d5fd5018da258c6212065be --- /dev/null +++ b/tasks/agg-p11-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p11-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 = 11 +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-p11-n16/tests/expected.json b/tasks/agg-p11-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..25eb5b30b56e76326be9cbf92e9452f8320823c5 --- /dev/null +++ b/tasks/agg-p11-n16/tests/expected.json @@ -0,0 +1 @@ +[4, 11, 12, 16, 23, 25, 40, 42, 67, 74, 74, 75, 78, 84, 94, 98] diff --git a/tasks/agg-p11-n16/tests/test.sh b/tasks/agg-p11-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p11-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-p12-n01/instruction.md b/tasks/agg-p12-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p12-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-p12-n01/solution/solve.sh b/tasks/agg-p12-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..93e1f73788b6522e1a69d8f90f2e77a7dc3e14bd --- /dev/null +++ b/tasks/agg-p12-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 '[2]' > "$answer" diff --git a/tasks/agg-p12-n01/task.toml b/tasks/agg-p12-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..7bced8b53aaeb0a697d31b12a50ee713f4133139 --- /dev/null +++ b/tasks/agg-p12-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p12-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 = 12 +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-p12-n01/tests/expected.json b/tasks/agg-p12-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..22fd87520efb75995b9dfba52cde337b399e5311 --- /dev/null +++ b/tasks/agg-p12-n01/tests/expected.json @@ -0,0 +1 @@ +[2] diff --git a/tasks/agg-p12-n01/tests/test.sh b/tasks/agg-p12-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p12-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-p12-n02/instruction.md b/tasks/agg-p12-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p12-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-p12-n02/solution/solve.sh b/tasks/agg-p12-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a03b85e0788020299f8e6f16270176a6a9b8f4fc --- /dev/null +++ b/tasks/agg-p12-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 '[2, 50]' > "$answer" diff --git a/tasks/agg-p12-n02/task.toml b/tasks/agg-p12-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..06ab15f32bd14421da29e15c458d6b739acd8a54 --- /dev/null +++ b/tasks/agg-p12-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p12-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 = 12 +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-p12-n02/tests/expected.json b/tasks/agg-p12-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..0140b7ce8c421892495615f101d6793fabe22684 --- /dev/null +++ b/tasks/agg-p12-n02/tests/expected.json @@ -0,0 +1 @@ +[2, 50] diff --git a/tasks/agg-p12-n02/tests/test.sh b/tasks/agg-p12-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p12-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-p12-n04/instruction.md b/tasks/agg-p12-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p12-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-p12-n04/solution/solve.sh b/tasks/agg-p12-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..65ec53cc0061723440e422443921d80a2044d324 --- /dev/null +++ b/tasks/agg-p12-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 '[2, 12, 50, 95]' > "$answer" diff --git a/tasks/agg-p12-n04/task.toml b/tasks/agg-p12-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..9878f50ee464612f084efba2df0a078caead7681 --- /dev/null +++ b/tasks/agg-p12-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p12-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 = 12 +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-p12-n04/tests/expected.json b/tasks/agg-p12-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..ef0dab5bd3c2d867cdea37a5e10dc41a61d0f2cb --- /dev/null +++ b/tasks/agg-p12-n04/tests/expected.json @@ -0,0 +1 @@ +[2, 12, 50, 95] diff --git a/tasks/agg-p12-n04/tests/test.sh b/tasks/agg-p12-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p12-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-p12-n08/instruction.md b/tasks/agg-p12-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p12-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-p12-n08/solution/solve.sh b/tasks/agg-p12-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..bf4361bae17bd2c9f93888aa2d71ee7ea6ea6f06 --- /dev/null +++ b/tasks/agg-p12-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, 12, 15, 30, 31, 50, 95, 99]' > "$answer" diff --git a/tasks/agg-p12-n08/task.toml b/tasks/agg-p12-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..dd59c204a422cf05a803aa743261f0550d4a2770 --- /dev/null +++ b/tasks/agg-p12-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p12-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 = 12 +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-p12-n08/tests/expected.json b/tasks/agg-p12-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..7a51ae7bc5899d7df8d19aec8a9471fa7c9356c6 --- /dev/null +++ b/tasks/agg-p12-n08/tests/expected.json @@ -0,0 +1 @@ +[2, 12, 15, 30, 31, 50, 95, 99] diff --git a/tasks/agg-p12-n08/tests/test.sh b/tasks/agg-p12-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p12-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-p12-n16/instruction.md b/tasks/agg-p12-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p12-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-p12-n16/solution/solve.sh b/tasks/agg-p12-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..631ebdf1542c1b94275cb16db272e15afdaee63c --- /dev/null +++ b/tasks/agg-p12-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, 11, 12, 15, 24, 30, 31, 31, 33, 44, 45, 50, 79, 95, 95, 99]' > "$answer" diff --git a/tasks/agg-p12-n16/task.toml b/tasks/agg-p12-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..4703b20ae30dd91bcb239a90c57e30bfa7e41cd9 --- /dev/null +++ b/tasks/agg-p12-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p12-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 = 12 +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-p12-n16/tests/expected.json b/tasks/agg-p12-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..4cde1283b5482652528f0e5f8cc3cc13b6b1ac20 --- /dev/null +++ b/tasks/agg-p12-n16/tests/expected.json @@ -0,0 +1 @@ +[2, 11, 12, 15, 24, 30, 31, 31, 33, 44, 45, 50, 79, 95, 95, 99] diff --git a/tasks/agg-p12-n16/tests/test.sh b/tasks/agg-p12-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p12-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-p13-n01/instruction.md b/tasks/agg-p13-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p13-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-p13-n01/solution/solve.sh b/tasks/agg-p13-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a2d5fc6fc55f62520a41fd97199b2a134440248d --- /dev/null +++ b/tasks/agg-p13-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 '[42]' > "$answer" diff --git a/tasks/agg-p13-n01/task.toml b/tasks/agg-p13-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..24ca603d4e9bd190d27bc6eaea1b97e69a7718da --- /dev/null +++ b/tasks/agg-p13-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p13-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 = 13 +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-p13-n01/tests/expected.json b/tasks/agg-p13-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..e44b4bf78ad721e9ecb7d674989969045e52f8d8 --- /dev/null +++ b/tasks/agg-p13-n01/tests/expected.json @@ -0,0 +1 @@ +[42] diff --git a/tasks/agg-p13-n01/tests/test.sh b/tasks/agg-p13-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p13-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-p13-n02/instruction.md b/tasks/agg-p13-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p13-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-p13-n02/solution/solve.sh b/tasks/agg-p13-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..37ebd8567dedc0a7f0ba57389ceba04141493989 --- /dev/null +++ b/tasks/agg-p13-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 '[42, 78]' > "$answer" diff --git a/tasks/agg-p13-n02/task.toml b/tasks/agg-p13-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..6d9b85845a162f4e976c37149aabf03f23dc59cb --- /dev/null +++ b/tasks/agg-p13-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p13-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 = 13 +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-p13-n02/tests/expected.json b/tasks/agg-p13-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..71ddc045918a3913bc3640845feab1a843c7c34d --- /dev/null +++ b/tasks/agg-p13-n02/tests/expected.json @@ -0,0 +1 @@ +[42, 78] diff --git a/tasks/agg-p13-n02/tests/test.sh b/tasks/agg-p13-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p13-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-p13-n04/instruction.md b/tasks/agg-p13-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p13-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-p13-n04/solution/solve.sh b/tasks/agg-p13-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..35002be50b39476d4527b0d9d76ab5ac6ae09fb8 --- /dev/null +++ b/tasks/agg-p13-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 '[42, 48, 61, 78]' > "$answer" diff --git a/tasks/agg-p13-n04/task.toml b/tasks/agg-p13-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..2cbaeea892fdaffbf76be015c8b144aa95e0f930 --- /dev/null +++ b/tasks/agg-p13-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p13-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 = 13 +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-p13-n04/tests/expected.json b/tasks/agg-p13-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..f3f067df660293ee9a22648ea6b0ba9e304492e6 --- /dev/null +++ b/tasks/agg-p13-n04/tests/expected.json @@ -0,0 +1 @@ +[42, 48, 61, 78] diff --git a/tasks/agg-p13-n04/tests/test.sh b/tasks/agg-p13-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p13-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-p13-n08/instruction.md b/tasks/agg-p13-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p13-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-p13-n08/solution/solve.sh b/tasks/agg-p13-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..914e2ae03df76794acacd39bc1a738a34d9d2cda --- /dev/null +++ b/tasks/agg-p13-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, 2, 42, 47, 48, 56, 61, 78]' > "$answer" diff --git a/tasks/agg-p13-n08/task.toml b/tasks/agg-p13-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..a85dcf8da67963e70c95fd693c2f1384fb3c46f1 --- /dev/null +++ b/tasks/agg-p13-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p13-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 = 13 +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-p13-n08/tests/expected.json b/tasks/agg-p13-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..e372178a545444a51fdeb920b181d2ccbcf2f102 --- /dev/null +++ b/tasks/agg-p13-n08/tests/expected.json @@ -0,0 +1 @@ +[2, 2, 42, 47, 48, 56, 61, 78] diff --git a/tasks/agg-p13-n08/tests/test.sh b/tasks/agg-p13-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p13-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-p13-n16/instruction.md b/tasks/agg-p13-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p13-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-p13-n16/solution/solve.sh b/tasks/agg-p13-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..71318053f3eef5b6f1a25eec62e161d98894b7c5 --- /dev/null +++ b/tasks/agg-p13-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, 2, 23, 25, 42, 47, 48, 56, 60, 61, 62, 68, 78, 82, 85, 93]' > "$answer" diff --git a/tasks/agg-p13-n16/task.toml b/tasks/agg-p13-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..f463ecc8e15b33ba586e2d59dbe755a1e6ff2143 --- /dev/null +++ b/tasks/agg-p13-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p13-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 = 13 +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-p13-n16/tests/expected.json b/tasks/agg-p13-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..e5e08fe031e04f51020db0bce8ef5a1aaa9924e3 --- /dev/null +++ b/tasks/agg-p13-n16/tests/expected.json @@ -0,0 +1 @@ +[2, 2, 23, 25, 42, 47, 48, 56, 60, 61, 62, 68, 78, 82, 85, 93] diff --git a/tasks/agg-p13-n16/tests/test.sh b/tasks/agg-p13-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p13-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-p14-n01/instruction.md b/tasks/agg-p14-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p14-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-p14-n01/solution/solve.sh b/tasks/agg-p14-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..3e2c7374256a9c5e817db16b5fd46560c1e33430 --- /dev/null +++ b/tasks/agg-p14-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 '[84]' > "$answer" diff --git a/tasks/agg-p14-n01/task.toml b/tasks/agg-p14-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e10cb56feb15b6983aefab56ed54e07394fac151 --- /dev/null +++ b/tasks/agg-p14-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p14-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 = 14 +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-p14-n01/tests/expected.json b/tasks/agg-p14-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..ecdce0605f97af01d7a2dadd3a4e4fb68e5c9cb7 --- /dev/null +++ b/tasks/agg-p14-n01/tests/expected.json @@ -0,0 +1 @@ +[84] diff --git a/tasks/agg-p14-n01/tests/test.sh b/tasks/agg-p14-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p14-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-p14-n02/instruction.md b/tasks/agg-p14-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p14-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-p14-n02/solution/solve.sh b/tasks/agg-p14-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..27708909dc212a4e410ec88e04a884334ca17389 --- /dev/null +++ b/tasks/agg-p14-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 '[29, 84]' > "$answer" diff --git a/tasks/agg-p14-n02/task.toml b/tasks/agg-p14-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..290b975df6d4301e715ec29693b781b82e29424e --- /dev/null +++ b/tasks/agg-p14-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p14-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 = 14 +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-p14-n02/tests/expected.json b/tasks/agg-p14-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..2eeb62ddfbe8841d7ec4d1cfc7f294cd1fa60807 --- /dev/null +++ b/tasks/agg-p14-n02/tests/expected.json @@ -0,0 +1 @@ +[29, 84] diff --git a/tasks/agg-p14-n02/tests/test.sh b/tasks/agg-p14-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p14-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-p14-n04/instruction.md b/tasks/agg-p14-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p14-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-p14-n04/solution/solve.sh b/tasks/agg-p14-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..4de6f148d84374a9b9d8f025f89bbadcc687c471 --- /dev/null +++ b/tasks/agg-p14-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 '[29, 49, 53, 84]' > "$answer" diff --git a/tasks/agg-p14-n04/task.toml b/tasks/agg-p14-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..2daa2728c2163bce8271d696d88279062adab325 --- /dev/null +++ b/tasks/agg-p14-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p14-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 = 14 +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-p14-n04/tests/expected.json b/tasks/agg-p14-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..e0a3fa95f9152d18ec2519fd8cc7d402aee9ce58 --- /dev/null +++ b/tasks/agg-p14-n04/tests/expected.json @@ -0,0 +1 @@ +[29, 49, 53, 84] diff --git a/tasks/agg-p14-n04/tests/test.sh b/tasks/agg-p14-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p14-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-p14-n08/instruction.md b/tasks/agg-p14-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p14-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-p14-n08/solution/solve.sh b/tasks/agg-p14-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a76327afcdb4c6f9daf723ba49751ceb9a41fb72 --- /dev/null +++ b/tasks/agg-p14-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 '[25, 29, 39, 44, 49, 53, 59, 84]' > "$answer" diff --git a/tasks/agg-p14-n08/task.toml b/tasks/agg-p14-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..0abe10b449a0af3b5285380d8183b9cce1ff0d26 --- /dev/null +++ b/tasks/agg-p14-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p14-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 = 14 +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-p14-n08/tests/expected.json b/tasks/agg-p14-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..ac0a63b220cabf1707ce425208fa8be7f0002727 --- /dev/null +++ b/tasks/agg-p14-n08/tests/expected.json @@ -0,0 +1 @@ +[25, 29, 39, 44, 49, 53, 59, 84] diff --git a/tasks/agg-p14-n08/tests/test.sh b/tasks/agg-p14-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p14-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-p14-n16/instruction.md b/tasks/agg-p14-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p14-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-p14-n16/solution/solve.sh b/tasks/agg-p14-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..98a627611415f096e99e3e53f9dfcd0135aabf4f --- /dev/null +++ b/tasks/agg-p14-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, 11, 25, 29, 37, 39, 44, 45, 49, 51, 53, 59, 72, 78, 84, 96]' > "$answer" diff --git a/tasks/agg-p14-n16/task.toml b/tasks/agg-p14-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..3ffa4b691a598daf5a1ea275660490e7915bb6b4 --- /dev/null +++ b/tasks/agg-p14-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p14-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 = 14 +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-p14-n16/tests/expected.json b/tasks/agg-p14-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..f4de4396491fe7e3a1c43778a2a0b54c548411af --- /dev/null +++ b/tasks/agg-p14-n16/tests/expected.json @@ -0,0 +1 @@ +[1, 11, 25, 29, 37, 39, 44, 45, 49, 51, 53, 59, 72, 78, 84, 96] diff --git a/tasks/agg-p14-n16/tests/test.sh b/tasks/agg-p14-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p14-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-p15-n01/instruction.md b/tasks/agg-p15-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p15-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-p15-n01/solution/solve.sh b/tasks/agg-p15-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..bfe3d1ef5329e0da4b2d43d67091b654fef0fa82 --- /dev/null +++ b/tasks/agg-p15-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 '[37]' > "$answer" diff --git a/tasks/agg-p15-n01/task.toml b/tasks/agg-p15-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..03985ec06a394f7dcd1aead9cab998d725d4e75a --- /dev/null +++ b/tasks/agg-p15-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p15-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 = 15 +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-p15-n01/tests/expected.json b/tasks/agg-p15-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..8d06bb649bc6fe44dc0b60e2c2eacfbe5154fc54 --- /dev/null +++ b/tasks/agg-p15-n01/tests/expected.json @@ -0,0 +1 @@ +[37] diff --git a/tasks/agg-p15-n01/tests/test.sh b/tasks/agg-p15-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p15-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-p15-n02/instruction.md b/tasks/agg-p15-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p15-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-p15-n02/solution/solve.sh b/tasks/agg-p15-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..b22d9b0f9e00f926673b3f879dc5ad555869b718 --- /dev/null +++ b/tasks/agg-p15-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 '[29, 37]' > "$answer" diff --git a/tasks/agg-p15-n02/task.toml b/tasks/agg-p15-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..080bdb65d14a04e53b468bad177a7737c224999a --- /dev/null +++ b/tasks/agg-p15-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p15-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 = 15 +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-p15-n02/tests/expected.json b/tasks/agg-p15-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..d89d1330c3733ae9c9e6f9cb3aaf5d1f11225a0a --- /dev/null +++ b/tasks/agg-p15-n02/tests/expected.json @@ -0,0 +1 @@ +[29, 37] diff --git a/tasks/agg-p15-n02/tests/test.sh b/tasks/agg-p15-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p15-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-p15-n04/instruction.md b/tasks/agg-p15-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p15-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-p15-n04/solution/solve.sh b/tasks/agg-p15-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..2fc1e5b4bf1ded1ea2c0fd5c590e63aad93e57dc --- /dev/null +++ b/tasks/agg-p15-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, 29, 37, 57]' > "$answer" diff --git a/tasks/agg-p15-n04/task.toml b/tasks/agg-p15-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e16bb53e22cfdf0f2471ed4ff8c59ae131781898 --- /dev/null +++ b/tasks/agg-p15-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p15-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 = 15 +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-p15-n04/tests/expected.json b/tasks/agg-p15-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..d14827333079fa9b918d75c9053399cc1a5377fa --- /dev/null +++ b/tasks/agg-p15-n04/tests/expected.json @@ -0,0 +1 @@ +[18, 29, 37, 57] diff --git a/tasks/agg-p15-n04/tests/test.sh b/tasks/agg-p15-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p15-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-p15-n08/instruction.md b/tasks/agg-p15-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p15-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-p15-n08/solution/solve.sh b/tasks/agg-p15-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..2b1e16111ea68b26b79d0b391ceee0e597486af3 --- /dev/null +++ b/tasks/agg-p15-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 '[18, 29, 37, 49, 50, 57, 62, 79]' > "$answer" diff --git a/tasks/agg-p15-n08/task.toml b/tasks/agg-p15-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e03c3601bc7ecfa7ed3011032883606646120c25 --- /dev/null +++ b/tasks/agg-p15-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p15-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 = 15 +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-p15-n08/tests/expected.json b/tasks/agg-p15-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..90f8e754d2852bc637ddba899c1a9c1e338a8bf2 --- /dev/null +++ b/tasks/agg-p15-n08/tests/expected.json @@ -0,0 +1 @@ +[18, 29, 37, 49, 50, 57, 62, 79] diff --git a/tasks/agg-p15-n08/tests/test.sh b/tasks/agg-p15-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p15-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-p15-n16/instruction.md b/tasks/agg-p15-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p15-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-p15-n16/solution/solve.sh b/tasks/agg-p15-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..88908892d1da38d7c906b0025c82b2e5ea6cd8ea --- /dev/null +++ b/tasks/agg-p15-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 '[18, 27, 29, 30, 30, 37, 40, 43, 49, 50, 53, 57, 62, 78, 79, 82]' > "$answer" diff --git a/tasks/agg-p15-n16/task.toml b/tasks/agg-p15-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..4ec4b9ae177087453518f915ce4ad9ce32601cba --- /dev/null +++ b/tasks/agg-p15-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p15-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 = 15 +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-p15-n16/tests/expected.json b/tasks/agg-p15-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..6e4035a568e166581103976ccd9456d3e1bd582a --- /dev/null +++ b/tasks/agg-p15-n16/tests/expected.json @@ -0,0 +1 @@ +[18, 27, 29, 30, 30, 37, 40, 43, 49, 50, 53, 57, 62, 78, 79, 82] diff --git a/tasks/agg-p15-n16/tests/test.sh b/tasks/agg-p15-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p15-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-p16-n01/instruction.md b/tasks/agg-p16-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p16-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-p16-n01/solution/solve.sh b/tasks/agg-p16-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..2d9b8e2f926530695c98aa50e92dfa26ef95197b --- /dev/null +++ b/tasks/agg-p16-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 '[38]' > "$answer" diff --git a/tasks/agg-p16-n01/task.toml b/tasks/agg-p16-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..897aa16ca15991addb14b804130580959a83bb3e --- /dev/null +++ b/tasks/agg-p16-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p16-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 = 16 +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-p16-n01/tests/expected.json b/tasks/agg-p16-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..28a16b63d4b166e3e785e70906ee72cbf03d49e7 --- /dev/null +++ b/tasks/agg-p16-n01/tests/expected.json @@ -0,0 +1 @@ +[38] diff --git a/tasks/agg-p16-n01/tests/test.sh b/tasks/agg-p16-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p16-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-p16-n02/instruction.md b/tasks/agg-p16-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p16-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-p16-n02/solution/solve.sh b/tasks/agg-p16-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..24cb71cd524fd18030aa43362b446e57e6594663 --- /dev/null +++ b/tasks/agg-p16-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, 63]' > "$answer" diff --git a/tasks/agg-p16-n02/task.toml b/tasks/agg-p16-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..0d63c4092dff2566e2b691c8118e80223ea5ec70 --- /dev/null +++ b/tasks/agg-p16-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p16-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 = 16 +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-p16-n02/tests/expected.json b/tasks/agg-p16-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..48250a1f194b35f2a81c946c7fb313ef9164299e --- /dev/null +++ b/tasks/agg-p16-n02/tests/expected.json @@ -0,0 +1 @@ +[38, 63] diff --git a/tasks/agg-p16-n02/tests/test.sh b/tasks/agg-p16-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p16-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-p16-n04/instruction.md b/tasks/agg-p16-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p16-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-p16-n04/solution/solve.sh b/tasks/agg-p16-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..eebe2250e931fcc644be9e3ea8977d2eaddbe8a5 --- /dev/null +++ b/tasks/agg-p16-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 '[30, 38, 63, 63]' > "$answer" diff --git a/tasks/agg-p16-n04/task.toml b/tasks/agg-p16-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..11cfcac0f79a61c569dbef58c01b6d0f9d03ef94 --- /dev/null +++ b/tasks/agg-p16-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p16-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 = 16 +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-p16-n04/tests/expected.json b/tasks/agg-p16-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..92000582d7077d188a2eaffeef56dffee965c528 --- /dev/null +++ b/tasks/agg-p16-n04/tests/expected.json @@ -0,0 +1 @@ +[30, 38, 63, 63] diff --git a/tasks/agg-p16-n04/tests/test.sh b/tasks/agg-p16-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p16-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-p16-n08/instruction.md b/tasks/agg-p16-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p16-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-p16-n08/solution/solve.sh b/tasks/agg-p16-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..4f1d13a38f41dfb55b852a02229582b658df1581 --- /dev/null +++ b/tasks/agg-p16-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 '[30, 38, 51, 58, 63, 63, 78, 81]' > "$answer" diff --git a/tasks/agg-p16-n08/task.toml b/tasks/agg-p16-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..4c3a5a700ff311f5667f08862d8149c2cfb32718 --- /dev/null +++ b/tasks/agg-p16-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p16-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 = 16 +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-p16-n08/tests/expected.json b/tasks/agg-p16-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..50db982a11c4d6e88c962339a681414ca31ebc89 --- /dev/null +++ b/tasks/agg-p16-n08/tests/expected.json @@ -0,0 +1 @@ +[30, 38, 51, 58, 63, 63, 78, 81] diff --git a/tasks/agg-p16-n08/tests/test.sh b/tasks/agg-p16-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p16-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-p16-n16/instruction.md b/tasks/agg-p16-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p16-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-p16-n16/solution/solve.sh b/tasks/agg-p16-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..f81da48d4491a0dd0373d6df09d004b803920569 --- /dev/null +++ b/tasks/agg-p16-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, 10, 16, 18, 30, 35, 38, 51, 58, 58, 63, 63, 78, 81, 88, 92]' > "$answer" diff --git a/tasks/agg-p16-n16/task.toml b/tasks/agg-p16-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..29f649b1aa0437d178a8f87617ef7cf2d20c5f1b --- /dev/null +++ b/tasks/agg-p16-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p16-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 = 16 +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-p16-n16/tests/expected.json b/tasks/agg-p16-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..d5a6db3b5bb9671eeb1e3c825a1f2d51cb6fb47e --- /dev/null +++ b/tasks/agg-p16-n16/tests/expected.json @@ -0,0 +1 @@ +[2, 10, 16, 18, 30, 35, 38, 51, 58, 58, 63, 63, 78, 81, 88, 92] diff --git a/tasks/agg-p16-n16/tests/test.sh b/tasks/agg-p16-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p16-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-p17-n01/instruction.md b/tasks/agg-p17-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p17-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-p17-n01/solution/solve.sh b/tasks/agg-p17-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..b0f6585a23e398321201c13c43d39e0c41cc7930 --- /dev/null +++ b/tasks/agg-p17-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 '[40]' > "$answer" diff --git a/tasks/agg-p17-n01/task.toml b/tasks/agg-p17-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e7c8a99ffe10a51435d1343fee3a838042df8662 --- /dev/null +++ b/tasks/agg-p17-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p17-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 = 17 +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-p17-n01/tests/expected.json b/tasks/agg-p17-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..83cb35fe9a3ae5497889d14ea34d7f86064fc095 --- /dev/null +++ b/tasks/agg-p17-n01/tests/expected.json @@ -0,0 +1 @@ +[40] diff --git a/tasks/agg-p17-n01/tests/test.sh b/tasks/agg-p17-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p17-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-p17-n02/instruction.md b/tasks/agg-p17-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p17-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-p17-n02/solution/solve.sh b/tasks/agg-p17-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..8bdb56b344ad502863280d1f5a0235f8eb864e98 --- /dev/null +++ b/tasks/agg-p17-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 '[10, 40]' > "$answer" diff --git a/tasks/agg-p17-n02/task.toml b/tasks/agg-p17-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..2e62aa084a0ed2c96dd37ff949229d535fbe2220 --- /dev/null +++ b/tasks/agg-p17-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p17-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 = 17 +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-p17-n02/tests/expected.json b/tasks/agg-p17-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..0adb22b0be6dba5829e719fa0799bc274ced4774 --- /dev/null +++ b/tasks/agg-p17-n02/tests/expected.json @@ -0,0 +1 @@ +[10, 40] diff --git a/tasks/agg-p17-n02/tests/test.sh b/tasks/agg-p17-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p17-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-p17-n04/instruction.md b/tasks/agg-p17-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p17-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-p17-n04/solution/solve.sh b/tasks/agg-p17-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..966976497fd3d0fdf976889a27742246d5b6e1f6 --- /dev/null +++ b/tasks/agg-p17-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 '[10, 31, 40, 95]' > "$answer" diff --git a/tasks/agg-p17-n04/task.toml b/tasks/agg-p17-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..4a51d835323b1dfa44f8cb9083e147a41abe446b --- /dev/null +++ b/tasks/agg-p17-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p17-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 = 17 +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-p17-n04/tests/expected.json b/tasks/agg-p17-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..f9f0bf1599ca302ecc1fdcf77fcc7b446636ad65 --- /dev/null +++ b/tasks/agg-p17-n04/tests/expected.json @@ -0,0 +1 @@ +[10, 31, 40, 95] diff --git a/tasks/agg-p17-n04/tests/test.sh b/tasks/agg-p17-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p17-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-p17-n08/instruction.md b/tasks/agg-p17-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p17-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-p17-n08/solution/solve.sh b/tasks/agg-p17-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..bfd670ce7542304af401a5ada5092d7a5673a72f --- /dev/null +++ b/tasks/agg-p17-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 '[10, 31, 40, 70, 77, 90, 95, 99]' > "$answer" diff --git a/tasks/agg-p17-n08/task.toml b/tasks/agg-p17-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..fbed4d060d118a7b8a8c93fc23af454ae44f8144 --- /dev/null +++ b/tasks/agg-p17-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p17-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 = 17 +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-p17-n08/tests/expected.json b/tasks/agg-p17-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..000b32dc23c06c832e4ba83e58572654a988f2cb --- /dev/null +++ b/tasks/agg-p17-n08/tests/expected.json @@ -0,0 +1 @@ +[10, 31, 40, 70, 77, 90, 95, 99] diff --git a/tasks/agg-p17-n08/tests/test.sh b/tasks/agg-p17-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p17-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-p17-n16/instruction.md b/tasks/agg-p17-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p17-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-p17-n16/solution/solve.sh b/tasks/agg-p17-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..93dd25b8b4604a298fef22c036e50d5f886e6a13 --- /dev/null +++ b/tasks/agg-p17-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, 10, 31, 34, 38, 40, 40, 43, 70, 70, 76, 77, 78, 90, 95, 99]' > "$answer" diff --git a/tasks/agg-p17-n16/task.toml b/tasks/agg-p17-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..89b6861cbe960c606adaa82788bf4e671b44fde7 --- /dev/null +++ b/tasks/agg-p17-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p17-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 = 17 +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-p17-n16/tests/expected.json b/tasks/agg-p17-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..a9175e133e6a9e5e1300d71ea8e1572c58394f20 --- /dev/null +++ b/tasks/agg-p17-n16/tests/expected.json @@ -0,0 +1 @@ +[2, 10, 31, 34, 38, 40, 40, 43, 70, 70, 76, 77, 78, 90, 95, 99] diff --git a/tasks/agg-p17-n16/tests/test.sh b/tasks/agg-p17-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p17-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-p18-n01/instruction.md b/tasks/agg-p18-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p18-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-p18-n01/solution/solve.sh b/tasks/agg-p18-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..68af8945fcaaba5745f364498052c706ea0bbb38 --- /dev/null +++ b/tasks/agg-p18-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 '[72]' > "$answer" diff --git a/tasks/agg-p18-n01/task.toml b/tasks/agg-p18-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5e4778a684e9a78f2173e7a57250bf35b24d9766 --- /dev/null +++ b/tasks/agg-p18-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p18-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 = 18 +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-p18-n01/tests/expected.json b/tasks/agg-p18-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..017038e8fb90dd1f85273b1c71d8910273a58277 --- /dev/null +++ b/tasks/agg-p18-n01/tests/expected.json @@ -0,0 +1 @@ +[72] diff --git a/tasks/agg-p18-n01/tests/test.sh b/tasks/agg-p18-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p18-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-p18-n02/instruction.md b/tasks/agg-p18-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p18-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-p18-n02/solution/solve.sh b/tasks/agg-p18-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..1dab922a3fae6732f300ab39268b191dde0b00f3 --- /dev/null +++ b/tasks/agg-p18-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 '[16, 72]' > "$answer" diff --git a/tasks/agg-p18-n02/task.toml b/tasks/agg-p18-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..fdc8235cacb4041f9cba03e81a23b1ceacf4d102 --- /dev/null +++ b/tasks/agg-p18-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p18-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 = 18 +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-p18-n02/tests/expected.json b/tasks/agg-p18-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..c0924228c42d1555950deb303b304f21a2289c89 --- /dev/null +++ b/tasks/agg-p18-n02/tests/expected.json @@ -0,0 +1 @@ +[16, 72] diff --git a/tasks/agg-p18-n02/tests/test.sh b/tasks/agg-p18-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p18-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-p18-n04/instruction.md b/tasks/agg-p18-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p18-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-p18-n04/solution/solve.sh b/tasks/agg-p18-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..1357ea27990981d6f4747fe18de430a20d2f51ed --- /dev/null +++ b/tasks/agg-p18-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 '[16, 72, 84, 86]' > "$answer" diff --git a/tasks/agg-p18-n04/task.toml b/tasks/agg-p18-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..03896c63e0292707d0c98b15016ee000dd41ead3 --- /dev/null +++ b/tasks/agg-p18-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p18-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 = 18 +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-p18-n04/tests/expected.json b/tasks/agg-p18-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..669cf175839de6a08f2f6d86dd2d4ef791e55a67 --- /dev/null +++ b/tasks/agg-p18-n04/tests/expected.json @@ -0,0 +1 @@ +[16, 72, 84, 86] diff --git a/tasks/agg-p18-n04/tests/test.sh b/tasks/agg-p18-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p18-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-p18-n08/instruction.md b/tasks/agg-p18-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p18-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-p18-n08/solution/solve.sh b/tasks/agg-p18-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..9bd91a482c989a4641ecee742975bf673ffb08fb --- /dev/null +++ b/tasks/agg-p18-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, 2, 16, 59, 59, 72, 84, 86]' > "$answer" diff --git a/tasks/agg-p18-n08/task.toml b/tasks/agg-p18-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..d430965f1006af918c29aa0287fba12866514b7f --- /dev/null +++ b/tasks/agg-p18-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p18-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 = 18 +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-p18-n08/tests/expected.json b/tasks/agg-p18-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..6c0a29652ec47699f39d12f32d6b93b6553892a8 --- /dev/null +++ b/tasks/agg-p18-n08/tests/expected.json @@ -0,0 +1 @@ +[1, 2, 16, 59, 59, 72, 84, 86] diff --git a/tasks/agg-p18-n08/tests/test.sh b/tasks/agg-p18-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p18-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-p18-n16/instruction.md b/tasks/agg-p18-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p18-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-p18-n16/solution/solve.sh b/tasks/agg-p18-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..f67d722de8bab84c493ee7ff750d8746cf8ecc62 --- /dev/null +++ b/tasks/agg-p18-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, 7, 16, 42, 43, 47, 59, 59, 66, 72, 74, 79, 83, 84, 86]' > "$answer" diff --git a/tasks/agg-p18-n16/task.toml b/tasks/agg-p18-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..bd5db505859d2334dc7cfe7911738c1c7ef67ed5 --- /dev/null +++ b/tasks/agg-p18-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p18-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 = 18 +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-p18-n16/tests/expected.json b/tasks/agg-p18-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..5a818509bb29ff4512f90a38bbf1fbc80c82ce5c --- /dev/null +++ b/tasks/agg-p18-n16/tests/expected.json @@ -0,0 +1 @@ +[1, 2, 7, 16, 42, 43, 47, 59, 59, 66, 72, 74, 79, 83, 84, 86] diff --git a/tasks/agg-p18-n16/tests/test.sh b/tasks/agg-p18-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p18-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-p19-n01/instruction.md b/tasks/agg-p19-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p19-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-p19-n01/solution/solve.sh b/tasks/agg-p19-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..bfe3d1ef5329e0da4b2d43d67091b654fef0fa82 --- /dev/null +++ b/tasks/agg-p19-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 '[37]' > "$answer" diff --git a/tasks/agg-p19-n01/task.toml b/tasks/agg-p19-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e254c9b2eb9b7bb6b9c4daae2954994900d3ab17 --- /dev/null +++ b/tasks/agg-p19-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p19-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 = 19 +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-p19-n01/tests/expected.json b/tasks/agg-p19-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..8d06bb649bc6fe44dc0b60e2c2eacfbe5154fc54 --- /dev/null +++ b/tasks/agg-p19-n01/tests/expected.json @@ -0,0 +1 @@ +[37] diff --git a/tasks/agg-p19-n01/tests/test.sh b/tasks/agg-p19-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p19-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-p19-n02/instruction.md b/tasks/agg-p19-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p19-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-p19-n02/solution/solve.sh b/tasks/agg-p19-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e7f511c9aba28682c97461238abc690c21434b28 --- /dev/null +++ b/tasks/agg-p19-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 '[37, 41]' > "$answer" diff --git a/tasks/agg-p19-n02/task.toml b/tasks/agg-p19-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..b9bd6bba5eaf8531e183d0f6fb6f672ca8723c5a --- /dev/null +++ b/tasks/agg-p19-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p19-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 = 19 +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-p19-n02/tests/expected.json b/tasks/agg-p19-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..a4310eaf3b15457653543d54234edd63e9af6f8e --- /dev/null +++ b/tasks/agg-p19-n02/tests/expected.json @@ -0,0 +1 @@ +[37, 41] diff --git a/tasks/agg-p19-n02/tests/test.sh b/tasks/agg-p19-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p19-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-p19-n04/instruction.md b/tasks/agg-p19-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p19-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-p19-n04/solution/solve.sh b/tasks/agg-p19-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..f0c93b11c043d49e0b595bf3c614f19da5a86a20 --- /dev/null +++ b/tasks/agg-p19-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 '[37, 41, 62, 88]' > "$answer" diff --git a/tasks/agg-p19-n04/task.toml b/tasks/agg-p19-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..dbd56bb38791624c10754f9291fbbdc689e7ab3b --- /dev/null +++ b/tasks/agg-p19-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p19-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 = 19 +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-p19-n04/tests/expected.json b/tasks/agg-p19-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..6da4199c84b6a922920bd159f6b5b35dd3824b3c --- /dev/null +++ b/tasks/agg-p19-n04/tests/expected.json @@ -0,0 +1 @@ +[37, 41, 62, 88] diff --git a/tasks/agg-p19-n04/tests/test.sh b/tasks/agg-p19-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p19-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-p19-n08/instruction.md b/tasks/agg-p19-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p19-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-p19-n08/solution/solve.sh b/tasks/agg-p19-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..61f91f1988955fe28050a47faf35d774b6cea963 --- /dev/null +++ b/tasks/agg-p19-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 '[10, 34, 37, 41, 62, 65, 69, 88]' > "$answer" diff --git a/tasks/agg-p19-n08/task.toml b/tasks/agg-p19-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..ac710deea935a84a086e26961acb7cd69ddd3c80 --- /dev/null +++ b/tasks/agg-p19-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p19-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 = 19 +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-p19-n08/tests/expected.json b/tasks/agg-p19-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..8196bb9b6cbdd3032cf8adcb205e973c8b085532 --- /dev/null +++ b/tasks/agg-p19-n08/tests/expected.json @@ -0,0 +1 @@ +[10, 34, 37, 41, 62, 65, 69, 88] diff --git a/tasks/agg-p19-n08/tests/test.sh b/tasks/agg-p19-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p19-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-p19-n16/instruction.md b/tasks/agg-p19-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p19-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-p19-n16/solution/solve.sh b/tasks/agg-p19-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..e9871931f9549d83e32f4344947d5d0a7ecefdc1 --- /dev/null +++ b/tasks/agg-p19-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 '[10, 22, 29, 34, 35, 37, 41, 62, 65, 67, 69, 71, 81, 87, 88, 98]' > "$answer" diff --git a/tasks/agg-p19-n16/task.toml b/tasks/agg-p19-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..cc7923f5ead6bb56d7a0808fb95aa281d536e3fd --- /dev/null +++ b/tasks/agg-p19-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p19-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 = 19 +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-p19-n16/tests/expected.json b/tasks/agg-p19-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..ce271548b24dd60bfe9f0ef3839ca5ab9dba6b58 --- /dev/null +++ b/tasks/agg-p19-n16/tests/expected.json @@ -0,0 +1 @@ +[10, 22, 29, 34, 35, 37, 41, 62, 65, 67, 69, 71, 81, 87, 88, 98] diff --git a/tasks/agg-p19-n16/tests/test.sh b/tasks/agg-p19-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p19-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-p20-n01/instruction.md b/tasks/agg-p20-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p20-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-p20-n01/solution/solve.sh b/tasks/agg-p20-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..b8c081ff499401b791fe74ad4e1ff8eb542cd736 --- /dev/null +++ b/tasks/agg-p20-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 '[44]' > "$answer" diff --git a/tasks/agg-p20-n01/task.toml b/tasks/agg-p20-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..aecddbf598552fa97fc002e2eead8c869bcad532 --- /dev/null +++ b/tasks/agg-p20-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p20-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 = 20 +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-p20-n01/tests/expected.json b/tasks/agg-p20-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..234574a521c76bf3036a43a5e210861d4ed0bff2 --- /dev/null +++ b/tasks/agg-p20-n01/tests/expected.json @@ -0,0 +1 @@ +[44] diff --git a/tasks/agg-p20-n01/tests/test.sh b/tasks/agg-p20-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p20-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-p20-n02/instruction.md b/tasks/agg-p20-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p20-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-p20-n02/solution/solve.sh b/tasks/agg-p20-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..df6c8d1b7daf8143557e8c3ede6218b48c198d48 --- /dev/null +++ b/tasks/agg-p20-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 '[44, 73]' > "$answer" diff --git a/tasks/agg-p20-n02/task.toml b/tasks/agg-p20-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..854ef5c50896189a3895b7b6752b66bd772de522 --- /dev/null +++ b/tasks/agg-p20-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p20-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 = 20 +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-p20-n02/tests/expected.json b/tasks/agg-p20-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..6fc1289cc8d62f8a6071b4b7b12eb59d15b3fc61 --- /dev/null +++ b/tasks/agg-p20-n02/tests/expected.json @@ -0,0 +1 @@ +[44, 73] diff --git a/tasks/agg-p20-n02/tests/test.sh b/tasks/agg-p20-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p20-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-p20-n04/instruction.md b/tasks/agg-p20-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p20-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-p20-n04/solution/solve.sh b/tasks/agg-p20-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..1376a20065e4be990679e60dd5bed6815f0f277d --- /dev/null +++ b/tasks/agg-p20-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 '[44, 45, 73, 74]' > "$answer" diff --git a/tasks/agg-p20-n04/task.toml b/tasks/agg-p20-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..c1485cf8f3405d92896fac60ab4da8ca5e77c45a --- /dev/null +++ b/tasks/agg-p20-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p20-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 = 20 +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-p20-n04/tests/expected.json b/tasks/agg-p20-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..00f5e212afb28f87e0cf4eedde1dc99cd84dddcc --- /dev/null +++ b/tasks/agg-p20-n04/tests/expected.json @@ -0,0 +1 @@ +[44, 45, 73, 74] diff --git a/tasks/agg-p20-n04/tests/test.sh b/tasks/agg-p20-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p20-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-p20-n08/instruction.md b/tasks/agg-p20-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p20-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-p20-n08/solution/solve.sh b/tasks/agg-p20-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..c4f7621f8c15a2cd9506df91cf7df09ddde6e85e --- /dev/null +++ b/tasks/agg-p20-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 '[44, 45, 58, 73, 73, 74, 81, 97]' > "$answer" diff --git a/tasks/agg-p20-n08/task.toml b/tasks/agg-p20-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..5aefbc8f9dedaea880162d870c5131a682706144 --- /dev/null +++ b/tasks/agg-p20-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p20-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 = 20 +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-p20-n08/tests/expected.json b/tasks/agg-p20-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..f2a8c80f27af2ddb7c8cd16b05a0d731180206e5 --- /dev/null +++ b/tasks/agg-p20-n08/tests/expected.json @@ -0,0 +1 @@ +[44, 45, 58, 73, 73, 74, 81, 97] diff --git a/tasks/agg-p20-n08/tests/test.sh b/tasks/agg-p20-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p20-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-p20-n16/instruction.md b/tasks/agg-p20-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p20-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-p20-n16/solution/solve.sh b/tasks/agg-p20-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..f5fc1a2f76d61d757c09357923b2e92bd28a344a --- /dev/null +++ b/tasks/agg-p20-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, 29, 31, 44, 45, 49, 58, 61, 65, 68, 73, 73, 74, 81, 96, 97]' > "$answer" diff --git a/tasks/agg-p20-n16/task.toml b/tasks/agg-p20-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..45e2cbd5cc83cc3eb3599263f6b16c10b09027a4 --- /dev/null +++ b/tasks/agg-p20-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p20-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 = 20 +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-p20-n16/tests/expected.json b/tasks/agg-p20-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..23f209e121f6397c1e9e65962c7d6360938c6ec0 --- /dev/null +++ b/tasks/agg-p20-n16/tests/expected.json @@ -0,0 +1 @@ +[5, 29, 31, 44, 45, 49, 58, 61, 65, 68, 73, 73, 74, 81, 96, 97] diff --git a/tasks/agg-p20-n16/tests/test.sh b/tasks/agg-p20-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p20-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-p21-n01/instruction.md b/tasks/agg-p21-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p21-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-p21-n01/solution/solve.sh b/tasks/agg-p21-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..5c8e655ed2203947c477c4d0348cfb9bfe3b5978 --- /dev/null +++ b/tasks/agg-p21-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 '[57]' > "$answer" diff --git a/tasks/agg-p21-n01/task.toml b/tasks/agg-p21-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..a0b91c0f39053c7c8c736b252e29f46dd5fe14cf --- /dev/null +++ b/tasks/agg-p21-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p21-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 = 21 +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-p21-n01/tests/expected.json b/tasks/agg-p21-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..b1d2187cc59a7b37b5a22f781b6f7ff776a599b3 --- /dev/null +++ b/tasks/agg-p21-n01/tests/expected.json @@ -0,0 +1 @@ +[57] diff --git a/tasks/agg-p21-n01/tests/test.sh b/tasks/agg-p21-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p21-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-p21-n02/instruction.md b/tasks/agg-p21-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p21-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-p21-n02/solution/solve.sh b/tasks/agg-p21-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..a064cf783d368e71fd3601ddda276390e128d024 --- /dev/null +++ b/tasks/agg-p21-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 '[34, 57]' > "$answer" diff --git a/tasks/agg-p21-n02/task.toml b/tasks/agg-p21-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..917f4ae5c9d05b2cab98a9eec0532730455f71c7 --- /dev/null +++ b/tasks/agg-p21-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p21-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 = 21 +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-p21-n02/tests/expected.json b/tasks/agg-p21-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..bb1f0f29b6ae94def66eb8c250f5c8b921694ef1 --- /dev/null +++ b/tasks/agg-p21-n02/tests/expected.json @@ -0,0 +1 @@ +[34, 57] diff --git a/tasks/agg-p21-n02/tests/test.sh b/tasks/agg-p21-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p21-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-p21-n04/instruction.md b/tasks/agg-p21-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p21-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-p21-n04/solution/solve.sh b/tasks/agg-p21-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..0fb4cc1219d0354f8003972792ac24f9eb7cb67f --- /dev/null +++ b/tasks/agg-p21-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 '[34, 57, 68, 71]' > "$answer" diff --git a/tasks/agg-p21-n04/task.toml b/tasks/agg-p21-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..e3fff51496824ca8e3420ae854498e19b6e65cb7 --- /dev/null +++ b/tasks/agg-p21-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p21-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 = 21 +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-p21-n04/tests/expected.json b/tasks/agg-p21-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..5122ac9f1381ac5861f54789b934f646147e387c --- /dev/null +++ b/tasks/agg-p21-n04/tests/expected.json @@ -0,0 +1 @@ +[34, 57, 68, 71] diff --git a/tasks/agg-p21-n04/tests/test.sh b/tasks/agg-p21-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p21-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-p21-n08/instruction.md b/tasks/agg-p21-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p21-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-p21-n08/solution/solve.sh b/tasks/agg-p21-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..2d248511e8e18f4303ffaf62a4e842ee8009d0f4 --- /dev/null +++ b/tasks/agg-p21-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 '[19, 34, 57, 68, 71, 73, 82, 99]' > "$answer" diff --git a/tasks/agg-p21-n08/task.toml b/tasks/agg-p21-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..05c03fa149495780620131cf1c75e04cabd3be42 --- /dev/null +++ b/tasks/agg-p21-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p21-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 = 21 +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-p21-n08/tests/expected.json b/tasks/agg-p21-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..34f3c8391001a2e074928abab40890c0b913f0a6 --- /dev/null +++ b/tasks/agg-p21-n08/tests/expected.json @@ -0,0 +1 @@ +[19, 34, 57, 68, 71, 73, 82, 99] diff --git a/tasks/agg-p21-n08/tests/test.sh b/tasks/agg-p21-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p21-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-p21-n16/instruction.md b/tasks/agg-p21-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p21-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-p21-n16/solution/solve.sh b/tasks/agg-p21-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..7f4ccbce3539202aba287af11a5be661e4969ecc --- /dev/null +++ b/tasks/agg-p21-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 '[16, 18, 19, 34, 39, 43, 50, 57, 64, 68, 71, 72, 73, 76, 82, 99]' > "$answer" diff --git a/tasks/agg-p21-n16/task.toml b/tasks/agg-p21-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..db36a13edc2ebee808b3b8a8ebe2771e01caaf07 --- /dev/null +++ b/tasks/agg-p21-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p21-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 = 21 +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-p21-n16/tests/expected.json b/tasks/agg-p21-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..533835f6e0e7367a0af113b7c253618a767f455e --- /dev/null +++ b/tasks/agg-p21-n16/tests/expected.json @@ -0,0 +1 @@ +[16, 18, 19, 34, 39, 43, 50, 57, 64, 68, 71, 72, 73, 76, 82, 99] diff --git a/tasks/agg-p21-n16/tests/test.sh b/tasks/agg-p21-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p21-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-p22-n01/instruction.md b/tasks/agg-p22-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p22-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-p22-n01/solution/solve.sh b/tasks/agg-p22-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..853317964c50fc67ee02a4fe3b7320f0b84d12ae --- /dev/null +++ b/tasks/agg-p22-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 '[4]' > "$answer" diff --git a/tasks/agg-p22-n01/task.toml b/tasks/agg-p22-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..070d95d9145105745a4aef8f10b397eda54da360 --- /dev/null +++ b/tasks/agg-p22-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p22-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 = 22 +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-p22-n01/tests/expected.json b/tasks/agg-p22-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..8674624b1da890d26137278915b59789d00d7d63 --- /dev/null +++ b/tasks/agg-p22-n01/tests/expected.json @@ -0,0 +1 @@ +[4] diff --git a/tasks/agg-p22-n01/tests/test.sh b/tasks/agg-p22-n01/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p22-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-p22-n02/instruction.md b/tasks/agg-p22-n02/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..72eb9c530b6f2ba12d77a8c2812b9b9eb7977768 --- /dev/null +++ b/tasks/agg-p22-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-p22-n02/solution/solve.sh b/tasks/agg-p22-n02/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..966f818a034e90c7d9c61c0621ed5f0f7e62613c --- /dev/null +++ b/tasks/agg-p22-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 '[4, 41]' > "$answer" diff --git a/tasks/agg-p22-n02/task.toml b/tasks/agg-p22-n02/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..33806314e2e3b57f3000b490702669313aba0e0a --- /dev/null +++ b/tasks/agg-p22-n02/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p22-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 = 22 +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-p22-n02/tests/expected.json b/tasks/agg-p22-n02/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..438c60d09ab99e682fdf6aced3680e01fb3e5499 --- /dev/null +++ b/tasks/agg-p22-n02/tests/expected.json @@ -0,0 +1 @@ +[4, 41] diff --git a/tasks/agg-p22-n02/tests/test.sh b/tasks/agg-p22-n02/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p22-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-p22-n04/instruction.md b/tasks/agg-p22-n04/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..146fdff474b9b34bad1f34dbeeb494372fb8259a --- /dev/null +++ b/tasks/agg-p22-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-p22-n04/solution/solve.sh b/tasks/agg-p22-n04/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..cac423f076a2edf4e30ac4fc07acf8afd7eb97d3 --- /dev/null +++ b/tasks/agg-p22-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, 41, 71, 89]' > "$answer" diff --git a/tasks/agg-p22-n04/task.toml b/tasks/agg-p22-n04/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..9ed4a25f0ec199ef64c3dec1c8ba8838b8c5cb09 --- /dev/null +++ b/tasks/agg-p22-n04/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p22-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 = 22 +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-p22-n04/tests/expected.json b/tasks/agg-p22-n04/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..eb337229f59af8bd3a02f8e875cfdf35820f5dc3 --- /dev/null +++ b/tasks/agg-p22-n04/tests/expected.json @@ -0,0 +1 @@ +[4, 41, 71, 89] diff --git a/tasks/agg-p22-n04/tests/test.sh b/tasks/agg-p22-n04/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p22-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-p22-n08/instruction.md b/tasks/agg-p22-n08/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..b2b2e4132a6c998bd48269430ff331dd0438b0d2 --- /dev/null +++ b/tasks/agg-p22-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-p22-n08/solution/solve.sh b/tasks/agg-p22-n08/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..64310bb3a5c29930bd810439e0c4466127aea16b --- /dev/null +++ b/tasks/agg-p22-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 '[4, 5, 15, 23, 27, 41, 71, 89]' > "$answer" diff --git a/tasks/agg-p22-n08/task.toml b/tasks/agg-p22-n08/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..2a4f4adbc1c2ee556725c501adcc646cd7bb4bef --- /dev/null +++ b/tasks/agg-p22-n08/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p22-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 = 22 +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-p22-n08/tests/expected.json b/tasks/agg-p22-n08/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..06878fbccf036f69312741fd8898229d6b5f331e --- /dev/null +++ b/tasks/agg-p22-n08/tests/expected.json @@ -0,0 +1 @@ +[4, 5, 15, 23, 27, 41, 71, 89] diff --git a/tasks/agg-p22-n08/tests/test.sh b/tasks/agg-p22-n08/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p22-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-p22-n16/instruction.md b/tasks/agg-p22-n16/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..c122876f04899ebaafa6b513a65f78faaf758e06 --- /dev/null +++ b/tasks/agg-p22-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-p22-n16/solution/solve.sh b/tasks/agg-p22-n16/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..5326bdac27d4f50f8f0bb54a72794de6737875ed --- /dev/null +++ b/tasks/agg-p22-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 '[4, 5, 8, 10, 15, 22, 23, 27, 31, 41, 71, 74, 76, 77, 88, 89]' > "$answer" diff --git a/tasks/agg-p22-n16/task.toml b/tasks/agg-p22-n16/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..263ee558e4900e2c5a65c50267ccb7055af750aa --- /dev/null +++ b/tasks/agg-p22-n16/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p22-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 = 22 +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-p22-n16/tests/expected.json b/tasks/agg-p22-n16/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..f1dfffe1d49a531609287e8177f9b5056d207c36 --- /dev/null +++ b/tasks/agg-p22-n16/tests/expected.json @@ -0,0 +1 @@ +[4, 5, 8, 10, 15, 22, 23, 27, 31, 41, 71, 74, 76, 77, 88, 89] diff --git a/tasks/agg-p22-n16/tests/test.sh b/tasks/agg-p22-n16/tests/test.sh new file mode 100644 index 0000000000000000000000000000000000000000..959e3003ae6066225a8e78257c1f2ef77ecc8aba --- /dev/null +++ b/tasks/agg-p22-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-p23-n01/instruction.md b/tasks/agg-p23-n01/instruction.md new file mode 100644 index 0000000000000000000000000000000000000000..79363c15a11bbf7dd873ec42e9bcbfe67e0a0d08 --- /dev/null +++ b/tasks/agg-p23-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-p23-n01/solution/solve.sh b/tasks/agg-p23-n01/solution/solve.sh new file mode 100644 index 0000000000000000000000000000000000000000..634de106b1c3454ddd0dffcbaee1c022f7709864 --- /dev/null +++ b/tasks/agg-p23-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 '[20]' > "$answer" diff --git a/tasks/agg-p23-n01/task.toml b/tasks/agg-p23-n01/task.toml new file mode 100644 index 0000000000000000000000000000000000000000..65701c45a12f4c8392bfc6444e8ea7e58386bf01 --- /dev/null +++ b/tasks/agg-p23-n01/task.toml @@ -0,0 +1,26 @@ +schema_version = "1.4" + +[task] +name = "HuggingFaceSwarms/agg-p23-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 = 23 +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-p23-n01/tests/expected.json b/tasks/agg-p23-n01/tests/expected.json new file mode 100644 index 0000000000000000000000000000000000000000..2f6e7a62404fd23a99bd593d54371ad0e99eab90 --- /dev/null +++ b/tasks/agg-p23-n01/tests/expected.json @@ -0,0 +1 @@ +[20]