One task per slot (agg-pPP-nNN-sKK) whose instruction states its number; no resources/ (Flock's selector gives each agent its own task) (part 8)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- tasks/agg-p15-n02-s02/tests/test.shAdded+89
- tasks/agg-p15-n04-s01/instruction.mdAdded+21
- tasks/agg-p15-n04-s01/solution/solve.shAdded+5
- tasks/agg-p15-n04-s01/task.tomlAdded+27
- tasks/agg-p15-n04-s01/tests/expected.jsonAdded+1
- tasks/agg-p15-n04-s01/tests/test.shAdded+89
- tasks/agg-p15-n04-s02/instruction.mdAdded+21
- tasks/agg-p15-n04-s02/solution/solve.shAdded+5
- tasks/agg-p15-n04-s02/task.tomlAdded+27
- tasks/agg-p15-n04-s02/tests/expected.jsonAdded+1
- tasks/agg-p15-n04-s02/tests/test.shAdded+89
- tasks/agg-p15-n04-s03/instruction.mdAdded+21
- tasks/agg-p15-n04-s03/solution/solve.shAdded+5
- tasks/agg-p15-n04-s03/task.tomlAdded+27
- tasks/agg-p15-n04-s03/tests/expected.jsonAdded+1
- tasks/agg-p15-n04-s03/tests/test.shAdded+89
- tasks/agg-p15-n04-s04/instruction.mdAdded+21
- tasks/agg-p15-n04-s04/solution/solve.shAdded+5
- tasks/agg-p15-n04-s04/task.tomlAdded+27
- tasks/agg-p15-n04-s04/tests/expected.jsonAdded+1
- tasks/agg-p15-n04-s04/tests/test.shAdded+89
- tasks/agg-p15-n08-s01/instruction.mdAdded+21
- tasks/agg-p15-n08-s01/solution/solve.shAdded+5
- tasks/agg-p15-n08-s01/task.tomlAdded+27
- tasks/agg-p15-n08-s01/tests/expected.jsonAdded+1
- tasks/agg-p15-n08-s01/tests/test.shAdded+89
- tasks/agg-p15-n08-s02/instruction.mdAdded+21
- tasks/agg-p15-n08-s02/solution/solve.shAdded+5
- tasks/agg-p15-n08-s02/task.tomlAdded+27
- tasks/agg-p15-n08-s02/tests/expected.jsonAdded+1
- tasks/agg-p15-n08-s02/tests/test.shAdded+89
- tasks/agg-p15-n08-s03/instruction.mdAdded+21
- tasks/agg-p15-n08-s03/solution/solve.shAdded+5
- tasks/agg-p15-n08-s03/task.tomlAdded+27
- tasks/agg-p15-n08-s03/tests/expected.jsonAdded+1
- tasks/agg-p15-n08-s03/tests/test.shAdded+89
- tasks/agg-p15-n08-s04/instruction.mdAdded+21
- tasks/agg-p15-n08-s04/solution/solve.shAdded+5
- tasks/agg-p15-n08-s04/task.tomlAdded+27
- tasks/agg-p15-n08-s04/tests/expected.jsonAdded+1
- tasks/agg-p15-n08-s04/tests/test.shAdded+89
- tasks/agg-p15-n08-s05/instruction.mdAdded+21
- tasks/agg-p15-n08-s05/solution/solve.shAdded+5
- tasks/agg-p15-n08-s05/task.tomlAdded+27
- tasks/agg-p15-n08-s05/tests/expected.jsonAdded+1
- tasks/agg-p15-n08-s05/tests/test.shAdded+89
- tasks/agg-p15-n08-s06/instruction.mdAdded+21
- tasks/agg-p15-n08-s06/solution/solve.shAdded+5
- tasks/agg-p15-n08-s06/task.tomlAdded+27
- tasks/agg-p15-n08-s06/tests/expected.jsonAdded+1
1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/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 answer counts only as a regular file of its own at exactly that path: a symlink (e.g. to# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat
LIMIT = 1 << 20 # bytes
def read_own(path): # The bytes of the regular file at exactly `path`: every folder on the way is opened # without following a link, and so is the file (a FIFO cannot block it); one link only. parts = os.path.abspath(path).split("/")[1:] folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, "rb") as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError("not a regular file of its own") data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError("too large") return data
def write_new(path, text): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, "w") as stream: stream.write(text)
def reject_constant(name): raise ValueError(f"{name} is not JSON")
def parse(data): return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
verifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a link try: os.unlink(os.path.join(verifier, name)) except FileNotFoundError: passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry: data = read_own(os.environ["ANSWER"]) write_new(os.path.join(verifier, "answer.json"), data.decode("utf-8", "replace")) answer, expected = parse(data), parse(read_own(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, a link, not regular, invalid UTF-8 or JSON, NaN, RecursionError valid = Falseif valid: write_new(os.path.join(verifier, "reward.txt"), "1")print("reward:", 1 if valid else 0)PY123456789101112131415161718192021# Sort the team's private numbers
You are on a team of 4 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. You know only your ownnumber, and the others don't know it unless you tell them.
Your private number is thirty-seven.
The team must find all 4 numbers and list their numeric values in ascending order. Keep equalnumbers 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 iscorrect. Your instructions name the other participants and explain the board's tools.12345#!/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"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p15-n04-s01"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 = 15agents = 4slot = 1seed = 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: the slot's number is only in its instruction,# and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 1024
[verifier]timeout_sec = 601[18, 29, 37, 57]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/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 answer counts only as a regular file of its own at exactly that path: a symlink (e.g. to# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat
LIMIT = 1 << 20 # bytes
def read_own(path): # The bytes of the regular file at exactly `path`: every folder on the way is opened # without following a link, and so is the file (a FIFO cannot block it); one link only. parts = os.path.abspath(path).split("/")[1:] folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, "rb") as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError("not a regular file of its own") data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError("too large") return data
def write_new(path, text): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, "w") as stream: stream.write(text)
def reject_constant(name): raise ValueError(f"{name} is not JSON")
def parse(data): return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
verifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a link try: os.unlink(os.path.join(verifier, name)) except FileNotFoundError: passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry: data = read_own(os.environ["ANSWER"]) write_new(os.path.join(verifier, "answer.json"), data.decode("utf-8", "replace")) answer, expected = parse(data), parse(read_own(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, a link, not regular, invalid UTF-8 or JSON, NaN, RecursionError valid = Falseif valid: write_new(os.path.join(verifier, "reward.txt"), "1")print("reward:", 1 if valid else 0)PY123456789101112131415161718192021# Sort the team's private numbers
You are on a team of 4 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. You know only your ownnumber, and the others don't know it unless you tell them.
Your private number is twenty-nine.
The team must find all 4 numbers and list their numeric values in ascending order. Keep equalnumbers 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 iscorrect. Your instructions name the other participants and explain the board's tools.12345#!/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"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p15-n04-s02"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 = 15agents = 4slot = 2seed = 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: the slot's number is only in its instruction,# and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 1024
[verifier]timeout_sec = 601[18, 29, 37, 57]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/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 answer counts only as a regular file of its own at exactly that path: a symlink (e.g. to# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat
LIMIT = 1 << 20 # bytes
def read_own(path): # The bytes of the regular file at exactly `path`: every folder on the way is opened # without following a link, and so is the file (a FIFO cannot block it); one link only. parts = os.path.abspath(path).split("/")[1:] folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, "rb") as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError("not a regular file of its own") data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError("too large") return data
def write_new(path, text): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, "w") as stream: stream.write(text)
def reject_constant(name): raise ValueError(f"{name} is not JSON")
def parse(data): return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
verifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a link try: os.unlink(os.path.join(verifier, name)) except FileNotFoundError: passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry: data = read_own(os.environ["ANSWER"]) write_new(os.path.join(verifier, "answer.json"), data.decode("utf-8", "replace")) answer, expected = parse(data), parse(read_own(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, a link, not regular, invalid UTF-8 or JSON, NaN, RecursionError valid = Falseif valid: write_new(os.path.join(verifier, "reward.txt"), "1")print("reward:", 1 if valid else 0)PY123456789101112131415161718192021# Sort the team's private numbers
You are on a team of 4 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. You know only your ownnumber, and the others don't know it unless you tell them.
Your private number is fifty-seven.
The team must find all 4 numbers and list their numeric values in ascending order. Keep equalnumbers 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 iscorrect. Your instructions name the other participants and explain the board's tools.12345#!/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"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p15-n04-s03"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 = 15agents = 4slot = 3seed = 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: the slot's number is only in its instruction,# and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 1024
[verifier]timeout_sec = 601[18, 29, 37, 57]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/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 answer counts only as a regular file of its own at exactly that path: a symlink (e.g. to# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat
LIMIT = 1 << 20 # bytes
def read_own(path): # The bytes of the regular file at exactly `path`: every folder on the way is opened # without following a link, and so is the file (a FIFO cannot block it); one link only. parts = os.path.abspath(path).split("/")[1:] folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, "rb") as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError("not a regular file of its own") data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError("too large") return data
def write_new(path, text): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, "w") as stream: stream.write(text)
def reject_constant(name): raise ValueError(f"{name} is not JSON")
def parse(data): return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
verifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a link try: os.unlink(os.path.join(verifier, name)) except FileNotFoundError: passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry: data = read_own(os.environ["ANSWER"]) write_new(os.path.join(verifier, "answer.json"), data.decode("utf-8", "replace")) answer, expected = parse(data), parse(read_own(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, a link, not regular, invalid UTF-8 or JSON, NaN, RecursionError valid = Falseif valid: write_new(os.path.join(verifier, "reward.txt"), "1")print("reward:", 1 if valid else 0)PY123456789101112131415161718192021# Sort the team's private numbers
You are on a team of 4 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. You know only your ownnumber, and the others don't know it unless you tell them.
Your private number is eighteen.
The team must find all 4 numbers and list their numeric values in ascending order. Keep equalnumbers 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 iscorrect. Your instructions name the other participants and explain the board's tools.12345#!/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"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p15-n04-s04"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 = 15agents = 4slot = 4seed = 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: the slot's number is only in its instruction,# and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 1024
[verifier]timeout_sec = 601[18, 29, 37, 57]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/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 answer counts only as a regular file of its own at exactly that path: a symlink (e.g. to# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat
LIMIT = 1 << 20 # bytes
def read_own(path): # The bytes of the regular file at exactly `path`: every folder on the way is opened # without following a link, and so is the file (a FIFO cannot block it); one link only. parts = os.path.abspath(path).split("/")[1:] folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, "rb") as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError("not a regular file of its own") data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError("too large") return data
def write_new(path, text): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, "w") as stream: stream.write(text)
def reject_constant(name): raise ValueError(f"{name} is not JSON")
def parse(data): return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
verifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a link try: os.unlink(os.path.join(verifier, name)) except FileNotFoundError: passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry: data = read_own(os.environ["ANSWER"]) write_new(os.path.join(verifier, "answer.json"), data.decode("utf-8", "replace")) answer, expected = parse(data), parse(read_own(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, a link, not regular, invalid UTF-8 or JSON, NaN, RecursionError valid = Falseif valid: write_new(os.path.join(verifier, "reward.txt"), "1")print("reward:", 1 if valid else 0)PY123456789101112131415161718192021# Sort the team's private numbers
You are on a team of 8 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. You know only your ownnumber, and the others don't know it unless you tell them.
Your private number is thirty-seven.
The team must find all 8 numbers and list their numeric values in ascending order. Keep equalnumbers 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 iscorrect. Your instructions name the other participants and explain the board's tools.12345#!/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"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p15-n08-s01"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 = 15agents = 8slot = 1seed = 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: the slot's number is only in its instruction,# and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 1024
[verifier]timeout_sec = 601[18, 29, 37, 49, 50, 57, 62, 79]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/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 answer counts only as a regular file of its own at exactly that path: a symlink (e.g. to# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat
LIMIT = 1 << 20 # bytes
def read_own(path): # The bytes of the regular file at exactly `path`: every folder on the way is opened # without following a link, and so is the file (a FIFO cannot block it); one link only. parts = os.path.abspath(path).split("/")[1:] folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, "rb") as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError("not a regular file of its own") data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError("too large") return data
def write_new(path, text): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, "w") as stream: stream.write(text)
def reject_constant(name): raise ValueError(f"{name} is not JSON")
def parse(data): return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
verifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a link try: os.unlink(os.path.join(verifier, name)) except FileNotFoundError: passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry: data = read_own(os.environ["ANSWER"]) write_new(os.path.join(verifier, "answer.json"), data.decode("utf-8", "replace")) answer, expected = parse(data), parse(read_own(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, a link, not regular, invalid UTF-8 or JSON, NaN, RecursionError valid = Falseif valid: write_new(os.path.join(verifier, "reward.txt"), "1")print("reward:", 1 if valid else 0)PY123456789101112131415161718192021# Sort the team's private numbers
You are on a team of 8 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. You know only your ownnumber, and the others don't know it unless you tell them.
Your private number is twenty-nine.
The team must find all 8 numbers and list their numeric values in ascending order. Keep equalnumbers 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 iscorrect. Your instructions name the other participants and explain the board's tools.12345#!/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"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p15-n08-s02"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 = 15agents = 8slot = 2seed = 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: the slot's number is only in its instruction,# and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 1024
[verifier]timeout_sec = 601[18, 29, 37, 49, 50, 57, 62, 79]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/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 answer counts only as a regular file of its own at exactly that path: a symlink (e.g. to# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat
LIMIT = 1 << 20 # bytes
def read_own(path): # The bytes of the regular file at exactly `path`: every folder on the way is opened # without following a link, and so is the file (a FIFO cannot block it); one link only. parts = os.path.abspath(path).split("/")[1:] folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, "rb") as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError("not a regular file of its own") data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError("too large") return data
def write_new(path, text): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, "w") as stream: stream.write(text)
def reject_constant(name): raise ValueError(f"{name} is not JSON")
def parse(data): return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
verifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a link try: os.unlink(os.path.join(verifier, name)) except FileNotFoundError: passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry: data = read_own(os.environ["ANSWER"]) write_new(os.path.join(verifier, "answer.json"), data.decode("utf-8", "replace")) answer, expected = parse(data), parse(read_own(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, a link, not regular, invalid UTF-8 or JSON, NaN, RecursionError valid = Falseif valid: write_new(os.path.join(verifier, "reward.txt"), "1")print("reward:", 1 if valid else 0)PY123456789101112131415161718192021# Sort the team's private numbers
You are on a team of 8 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. You know only your ownnumber, and the others don't know it unless you tell them.
Your private number is fifty-seven.
The team must find all 8 numbers and list their numeric values in ascending order. Keep equalnumbers 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 iscorrect. Your instructions name the other participants and explain the board's tools.12345#!/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"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p15-n08-s03"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 = 15agents = 8slot = 3seed = 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: the slot's number is only in its instruction,# and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 1024
[verifier]timeout_sec = 601[18, 29, 37, 49, 50, 57, 62, 79]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/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 answer counts only as a regular file of its own at exactly that path: a symlink (e.g. to# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat
LIMIT = 1 << 20 # bytes
def read_own(path): # The bytes of the regular file at exactly `path`: every folder on the way is opened # without following a link, and so is the file (a FIFO cannot block it); one link only. parts = os.path.abspath(path).split("/")[1:] folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, "rb") as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError("not a regular file of its own") data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError("too large") return data
def write_new(path, text): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, "w") as stream: stream.write(text)
def reject_constant(name): raise ValueError(f"{name} is not JSON")
def parse(data): return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
verifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a link try: os.unlink(os.path.join(verifier, name)) except FileNotFoundError: passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry: data = read_own(os.environ["ANSWER"]) write_new(os.path.join(verifier, "answer.json"), data.decode("utf-8", "replace")) answer, expected = parse(data), parse(read_own(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, a link, not regular, invalid UTF-8 or JSON, NaN, RecursionError valid = Falseif valid: write_new(os.path.join(verifier, "reward.txt"), "1")print("reward:", 1 if valid else 0)PY123456789101112131415161718192021# Sort the team's private numbers
You are on a team of 8 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. You know only your ownnumber, and the others don't know it unless you tell them.
Your private number is eighteen.
The team must find all 8 numbers and list their numeric values in ascending order. Keep equalnumbers 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 iscorrect. Your instructions name the other participants and explain the board's tools.12345#!/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"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p15-n08-s04"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 = 15agents = 8slot = 4seed = 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: the slot's number is only in its instruction,# and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 1024
[verifier]timeout_sec = 601[18, 29, 37, 49, 50, 57, 62, 79]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/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 answer counts only as a regular file of its own at exactly that path: a symlink (e.g. to# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat
LIMIT = 1 << 20 # bytes
def read_own(path): # The bytes of the regular file at exactly `path`: every folder on the way is opened # without following a link, and so is the file (a FIFO cannot block it); one link only. parts = os.path.abspath(path).split("/")[1:] folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, "rb") as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError("not a regular file of its own") data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError("too large") return data
def write_new(path, text): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, "w") as stream: stream.write(text)
def reject_constant(name): raise ValueError(f"{name} is not JSON")
def parse(data): return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
verifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a link try: os.unlink(os.path.join(verifier, name)) except FileNotFoundError: passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry: data = read_own(os.environ["ANSWER"]) write_new(os.path.join(verifier, "answer.json"), data.decode("utf-8", "replace")) answer, expected = parse(data), parse(read_own(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, a link, not regular, invalid UTF-8 or JSON, NaN, RecursionError valid = Falseif valid: write_new(os.path.join(verifier, "reward.txt"), "1")print("reward:", 1 if valid else 0)PY123456789101112131415161718192021# Sort the team's private numbers
You are on a team of 8 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. You know only your ownnumber, and the others don't know it unless you tell them.
Your private number is forty-nine.
The team must find all 8 numbers and list their numeric values in ascending order. Keep equalnumbers 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 iscorrect. Your instructions name the other participants and explain the board's tools.12345#!/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"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p15-n08-s05"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 = 15agents = 8slot = 5seed = 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: the slot's number is only in its instruction,# and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 1024
[verifier]timeout_sec = 601[18, 29, 37, 49, 50, 57, 62, 79]1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889#!/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 answer counts only as a regular file of its own at exactly that path: a symlink (e.g. to# /tests/expected.json, which arrives only now), a link anywhere on the path (a symlinked /app),# a hardlink, a directory or a FIFO scores 0; expected.json is read the same way. Nothing here# follows a link the agent may have left, and 0 is written before anything is checked, so a crash# of the check also scores 0. A copy of the answer stays with the trial's results.# Python runs isolated (-I -S): no module from the working directory, PYTHON* variables, the# user's site or site-packages hooks (sitecustomize, usercustomize, .pth files) can replace what# it imports. Besides bash, python3 is the only command this script runs (no dirname, mkdir or# rm an agent could shadow on the PATH). ANSWER, EXPECTED and VERIFIER_DIR override the paths# (no links in them), to test the grader locally.case $0 in */*) here=${0%/*} ;; *) here=. ;; esacexport ANSWER=${ANSWER:-/app/answer.json}export EXPECTED=${EXPECTED:-$here/expected.json}export VERIFIER_DIR=${VERIFIER_DIR:-/logs/verifier}[ -d "$VERIFIER_DIR" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport osimport stat
LIMIT = 1 << 20 # bytes
def read_own(path): # The bytes of the regular file at exactly `path`: every folder on the way is opened # without following a link, and so is the file (a FIFO cannot block it); one link only. parts = os.path.abspath(path).split("/")[1:] folder = os.open("/", os.O_RDONLY | os.O_DIRECTORY) try: for part in parts[:-1]: inner = os.open(part, os.O_RDONLY | os.O_DIRECTORY | os.O_NOFOLLOW, dir_fd=folder) os.close(folder) folder = inner fd = os.open(parts[-1], os.O_RDONLY | os.O_NOFOLLOW | os.O_NONBLOCK, dir_fd=folder) finally: os.close(folder) with os.fdopen(fd, "rb") as stream: info = os.fstat(stream.fileno()) if not stat.S_ISREG(info.st_mode) or info.st_nlink != 1: raise ValueError("not a regular file of its own") data = stream.read(LIMIT + 1) if len(data) > LIMIT: raise ValueError("too large") return data
def write_new(path, text): fd = os.open(path, os.O_WRONLY | os.O_CREAT | os.O_TRUNC | os.O_NOFOLLOW, 0o644) with os.fdopen(fd, "w") as stream: stream.write(text)
def reject_constant(name): raise ValueError(f"{name} is not JSON")
def parse(data): return json.loads(data.decode("utf-8"), parse_constant=reject_constant)
verifier = os.environ["VERIFIER_DIR"]os.makedirs(verifier, exist_ok=True)for name in ("reward.txt", "reward.json", "answer.json"): # never written through a link try: os.unlink(os.path.join(verifier, name)) except FileNotFoundError: passwrite_new(os.path.join(verifier, "reward.txt"), "0")valid = Falsetry: data = read_own(os.environ["ANSWER"]) write_new(os.path.join(verifier, "answer.json"), data.decode("utf-8", "replace")) answer, expected = parse(data), parse(read_own(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, a link, not regular, invalid UTF-8 or JSON, NaN, RecursionError valid = Falseif valid: write_new(os.path.join(verifier, "reward.txt"), "1")print("reward:", 1 if valid else 0)PY123456789101112131415161718192021# Sort the team's private numbers
You are on a team of 8 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. You know only your ownnumber, and the others don't know it unless you tell them.
Your private number is seventy-nine.
The team must find all 8 numbers and list their numeric values in ascending order. Keep equalnumbers 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 iscorrect. Your instructions name the other participants and explain the board's tools.12345#!/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"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p15-n08-s06"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 = 15agents = 8slot = 6seed = 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: the slot's number is only in its instruction,# and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 1024
[verifier]timeout_sec = 601[18, 29, 37, 49, 50, 57, 62, 79]tasks/agg-p15-n02-s02/tests/test.shAdded+89
tasks/agg-p15-n04-s01/instruction.mdAdded+21
tasks/agg-p15-n04-s01/solution/solve.shAdded+5
tasks/agg-p15-n04-s01/task.tomlAdded+27
tasks/agg-p15-n04-s01/tests/expected.jsonAdded+1
tasks/agg-p15-n04-s01/tests/test.shAdded+89
tasks/agg-p15-n04-s02/instruction.mdAdded+21
tasks/agg-p15-n04-s02/solution/solve.shAdded+5
tasks/agg-p15-n04-s02/task.tomlAdded+27
tasks/agg-p15-n04-s02/tests/expected.jsonAdded+1
tasks/agg-p15-n04-s02/tests/test.shAdded+89
tasks/agg-p15-n04-s03/instruction.mdAdded+21
tasks/agg-p15-n04-s03/solution/solve.shAdded+5
tasks/agg-p15-n04-s03/task.tomlAdded+27
tasks/agg-p15-n04-s03/tests/expected.jsonAdded+1
tasks/agg-p15-n04-s03/tests/test.shAdded+89
tasks/agg-p15-n04-s04/instruction.mdAdded+21
tasks/agg-p15-n04-s04/solution/solve.shAdded+5
tasks/agg-p15-n04-s04/task.tomlAdded+27
tasks/agg-p15-n04-s04/tests/expected.jsonAdded+1
tasks/agg-p15-n04-s04/tests/test.shAdded+89
tasks/agg-p15-n08-s01/instruction.mdAdded+21
tasks/agg-p15-n08-s01/solution/solve.shAdded+5
tasks/agg-p15-n08-s01/task.tomlAdded+27
tasks/agg-p15-n08-s01/tests/expected.jsonAdded+1
tasks/agg-p15-n08-s01/tests/test.shAdded+89
tasks/agg-p15-n08-s02/instruction.mdAdded+21
tasks/agg-p15-n08-s02/solution/solve.shAdded+5
tasks/agg-p15-n08-s02/task.tomlAdded+27
tasks/agg-p15-n08-s02/tests/expected.jsonAdded+1
tasks/agg-p15-n08-s02/tests/test.shAdded+89
tasks/agg-p15-n08-s03/instruction.mdAdded+21
tasks/agg-p15-n08-s03/solution/solve.shAdded+5
tasks/agg-p15-n08-s03/task.tomlAdded+27
tasks/agg-p15-n08-s03/tests/expected.jsonAdded+1
tasks/agg-p15-n08-s03/tests/test.shAdded+89
tasks/agg-p15-n08-s04/instruction.mdAdded+21
tasks/agg-p15-n08-s04/solution/solve.shAdded+5
tasks/agg-p15-n08-s04/task.tomlAdded+27
tasks/agg-p15-n08-s04/tests/expected.jsonAdded+1
tasks/agg-p15-n08-s04/tests/test.shAdded+89
tasks/agg-p15-n08-s05/instruction.mdAdded+21
tasks/agg-p15-n08-s05/solution/solve.shAdded+5
tasks/agg-p15-n08-s05/task.tomlAdded+27
tasks/agg-p15-n08-s05/tests/expected.jsonAdded+1
tasks/agg-p15-n08-s05/tests/test.shAdded+89
tasks/agg-p15-n08-s06/instruction.mdAdded+21
tasks/agg-p15-n08-s06/solution/solve.shAdded+5
tasks/agg-p15-n08-s06/task.tomlAdded+27
tasks/agg-p15-n08-s06/tests/expected.jsonAdded+1