Agent Manager commited on
Commit ·
0c2eebf
1
Parent(s): d1389e4
Add aggregation team sizes and clarify final submission
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- README.md+18-14
- check.py+28-5
- generate.py+16-7
- tasks/agg-p01-n01-s01/instruction.md+6-1
- tasks/agg-p01-n01-s01/tests/test.sh+1-1
- tasks/agg-p01-n02-s01/instruction.md+5-1
- tasks/agg-p01-n02-s01/tests/test.sh+1-1
- tasks/agg-p01-n02-s02/instruction.md+5-1
- tasks/agg-p01-n02-s02/tests/test.sh+1-1
- tasks/agg-p01-n04-s01/instruction.md+5-1
- tasks/agg-p01-n04-s01/tests/test.sh+1-1
- tasks/agg-p01-n04-s02/instruction.md+5-1
- tasks/agg-p01-n04-s02/tests/test.sh+1-1
- tasks/agg-p01-n04-s03/instruction.md+5-1
- tasks/agg-p01-n04-s03/tests/test.sh+1-1
- tasks/agg-p01-n04-s04/instruction.md+5-1
- tasks/agg-p01-n04-s04/tests/test.sh+1-1
- tasks/agg-p01-n06-s01/instruction.mdAdded+25
- tasks/agg-p01-n06-s01/solution/solve.shAdded+5
- tasks/agg-p01-n06-s01/task.tomlAdded+27
- tasks/agg-p01-n06-s01/tests/expected.jsonAdded+1
- tasks/agg-p01-n06-s01/tests/test.shAdded+89
- tasks/agg-p01-n06-s02/instruction.mdAdded+25
- tasks/agg-p01-n06-s02/solution/solve.shAdded+5
- tasks/agg-p01-n06-s02/task.tomlAdded+27
- tasks/agg-p01-n06-s02/tests/expected.jsonAdded+1
- tasks/agg-p01-n06-s02/tests/test.shAdded+89
- tasks/agg-p01-n06-s03/instruction.mdAdded+25
- tasks/agg-p01-n06-s03/solution/solve.shAdded+5
- tasks/agg-p01-n06-s03/task.tomlAdded+27
- tasks/agg-p01-n06-s03/tests/expected.jsonAdded+1
- tasks/agg-p01-n06-s03/tests/test.shAdded+89
- tasks/agg-p01-n06-s04/instruction.mdAdded+25
- tasks/agg-p01-n06-s04/solution/solve.shAdded+5
- tasks/agg-p01-n06-s04/task.tomlAdded+27
- tasks/agg-p01-n06-s04/tests/expected.jsonAdded+1
- tasks/agg-p01-n06-s04/tests/test.shAdded+89
- tasks/agg-p01-n06-s05/instruction.mdAdded+25
- tasks/agg-p01-n06-s05/solution/solve.shAdded+5
- tasks/agg-p01-n06-s05/task.tomlAdded+27
- tasks/agg-p01-n06-s05/tests/expected.jsonAdded+1
- tasks/agg-p01-n06-s05/tests/test.shAdded+89
- tasks/agg-p01-n06-s06/instruction.mdAdded+25
- tasks/agg-p01-n06-s06/solution/solve.shAdded+5
- tasks/agg-p01-n06-s06/task.tomlAdded+27
- tasks/agg-p01-n06-s06/tests/expected.jsonAdded+1
- tasks/agg-p01-n06-s06/tests/test.shAdded+89
- tasks/agg-p01-n08-s01/instruction.md+5-1
- tasks/agg-p01-n08-s01/tests/test.sh+1-1
- tasks/agg-p01-n08-s02/instruction.md+5-1
8 unmodified lines9101112121314151617181918192021222 unmodified lines25262728293031322829303132333435363738373839404156 unmodified lines98991001011021031011021031041051061061071081091103 unmodified lines11411511611711811912013 unmodified lines1341351361371381391401418 unmodified lines- multi-agent- message-boardsize_categories:- n<1K- 1K<n<10K---
# s3-aggregation
A [Harbor](https://harborframework.com) environment that measures whether a swarm of agents**communicates**: each agent holds one private number, and no agent can solve the task alone. Itadapts the information-aggregation task of**communicates**: each agent holds one private number, and teams of two or more need to sharetheir numbers to solve the task. It adapts the information-aggregation task of[s³: Simple Scaling of Swarms via Cooperative Multi-agent RL](https://arxiv.org/abs/2611.08615).A team uses a shared message board supplied by the runner. Each participant receives its ownHarbor task.2 unmodified lines
Each of the N agents holds one private integer from 1 to 99, written in English words("seventy-three"). The team must list all N numbers in ascending order, keeping equal numbersfrom different agents as separate entries. Each agent finds its number in its instruction,shares it on the board, reads the others', keeps one number per participant, writes`/app/answer.json` (a JSON array of N integers in ascending order) and stops. The team succeedsif any agent's answer is right. The instruction adapts the paper's (Appendix G) to the board andprescribes no protocol beyond that.from different agents as separate entries. On multi-agent teams, each agent shares its numberon the board, reads the others' numbers and keeps one number per participant. Eachagent writes `/app/answer.json` once as its final submission, a JSON array of N integers inascending order, then stops immediately. If the runner ends the messaging phase first, it givesagents one final prompt to submit. The team succeeds if any agent's answer is right.
| | || --- | --- || Problems | 32 (the paper's held-out set size), each 16 integers drawn uniformly from 1 to 99, repeats allowed, from a fixed seed || Teams | 160: one per problem and team size N ∈ {1, 2, 4, 8, 16}, holding the problem's first N numbers, e.g. `agg-p07-n08` || Tasks | 992: one per slot of each team, `agg-p07-n08-s01` .. `-s08`, whose instruction states that slot's number || Teams | 224: one per problem and team size N ∈ {1, 2, 4, 6, 8, 12, 16}, holding the problem's first N numbers, e.g. `agg-p07-n08` || Tasks | 1,568: one per slot of each team, `agg-p07-n08-s01` .. `-s08`, whose instruction states that slot's number || Image | `python:3.12-slim`, prebuilt and public (no Dockerfile): HF Sandboxes, docker and podman || Agent / verifier timeout | 1800 s / 60 s || Resources | 1 CPU, 1 GB memory per agent |56 unmodified lines```
1. **Generator:** `generate.py` reproduces `problems.json` and `tasks/` byte for byte; another seed gives other problems; 32 problems of 16 integers in 1..99; the words read back to their numbers; each team has one task per slot, whose answer is the problem's first N numbers sorted and whose instruction states that slot's number, and name order is slot order. seed gives other problems and is recorded in every task's metadata. The checks verify the 32 problems of 16 integers in 1..99, the English number words, and the task for each slot. Its answer is the problem's first N numbers sorted, its instruction states that slot's number, and name order is slot order.2. **Graders**, run as Harbor runs them (`tests/` copied in after the agent is done, through any link the agent left), on slot 1 of each team (every slot's `tests/` and `solution/` are the same, which this checks): on all 160 teams the oracle scores 1, and wrong, partial, the same, which this checks): on all 224 teams the oracle scores 1, and wrong, partial, padded, unsorted and duplicate-dropping answers score 0. On one team per size, twelve kinds of malformed answer score 0, and so do sixteen cheats: the answer as a symlink to the tests' `expected.json` (dangling until the tests arrive; absolute or relative), a symlink or a3 unmodified lines to read any answer as right: a `json.py` in the grader's working directory or on `PYTHONPATH`, a `sitecustomize` on `PYTHONPATH`, a `usercustomize` or a `.pth` file in the user site, and a `dirname` shadowed on the `PATH` that points `expected.json` at the agent's file. A preexisting reward symlink to a valid answer leaves that answer intact and scores 1.3. **No-cheat, in the files:** a task folder holds only its five files; its instruction states its own slot's number on one line and is otherwise the same for every task of its team size, so it holds no teammate's number; the answer is only in `tests/` and `solution/`; and no13 unmodified lines through the runner's message board.- **The grader can't see the board:** an agent could guess or copy a wrong number and still be scored only on its file. The board export in the run directory shows what was said.- Single submission is an instruction rule. The verifier sees the final file after the agent stops, and the agent's sandbox lets it write directly to `/app`.- **The verifier runs in the agent's container**, as in every Harbor task. The grader closes the file and import holes above, but an agent that replaced the container's `python3`, `bash` or Python's standard library, or left a process running to rewrite the reward, could still forge8 unmodified lines91011121314121314151617187 unmodified lines2627282930313275 unmodified lines10810911011110911011211311411511611711811912012112212312412512612712812913086 unmodified lines21721821922022122222322422522622722822923023123223395 unmodified lines3293303313323333343358 unmodified lines uv run check.py --env none # skip the Trials
1. Generator: generate.py reproduces problems.json and tasks/ byte for byte from its seed; another seed gives other problems; 32 problems of 16 integers in 1..99; the English words read back to their numbers; a team `agg-pPP-nNN` has one task per slot, `-sKK`, whose answer is the problem's first N numbers sorted and whose instruction states slot K's number. another seed gives other problems and is recorded in every task's metadata; 32 problems of 16 integers in 1..99, with sizes 1, 2, 4, 6, 8, 12 and 16 (224 teams, 1,568 tasks); the English words read back to their numbers; a team `agg-pPP-nNN` has one task per slot, `-sKK`, whose answer is the problem's first N numbers sorted and whose instruction states slot K's number.2. Graders, run as Harbor runs them (tests/ copied in after the agent is done), on slot 1 of every team (every slot's tests/ and solution/ are the same, which this checks): the oracle (solution/solve.sh) scores 1, and a wrong, partial, padded, unsorted or duplicate-dropping7 unmodified lines right: a json.py in the grader's working directory or on PYTHONPATH, a sitecustomize on PYTHONPATH, a usercustomize or a .pth file in the user site (PYTHONUSERBASE), and a `dirname` shadowed on the PATH that points expected.json at the agent's own file. A preexisting reward symlink to a valid answer leaves that answer intact and scores 1.3. No-cheat, in the files: a task folder holds only instruction.md, task.toml, tests/ and solution/; its instruction states its own slot's number on one line and is otherwise the same for every task of its team size, so it holds no teammate's number; the answer is only in75 unmodified lines
def check_generator() -> None: with tempfile.TemporaryDirectory() as d: root = Path(d) g.generate(Path(d)) check(files(Path(d)) == files(HERE), "generate.py does not reproduce the committed files") g.generate(root) check(files(root) == files(HERE), "generate.py does not reproduce the committed files") seed = g.SEED + 1 g.generate(root, seed=seed) tasks = sorted((root / "tasks").glob("*/task.toml")) check(len(tasks) == 1568, "alternate seed did not generate 1,568 task.toml files") for task in tasks: check(re.findall(r"^seed = (.+)$", task.read_text(), re.MULTILINE) == [str(seed)], f"{task.parent.name}: task.toml does not record the alternate seed {seed}") drawn = g.problems() check(drawn == g.problems(), "the same seed gave other problems") check(drawn != g.problems(g.SEED + 1), "another seed gave the same problems") check(len(drawn) == 32 and all(len(p) == 16 and all(type(x) is int and 1 <= x <= 99 for x in p) for p in drawn), "not 32 problems of 16 integers in 1..99") check(g.SIZES == (1, 2, 4, 6, 8, 12, 16), "team sizes do not match the evaluation grid") check(all(read_words(g.words(n)) == n for n in range(1, 100)) and len({g.words(n) for n in range(1, 100)}) == 99, "the English words are wrong") names = []86 unmodified lines return grade(task, path.read_bytes())
def check_reward_symlink(task: Path) -> None: def setup(root: Path) -> None: answer = root / "app" / "answer.json" shutil.copyfile(task / "tests" / "expected.json", answer) verifier = root / "verifier" verifier.mkdir() (verifier / "reward.txt").symlink_to(answer)
check(grade(task, cheat=setup) == 1, f"{task.name}: preexisting reward symlink clobbered the answer")
def wrong_answers(team: list[int]) -> dict[str, list]: """The answers that must score 0 for a team (sorted): those that apply to it.""" last = team[-1] + 1 if team[-1] < 99 else team[-1] - 195 unmodified lines check(oracle(task) == 1, f"{task.name}: the oracle does not score 1") cases = {k: (json.dumps(v).encode(), None) for k, v in wrong_answers(team).items()} if task.name.startswith("agg-p01-"): check_reward_symlink(task) cases |= {k: (v, None) for k, v in malformed(team).items()} cases |= {k: (None, cheat) for k, cheat in cheats(task).items()} for case, (answer, cheat) in cases.items():18 unmodified lines192021222223242530 unmodified lines56575859606162633 unmodified lines67686968707172737475767712 unmodified lines9091928793949596979899100101102941031041051066 unmodified lines11311411510711611711811930 unmodified lines15015115214415315415515692 unmodified lines24925025124325225325425518 unmodified linesSEED = 115 # huggingface/legion#115PROBLEMS = 32 # the paper's held-out set sizeNUMBERS = 16 # per problem; a team of N holds the first NSIZES = (1, 2, 4, 8, 16)SIZES = (1, 2, 4, 6, 8, 12, 16)LOW, HIGH = 1, 99IMAGE = "python:3.12-slim" # public and prebuilt: HF Sandboxes need one, docker and podman too
30 unmodified lines
def instruction(n: int, number: int) -> str: submission = """`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.""" if n == 1: return f"""# Sort the team's private numbers
3 unmodified linesYour private number is {words(number)}.
Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numericvalue, as digits. Then stop.value, as digits.
{submission}If the runner ends the work phase before you submit, you will receive one final prompt tosubmit your answer.""" return f"""# Sort the team's private numbers
12 unmodified lines 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 {n} integers, as digits, in ascending order. Then stop.
{submission}If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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."""
def task_toml(problem: int, n: int, slot: int) -> str:def task_toml(problem: int, n: int, slot: int, seed: int = SEED) -> str: return f"""schema_version = "1.4"
[task]6 unmodified linesproblem = {problem}agents = {n}slot = {slot}seed = {SEED}seed = {seed}
[agent]timeout_sec = 180030 unmodified linesexport 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"[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport os92 unmodified lines for slot, number in enumerate(team, 1): task = root / "tasks" / task_name(p, n, slot) write(task / "instruction.md", instruction(n, number)) write(task / "task.toml", task_toml(p, n, slot)) write(task / "task.toml", task_toml(p, n, slot, seed)) write(task / "tests" / "test.sh", TEST_SH, 0o755) write(task / "tests" / "expected.json", json.dumps(sorted(team)) + "\n") write(task / "solution" / "solve.sh", solve_sh(sorted(team)), 0o755)5 unmodified lines6789910111213145 unmodified linesYour private number is thirty-seven.
Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numericvalue, as digits. Then stop.value, as digits.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the work phase before you submit, you will receive one final prompt tosubmit your answer.16 unmodified lines171819202021222316 unmodified linesexport 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"[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport os14 unmodified lines15161718181920212223242514 unmodified lines 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.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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.16 unmodified lines171819202021222316 unmodified linesexport 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"[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport os14 unmodified lines15161718181920212223242514 unmodified lines 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.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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.16 unmodified lines171819202021222316 unmodified linesexport 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"[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport os14 unmodified lines15161718181920212223242514 unmodified lines 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.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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.16 unmodified lines171819202021222316 unmodified linesexport 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"[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport os14 unmodified lines15161718181920212223242514 unmodified lines 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.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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.16 unmodified lines171819202021222316 unmodified linesexport 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"[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport os14 unmodified lines15161718181920212223242514 unmodified lines 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.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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.16 unmodified lines171819202021222316 unmodified linesexport 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"[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport os14 unmodified lines15161718181920212223242514 unmodified lines 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.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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.16 unmodified lines171819202021222316 unmodified linesexport 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"[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport os12345678910111213141516171819202122232425# Sort the team's private numbers
You are on a team of 6 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 6 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 6 integers, as digits, in ascending order.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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 '[15, 15, 26, 37, 43, 69]' > "$answer"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p01-n06-s01"version = "0.1.0"description = "s3-aggregation: 6 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]
[metadata]problem = 1agents = 6slot = 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[15, 15, 26, 37, 43, 69]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" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && 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)PY12345678910111213141516171819202122232425# Sort the team's private numbers
You are on a team of 6 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-six.
The team must find all 6 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 6 integers, as digits, in ascending order.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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 '[15, 15, 26, 37, 43, 69]' > "$answer"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p01-n06-s02"version = "0.1.0"description = "s3-aggregation: 6 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]
[metadata]problem = 1agents = 6slot = 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[15, 15, 26, 37, 43, 69]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" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && 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)PY12345678910111213141516171819202122232425# Sort the team's private numbers
You are on a team of 6 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 fifteen.
The team must find all 6 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 6 integers, as digits, in ascending order.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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 '[15, 15, 26, 37, 43, 69]' > "$answer"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p01-n06-s03"version = "0.1.0"description = "s3-aggregation: 6 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]
[metadata]problem = 1agents = 6slot = 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[15, 15, 26, 37, 43, 69]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" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && 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)PY12345678910111213141516171819202122232425# Sort the team's private numbers
You are on a team of 6 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 sixty-nine.
The team must find all 6 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 6 integers, as digits, in ascending order.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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 '[15, 15, 26, 37, 43, 69]' > "$answer"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p01-n06-s04"version = "0.1.0"description = "s3-aggregation: 6 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]
[metadata]problem = 1agents = 6slot = 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[15, 15, 26, 37, 43, 69]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" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && 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)PY12345678910111213141516171819202122232425# Sort the team's private numbers
You are on a team of 6 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 fifteen.
The team must find all 6 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 6 integers, as digits, in ascending order.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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 '[15, 15, 26, 37, 43, 69]' > "$answer"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p01-n06-s05"version = "0.1.0"description = "s3-aggregation: 6 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]
[metadata]problem = 1agents = 6slot = 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[15, 15, 26, 37, 43, 69]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" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && 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)PY12345678910111213141516171819202122232425# Sort the team's private numbers
You are on a team of 6 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-three.
The team must find all 6 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 6 integers, as digits, in ascending order.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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 '[15, 15, 26, 37, 43, 69]' > "$answer"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p01-n06-s06"version = "0.1.0"description = "s3-aggregation: 6 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]
[metadata]problem = 1agents = 6slot = 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[15, 15, 26, 37, 43, 69]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" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && 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)PY14 unmodified lines15161718181920212223242514 unmodified lines 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.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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.16 unmodified lines171819202021222316 unmodified linesexport 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"[ -d "$VERIFIER_DIR" ] && [ ! -L "$VERIFIER_DIR/reward.txt" ] && echo 0 > "$VERIFIER_DIR/reward.txt"python3 -I -S - <<'PY' || trueimport jsonimport os14 unmodified lines15161718181920212223242514 unmodified lines 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.
`/app/answer.json` is your single final submission. Do not write a draft there or overwriteit. Write it once when you are ready to submit, then stop immediately.If the runner ends the messaging phase before you submit, you will receive one final prompt.Use it to submit your best answer.
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.README.md+18-14
check.py+28-5
generate.py+16-7
tasks/agg-p01-n01-s01/instruction.md+6-1
tasks/agg-p01-n01-s01/tests/test.sh+1-1
tasks/agg-p01-n02-s01/instruction.md+5-1
tasks/agg-p01-n02-s01/tests/test.sh+1-1
tasks/agg-p01-n02-s02/instruction.md+5-1
tasks/agg-p01-n02-s02/tests/test.sh+1-1
tasks/agg-p01-n04-s01/instruction.md+5-1
tasks/agg-p01-n04-s01/tests/test.sh+1-1
tasks/agg-p01-n04-s02/instruction.md+5-1
tasks/agg-p01-n04-s02/tests/test.sh+1-1
tasks/agg-p01-n04-s03/instruction.md+5-1
tasks/agg-p01-n04-s03/tests/test.sh+1-1
tasks/agg-p01-n04-s04/instruction.md+5-1
tasks/agg-p01-n04-s04/tests/test.sh+1-1
tasks/agg-p01-n06-s01/instruction.mdAdded+25
tasks/agg-p01-n06-s01/solution/solve.shAdded+5
tasks/agg-p01-n06-s01/task.tomlAdded+27
tasks/agg-p01-n06-s01/tests/expected.jsonAdded+1
tasks/agg-p01-n06-s01/tests/test.shAdded+89
tasks/agg-p01-n06-s02/instruction.mdAdded+25
tasks/agg-p01-n06-s02/solution/solve.shAdded+5
tasks/agg-p01-n06-s02/task.tomlAdded+27
tasks/agg-p01-n06-s02/tests/expected.jsonAdded+1
tasks/agg-p01-n06-s02/tests/test.shAdded+89
tasks/agg-p01-n06-s03/instruction.mdAdded+25
tasks/agg-p01-n06-s03/solution/solve.shAdded+5
tasks/agg-p01-n06-s03/task.tomlAdded+27
tasks/agg-p01-n06-s03/tests/expected.jsonAdded+1
tasks/agg-p01-n06-s03/tests/test.shAdded+89
tasks/agg-p01-n06-s04/instruction.mdAdded+25
tasks/agg-p01-n06-s04/solution/solve.shAdded+5
tasks/agg-p01-n06-s04/task.tomlAdded+27
tasks/agg-p01-n06-s04/tests/expected.jsonAdded+1
tasks/agg-p01-n06-s04/tests/test.shAdded+89
tasks/agg-p01-n06-s05/instruction.mdAdded+25
tasks/agg-p01-n06-s05/solution/solve.shAdded+5
tasks/agg-p01-n06-s05/task.tomlAdded+27
tasks/agg-p01-n06-s05/tests/expected.jsonAdded+1
tasks/agg-p01-n06-s05/tests/test.shAdded+89
tasks/agg-p01-n06-s06/instruction.mdAdded+25
tasks/agg-p01-n06-s06/solution/solve.shAdded+5
tasks/agg-p01-n06-s06/task.tomlAdded+27
tasks/agg-p01-n06-s06/tests/expected.jsonAdded+1
tasks/agg-p01-n06-s06/tests/test.shAdded+89
tasks/agg-p01-n08-s01/instruction.md+5-1
tasks/agg-p01-n08-s01/tests/test.sh+1-1
tasks/agg-p01-n08-s02/instruction.md+5-1