One task per slot (agg-pPP-nNN-sKK) whose instruction states its number; no resources/ (Flock's selector gives each agent its own task)
Browse filesThis view is limited to 50 files because it contains too many changes. See raw diff
Files changed (50)
- README.md+54-66
- check.py+145-193
- eval/metrics.py+1-1
- flock/spec.template.yaml+4-8
- flock/sweep/README.md+1-1
- flock/team.py+9-18
- generate.py+33-40
- resources/message_board.pyDeleted-5
- resources/numbers.jsonDeleted-162
- resources/private_number.pyDeleted-58
- tasks/agg-p02-n01/instruction.md → tasks/agg-p01-n01-s01/instruction.mdRenamed+3-2
- tasks/agg-p01-n01/solution/solve.sh → tasks/agg-p01-n01-s01/solution/solve.shRenamed
- tasks/agg-p01-n01/task.toml → tasks/agg-p01-n01-s01/task.tomlRenamed+4-3
- tasks/agg-p01-n01/tests/expected.json → tasks/agg-p01-n01-s01/tests/expected.jsonRenamed
- tasks/agg-p01-n01/tests/test.sh → tasks/agg-p01-n01-s01/tests/test.shRenamed
- tasks/agg-p01-n01/instruction.mdDeleted-8
- tasks/agg-p03-n02/instruction.md → tasks/agg-p01-n02-s01/instruction.mdRenamed+3-2
- tasks/agg-p01-n02/solution/solve.sh → tasks/agg-p01-n02-s01/solution/solve.shRenamed
- tasks/agg-p01-n02/task.toml → tasks/agg-p01-n02-s01/task.tomlRenamed+4-3
- tasks/agg-p01-n02/tests/expected.json → tasks/agg-p01-n02-s01/tests/expected.jsonRenamed
- tasks/agg-p01-n02/tests/test.sh → tasks/agg-p01-n02-s01/tests/test.shRenamed
- tasks/agg-p01-n02/instruction.md → tasks/agg-p01-n02-s02/instruction.mdRenamed+3-2
- tasks/agg-p03-n01/solution/solve.sh → tasks/agg-p01-n02-s02/solution/solve.shRenamed+1-1
- tasks/agg-p03-n02/task.toml → tasks/agg-p01-n02-s02/task.tomlRenamed+5-4
- tasks/agg-p01-n02-s02/tests/expected.jsonAdded+1
- tasks/agg-p01-n04/tests/test.sh → tasks/agg-p01-n02-s02/tests/test.shRenamed
- tasks/agg-p01-n04/instruction.md → tasks/agg-p01-n04-s01/instruction.mdRenamed+3-2
- tasks/agg-p01-n04/solution/solve.sh → tasks/agg-p01-n04-s01/solution/solve.shRenamed
- tasks/agg-p01-n04/task.toml → tasks/agg-p01-n04-s01/task.tomlRenamed+4-3
- tasks/agg-p01-n04/tests/expected.json → tasks/agg-p01-n04-s01/tests/expected.jsonRenamed
- tasks/agg-p01-n08/tests/test.sh → tasks/agg-p01-n04-s01/tests/test.shRenamed
- tasks/agg-p02-n04/instruction.md → tasks/agg-p01-n04-s02/instruction.mdRenamed+3-2
- tasks/agg-p03-n04/solution/solve.sh → tasks/agg-p01-n04-s02/solution/solve.shRenamed+1-1
- tasks/agg-p03-n04/task.toml → tasks/agg-p01-n04-s02/task.tomlRenamed+5-4
- tasks/agg-p01-n04-s02/tests/expected.jsonAdded+1
- tasks/agg-p01-n16/tests/test.sh → tasks/agg-p01-n04-s02/tests/test.shRenamed
- tasks/agg-p03-n04/instruction.md → tasks/agg-p01-n04-s03/instruction.mdRenamed+3-2
- tasks/agg-p04-n01/solution/solve.sh → tasks/agg-p01-n04-s03/solution/solve.shRenamed+1-1
- tasks/agg-p04-n04/task.toml → tasks/agg-p01-n04-s03/task.tomlRenamed+5-4
- tasks/agg-p01-n04-s03/tests/expected.jsonAdded+1
- tasks/agg-p02-n01/tests/test.sh → tasks/agg-p01-n04-s03/tests/test.shRenamed
- tasks/agg-p04-n04/instruction.md → tasks/agg-p01-n04-s04/instruction.mdRenamed+3-2
- tasks/agg-p01-n04-s04/solution/solve.shAdded+5
- tasks/agg-p01-n04-s04/task.tomlAdded+27
- tasks/agg-p01-n04-s04/tests/expected.jsonAdded+1
- tasks/agg-p02-n02/tests/test.sh → tasks/agg-p01-n04-s04/tests/test.shRenamed
- tasks/agg-p02-n08/instruction.md → tasks/agg-p01-n08-s01/instruction.mdRenamed+3-2
- tasks/agg-p01-n08/solution/solve.sh → tasks/agg-p01-n08-s01/solution/solve.shRenamed
- tasks/agg-p01-n08/task.toml → tasks/agg-p01-n08-s01/task.tomlRenamed+4-3
- tasks/agg-p01-n08/tests/expected.json → tasks/agg-p01-n08-s01/tests/expected.jsonRenamed
27 unmodified lines282930313233342 unmodified lines3738394041424344454647484950515253545556575859606162636465666768697071727374757614 unmodified lines91929394959697989910010110210393 unmodified lines1971981992002012022032042052062072082092101 unmodified line2122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442456 unmodified lines2522532542552562572582596 unmodified lines26626726826927027127 unmodified linesEach 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 reads its number from its environment,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 and2 unmodified lines| | || --- | --- || Problems | 32 (the paper's held-out set size), each 16 integers drawn uniformly from 1 to 99, repeats allowed, from a fixed seed || Tasks | 160: one per problem and team size N ∈ {1, 2, 4, 8, 16}, whose team holds the problem's first N numbers, e.g. `agg-p07-n08` || 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 |```texttasks/agg-pPP-nNN/instruction.md the same for every problem of a team size: no number in ittask.tomltests/test.sh the gradertests/expected.json the answer: copied in only after the agent is donesolution/solve.sh an oracle with its own copy of the answerresources/ Flock's resources_dir for these tasksprivate_number.py puts each agent's own number in its environment (PRIVATE_NUMBER)numbers.json each task's agents (agent-001 ...) and their numbers, in wordsmessage_board.py Flock's own board, brought along (a resources_dir replaces Flock's)flock/spec.template.yaml what every team's Flock run shares: model, board rules, loop, limitsteam.py writes one team's spec (docker, HF Sandboxes or the HF cluster)sweep/ the scaling sweep on the HF cluster (flock/sweep/README.md)eval/metrics.py one row per team from Flock run directoriesproblems.json the 32 problemsgenerate.py writes problems.json, tasks/ and resources/numbers.json from its seed (115)check.py the checks that need no model```**Private numbers** reach each agent only through its own environment. With the spec's`resources_dir` on `resources/` and `resources.private_number.team` naming the task, Flock'sworker loads `private_number.py`, and its `bind(name)` gives agent `agent-00k`'s Trial`PRIVATE_NUMBER=<its number in words>` and nothing else. The module and `numbers.json` stay onthe worker: they are not in Flock's tool bundle, the task folder or any container. A task folderputs nothing in the container while the agent works (no `environment/`; `tests/` arrives afterthe agent is done), and the instruction holds no number, so no agent can read another agent'snumber until that agent posts it.## Reward14 unmodified lines## Run it with FlockFlock's [`experiments/s3-aggregation/spec.yaml`](https://github.com/huggingface/flock/tree/main/experiments/s3-aggregation)runs `agg-p01-n04` in local docker with this dataset next to Flock's checkout (its`resources_dir` is `../s3-aggregation/resources` from there), at the revision it pins:```shhf download HuggingFaceSwarms/s3-aggregation --repo-type dataset --revision <the spec's> --local-dir ../s3-aggregationuv run flock launch experiments/s3-aggregation/spec.yaml```For any other team or place, `flock/team.py` writes the spec from `flock/spec.template.yaml`,run from Flock's checkout. **Needs** `HF_TOKEN`, which reads the private dataset (and starts the93 unmodified linesuv run check.py --env none --run RUN_DIR # also a Flock run of a team (below)```1. **Generator:** `generate.py` reproduces `problems.json`, `tasks/` and`resources/numbers.json` byte for byte; another seed gives other problems; 32 problems of 16integers in 1..99; the words read back to their numbers; each task's team is its problem'sfirst N numbers, and `numbers.json` gives agent `agent-00k` the k-th.2. **Graders**, run as Harbor runs them (`tests/` copied in after the agent is done, throughany link the agent left): on all 160 tasks the oracle scores 1, and wrong, partial, padded,unsorted and duplicate-dropping answers score 0. On one task per team size, twelve kinds ofmalformed 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 ahardlink to a right answer elsewhere, a hardlink to `expected.json`, a symlinked `/app` (to aright answer, or into the tests' folder), an `expected.json` planted as a link to the answer,1 unmodified lineto 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 usersite, and a `dirname` shadowed on the `PATH` that points `expected.json` at the agent's file.3. **No-cheat, in the files:** a task folder holds only its five files, its instruction is thesame for every problem of its team size and holds no number, the answer is only in `tests/`and `solution/`, and `resources/` holds only the resource, its numbers and the board.4. **No-cheat, the resource:** for every task and agent, `private_number`'s binding is thatagent's own number in `PRIVATE_NUMBER` and nothing else (no other variable, mount, host ormetadata, and no teammate's number anywhere in it); a team of the wrong size, an unknowntask or agent, and unknown options are refused.5. **No-cheat, from inside Trials** of `agg-p01-n16`, with probe agents (no model): sixteenprobes, one per agent, each with exactly the environment `private_number` binds for it, lookaround the container while "the agent works": every file, every process's environment andcommand line, and the instruction. Each finds its own number only in its environment, and noteammate's number, no `tests/` or `solution/` and no file holding the answer anywhere; then itwrites the answer, the same search finds it (a control), and the task's verifier scores it 1.Four more leave a cheat with a wrong answer, and the verifier scores each 0:`/app/answer.json` as a symlink to `/tests/expected.json`; `/app` as a symlink into a`/tests` they made; a `json.py` that reads any answer as right wherever the verifier maystart; a `sitecustomize` in site-packages that does the same.6. **No-cheat, a Flock run** (`--run RUN_DIR`, a local run's `.flock/<swarm>-<time>/`): eachagent's first prompt (the task's instruction and Flock's) holds no number of the team; thefirst tool output in which an agent sees a teammate's number is a board read, after thatteammate posted it; the first post holding each number is its owner's; and each agent readits own number from its environment. A number counts in words and in digits where they readas a held number: an array of the team's integers (the JSON answer, or part of it), anagent's number in a mapping (`"agent-002": 26`) or a stated number (`number is 26`); bareids, counts and timestamps don't. The audit itself runs on synthetic runs every time: aclean one, and one whose ids and timestamps hold the team's numbers, pass; words, the JSONanswer, a mapping or a stated number in the first prompt or in a non-board output before theboard fail, and so does a number first posted by an agent that doesn't hold it.`--env` takes a Harbor environment type or an import path. Harbor 0.25.0's `hf-sandbox` uploads`tests/` with the host's file owner, which a sandbox can't take when the host's uid is over6 unmodified lines- **Private for now**, so whatever resolves and downloads the task (Flock's worker, which thenuploads it into the sandbox) needs a Hub token that can read it. The sandboxes never do.- **The numbers need Flock's resource.** Harbor alone has no per-agent environment: a task runwithout `resources/private_number.py` gives the agent no number to share.- **The grader can't see the board:** an agent could guess or copy a wrong number and still bescored only on its file. The board export in the run directory shows what was said.- **The verifier runs in the agent's container**, as in every Harbor task. The grader closes the6 unmodified lines- **Board rules** are enforced only where Flock's rule proxy runs (docker, podman); on HFSandboxes they are not.- **Not the paper's setup:** a message board instead of `message`/`read_messages` tools withnotifications, the number in the environment instead of the prompt, an answer file instead ofa `####` line, no example message, no token cost in the reward, and N = 1 is a solo controlrather than a team.27 unmodified lines282930313233342 unmodified lines373839404142434445464748495051525354555657585960616263646566676869707114 unmodified lines86878889909192939493 unmodified lines1881891901911921931941951961971981992002012021 unmodified line2042052062072082092102112122132142152162172182192202212222232242252262272282292302312322336 unmodified lines2402412422432442452462472486 unmodified lines25525625725825927 unmodified linesEach 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 and2 unmodified lines| | || --- | --- || 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 || 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 |```texttasks/agg-pPP-nNN-sKK/ slot K of team agg-pPP-nNN (zero-padded: name order is slot order)instruction.md "Your private number is ...": slot K's, and no othertask.tomltests/test.sh the grader, the same for every slot of the teamtests/expected.json the team's answer: copied in only after the agent is donesolution/solve.sh an oracle with its own copy of the answerflock/spec.template.yaml what every team's Flock run shares: model, board rules, loop, limitsteam.py writes one team's spec (docker, HF Sandboxes or the HF cluster)sweep/ the scaling sweep on the HF cluster (flock/sweep/README.md)eval/metrics.py one row per team from Flock run directoriesproblems.json the 32 problemsgenerate.py writes problems.json and tasks/ from its seed (115)check.py the checks that need no model```**Private numbers** reach each agent only through its own task. Flock runs a team with theselector `agg-pPP-nNN-s*`, `agents.count: N` and `naming: consecutive-id`: the selector matchesthe team's N slots, sorted by name, and `agent-00K` runs slot K's task, so its instructionholds its own number and no one else's. A task folder puts nothing in the container while theagent works (no `environment/`; `tests/` arrives after the agent is done), so no agent can readanother agent's number until that agent posts it.## Reward14 unmodified lines## Run it with FlockFlock's [`experiments/s3-aggregation/spec.yaml`](https://github.com/huggingface/flock/tree/main/experiments/s3-aggregation)runs one team on HF Sandboxes (`TEAM`, default `agg-p01-n04`, with `N` its size) at the revisionit pins: `uv run flock launch experiments/s3-aggregation/spec.yaml`. Its board is a public Spacefor the run: delete it afterwards.For any other team or place, `flock/team.py` writes the spec from `flock/spec.template.yaml`,run from Flock's checkout. **Needs** `HF_TOKEN`, which reads the private dataset (and starts the93 unmodified linesuv run check.py --env none --run RUN_DIR # also a Flock run of a team (below)```1. **Generator:** `generate.py` reproduces `problems.json` and `tasks/` byte for byte; anotherseed gives other problems; 32 problems of 16 integers in 1..99; the words read back to theirnumbers; each team has one task per slot, whose answer is the problem's first N numberssorted and whose 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, throughany link the agent left), on slot 1 of each team (every slot's `tests/` and `solution/` arethe same, which this checks): on all 160 teams the oracle scores 1, and wrong, partial,padded, unsorted and duplicate-dropping answers score 0. On one team per size, twelve kindsof 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 ahardlink to a right answer elsewhere, a hardlink to `expected.json`, a symlinked `/app` (to aright answer, or into the tests' folder), an `expected.json` planted as a link to the answer,1 unmodified lineto 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 usersite, and a `dirname` shadowed on the `PATH` that points `expected.json` at the agent's file.3. **No-cheat, in the files:** a task folder holds only its five files; its instruction statesits 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 nofolder beside `tasks/` holds numbers.4. **No-cheat, from inside Trials** of team `agg-p01-n16`, with probe agents (no model): sixteenprobes, one in each slot's task, look around the container while "the agent works": everyfile, every process's environment and command line, and the instruction. Each finds its ownnumber only in its instruction, and no teammate's number, no `tests/` or `solution/` and nofile holding the answer anywhere; then it writes the answer, the same search finds it (acontrol), and the task's verifier scores it 1. Four more leave a cheat with a wrong answer,and the verifier scores each 0: `/app/answer.json` as a symlink to `/tests/expected.json`;`/app` as a symlink into a `/tests` they made; a `json.py` that reads any answer as rightwherever the verifier may start; a `sitecustomize` in site-packages that does the same.5. **No-cheat, a Flock run** (`--run RUN_DIR`, a local run's `.flock/<swarm>-<time>/`): eachagent's first prompt (its task's instruction and Flock's) holds its own number and noteammate's; the first tool output in which an agent sees a teammate's number is a board read,after that teammate posted it; and the first post holding each number is its owner's. Anumber counts in words and in digits where they read as a held number: an array of theteam's integers (the JSON answer, or part of it), an agent's number in a mapping(`"agent-002": 26`) or a stated number (`number is 26`); bare ids, counts and timestampsdon't. The audit itself runs on synthetic runs every time: a clean one, and one whose idsand timestamps hold the team's numbers, pass; a teammate's number in words, the JSON answer,a mapping or a stated number in the first prompt or in a non-board output before the boardfail, and so does a number first posted by an agent that doesn't hold it.`--env` takes a Harbor environment type or an import path. Harbor 0.25.0's `hf-sandbox` uploads`tests/` with the host's file owner, which a sandbox can't take when the host's uid is over6 unmodified lines- **Private for now**, so whatever resolves and downloads the task (Flock's worker, which thenuploads it into the sandbox) needs a Hub token that can read it. The sandboxes never do.- **A team needs one agent per slot.** Each slot's task is one agent's view: run a team's Nslots together on one board (Flock's selector `agg-pPP-nNN-s*` with `agents.count: N`), or atask alone is an agent whose teammates never post.- **The grader can't see the board:** an agent could guess or copy a wrong number and still bescored only on its file. The board export in the run directory shows what was said.- **The verifier runs in the agent's container**, as in every Harbor task. The grader closes the6 unmodified lines- **Board rules** are enforced only where Flock's rule proxy runs (docker, podman); on HFSandboxes they are not.- **Not the paper's setup:** a message board instead of `message`/`read_messages` tools withnotifications, an answer file instead of a `####` line, no example message, no token cost inthe reward, and N = 1 is a solo control rather than a team.
6 unmodified lines7891011121314151617181920212223242526272829303132333435363738394041424344451 unmodified line47484950515253545556575859606162636416 unmodified lines8182838485868788895 unmodified lines959697989910010110 unmodified lines1121131141151161176 unmodified lines124125126127128129130131132133134135136137138139140141142143144145146156 unmodified lines30330430530630730830912 unmodified lines3223233243253263273283293303313323333343353363373383393403411 unmodified line34334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840978 unmodified lines4884894904914924934944954964974984995005015021 unmodified line5045055065075085095109 unmodified lines5205215225235245255265 unmodified lines5325335345355365375385395407 unmodified lines5485495505515525535545 unmodified lines5605615625635645655665675685695705715725735745755765775785795805815825835845855 unmodified lines59159259359459559659759859960060160260360460560660733 unmodified lines6416426436446456466476486496506516526536546556565 unmodified lines6626636646656666676681 unmodified line6706716726736746756766776 unmodified lines6846856866876886896906914 unmodified lines6966976986997007017027037047058 unmodified lines7147157167177187197207217227237247257267277284 unmodified lines7337347357367377387396 unmodified lines7467477487497507517527537547557567 unmodified lines76476576676776876977036 unmodified lines8078088098108118128138148158168178188198208218228238248258268278288298308316 unmodified linesuv run check.py # all of them; the Trials run on HF Sandboxes (HF_TOKEN)uv run check.py --env docker # the Trials in local docker insteaduv run check.py --env none # skip the Trialsuv run check.py --run RUN_DIR # also a Flock run of a team (group 6)1. Generator: generate.py reproduces problems.json, tasks/ and resources/numbers.json byte forbyte from its seed; another seed gives other problems; 32 problems of 16 integers in 1..99;the English words read back to their numbers; each task's team is its problem's first Nnumbers, and numbers.json gives agent-00k the k-th.2. Graders, run as Harbor runs them (tests/ copied in after the agent is done): on every task,the oracle (solution/solve.sh) scores 1, and a wrong, partial, padded, unsorted orduplicate-dropping answer scores 0. On one task per team size, malformed answers (missing,empty, not JSON, NaN, an object, strings, words, floats, booleans, nested, a "####" prefix,invalid UTF-8) and cheats score 0: the answer as a symlink to the tests' expected.json(dangling until the tests arrive, absolute or relative), a symlink or a hardlink to a rightanswer elsewhere, a hardlink to expected.json, a symlinked /app (to a right answer, or to thetests' folder), an expected.json planted as a link to the answer before the tests arrive, adirectory and a FIFO (which must not hang the grader); and a wrong answer with Python made toread any answer as right: a json.py in the grader's working directory or on PYTHONPATH, asitecustomize 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 theagent's own file.3. No-cheat, in the files: a task folder holds only instruction.md, task.toml, tests/ andsolution/; its instruction is the same for every problem of its team size; the answer is onlyin tests/ and solution/; resources/ holds only private_number.py, numbers.json and the board.4. No-cheat, the resource: for every task and agent, private_number binds that agent's ownnumber as PRIVATE_NUMBER and nothing else, with no teammate's number in the binding or themetadata, and exports nothing; a team of the wrong size, an unknown or missing task, anunknown option and an agent off the team are refused.5. No-cheat, from inside Trials (`--env`), on `agg-p01-n16`, with probe agents (no model):- one per agent, with exactly the environment private_number binds for it (as Flock's Piruns with it), looks around the container while "the agent works": no tests/ or solution/,no file holding the answer or a teammate's hyphenated number word, no process whoseenvironment or command line holds a teammate's number, no number in the instruction, andits own number in its environment (a control); then it writes the answer, the same searchfinds it (a control), and the task's own verifier scores it 1;- the others leave a cheat with a wrong answer: /app/answer.json as a symlink to/tests/expected.json; a symlinked /app into a /tests they made; a json.py that reads anyanswer as right wherever the verifier may start; a sitecustomize in site-packages that1 unmodified line`--env` takes a Harbor environment type or an import path. Harbor 0.25.0's hf-sandboxuploads tests/ with the host's file owner, which a sandbox can't take when the host's uid isover 65535 (some clusters): use flock's `--env flock.harbor.envs:HFSandbox` there.6. No-cheat, a Flock run (`--run`, a local run's directory with its agents' event streams andthe board export): no system prompt or first prompt holds a number of the team; the firstoutput in which an agent sees a teammate's number is a board read, or a later prompt (awake-up quoting the board); the first post holding each number is its owner's; and eachagent read its own number outside the board. A number counts in words ("twenty-six") and indigits where they read as a held number: an array of the team's integers (the JSON answer,or part of it), an agent's number in a mapping (`"agent-002": 26`) and a stated number(`number is 26`); bare ids, counts and timestamps don't. The audit itself is checked onsynthetic runs, always: a clean one and one whose ids and timestamps hold the team's numberspass, and each leak fails (words, the JSON answer, a mapping and a stated number, in the firstprompt or in a non-board output before the board, and a number first posted by an agent thatdoesn't hold it)."""import argparse16 unmodified linesTASK_FILES = {"instruction.md", "task.toml", "tests/test.sh", "tests/expected.json","solution/solve.sh"}NUMBERS_JSON = "resources/numbers.json"RESOURCE_FILES = {"private_number.py", "numbers.json", "message_board.py"}PROBE_TASK = "agg-p01-n16"failures: list[str] = []5 unmodified linesdef files(root: Path) -> dict[str, bytes]:"""Relative path -> bytes for the generated files under root (not their modes: a downloadfrom the Hub has none, and Harbor runs the scripts with bash)."""out = {name: (root / name).read_bytes() for name in ("problems.json", NUMBERS_JSON)}for path in sorted((root / "tasks").rglob("*")):if path.is_file():out[str(path.relative_to(root))] = path.read_bytes()10 unmodified linesreturn VALUES[head] + (VALUES[tail] if tail else 0)def check_generator() -> None:with tempfile.TemporaryDirectory() as d:g.generate(Path(d))6 unmodified lines"not 32 problems of 16 integers in 1..99")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 = set()held = json.loads((HERE / NUMBERS_JSON).read_text())for p, numbers in enumerate(drawn, 1):for n in g.SIZES:name = g.task_name(p, n)names.add(name)team = numbers[:n]expected = json.loads((HERE / "tasks" / name / "tests" / "expected.json").read_text())check(expected == sorted(team), f"{name}: expected.json is not the first {n} sorted")agents = held.get(name, {})check(list(agents) == [f"agent-{k:03d}" for k in range(1, n + 1)],f"{name}: numbers.json does not name agent-001 .. agent-{n:03d}")for slot, (agent, number) in enumerate(zip(agents, team, strict=False), 1):check(read_words(agents[agent]) == number,f"{name}: {agent} does not hold slot {slot}'s number")check({p.name for p in (HERE / "tasks").iterdir()} == names, "tasks/ has other folders")check(set(held) == names, "numbers.json has other teams")def grade(task: Path, answer: bytes | None = None, cheat=None) -> int:156 unmodified linesdef check_graders() -> dict[str, int]:covered: dict[str, int] = {}for task in sorted((HERE / "tasks").iterdir()):team = json.loads((task / "tests" / "expected.json").read_text())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()}12 unmodified linesfor task in sorted((HERE / "tasks").iterdir()):listed = {str(p.relative_to(task)) for p in task.rglob("*") if p.is_file()}check(listed == TASK_FILES, f"{task.name}: holds {sorted(listed ^ TASK_FILES)}")n = int(task.name.split("-n")[1])problem = int(task.name.split("-p")[1][:2])toml = (task / "task.toml").read_text().replace(task.name, "TASK").replace(f"problem = {problem}\n", "problem = P\n")by_size.setdefault(n, set()).add(((task / "instruction.md").read_text(), toml))answer = (task / "tests" / "expected.json").read_text().strip()holders = {str(p.relative_to(task)) for p in task.rglob("*")if p.is_file() and answer in p.read_text()}check(holders == {"tests/expected.json", "solution/solve.sh"},f"{task.name}: the answer is in {sorted(holders)}")check(all(len(v) == 1 for v in by_size.values()),"an instruction or task.toml differs between problems of one team size")listed = {p.name for p in (HERE / "resources").iterdir() if p.name != "__pycache__"}check(listed == RESOURCE_FILES, f"resources/ holds {sorted(listed ^ RESOURCE_FILES)}")def holds(text: str, words) -> set[str]:1 unmodified linereturn {w for w in words if re.search(rf"(?<![A-Za-z-]){re.escape(w)}(?![A-Za-z-])", text)}def private_number():"""resources/private_number.py, as Flock's worker loads it (by path)."""import importlib.utilspec = importlib.util.spec_from_file_location("_s3_private_number",HERE / "resources" / "private_number.py")module = importlib.util.module_from_spec(spec)spec.loader.exec_module(module)return moduledef check_resource() -> int:"""private_number binds each agent's own number and nothing else, for every task andagent; returns how many bindings it checked."""module, held = private_number(), json.loads((HERE / NUMBERS_JSON).read_text())checked = 0with tempfile.TemporaryDirectory() as d:for task, agents in held.items():resource = module.Resource({"team": task}, state_dir=Path(d) / task,agents=list(agents), secrets=[])async def lifecycle(resource=resource, d=d, task=task):await resource.start()exported = await resource.export(Path(d))await resource.stop()return exportedcheck(asyncio.run(lifecycle()) == {} and not any(Path(d).iterdir()),f"{task}: the resource exports something")check(not holds(json.dumps(resource.metadata), set(agents.values())),f"{task}: the resource's metadata holds a number")for agent, own in agents.items():binding = resource.bind(agent)checked += 1check(binding == {"env": {"PRIVATE_NUMBER": own}},f"{task}: {agent}'s binding is {binding}")others = {w for w in agents.values() if w != own}check(not holds(json.dumps(binding), others),f"{task}: {agent}'s binding holds a teammate's number")refused = {"a team of the wrong size": ({"team": "agg-p01-n08"}, [f"agent-{k:03d}" for k in (1, 2)]),"an unknown task": ({"team": "agg-p99-n04"}, ["agent-001"]),"no task": ({}, ["agent-001"]),"an unknown option": ({"team": "agg-p01-n01", "numbers": [1]}, ["agent-001"]),}for what, (options, agents) in refused.items():try:module.Resource(options, state_dir=None, agents=agents, secrets=[])check(False, f"the resource takes {what}")except ValueError:passresource = module.Resource({"team": "agg-p01-n02"}, state_dir=None,agents=["agent-001", "agent-002"], secrets=[])try:resource.bind("agent-003")check(False, "the resource binds an agent that isn't on the team")except ValueError:passreturn checked# Runs in the container as `python3 -c PROBE_PY <base64 config>`, so it holds no number word# itself: its own command line is searched too. In files it looks for the teammates' hyphenated# number words (a bare single-digit word is in many system files) and the answer.78 unmodified linesfrom harbor.agents.base import BaseAgentclass Probe(BaseAgent):"""No model. `mode` answer: with exactly the environment `private_number` binds forits agent (`env`, as Flock's Pi runs with it), looks around the container as that agentcould while it works, writes `probe.json` in its logs dir on the host, then the answerfor the verifier. Any other mode: leaves that cheat (CHEATS) instead."""def __init__(self, *args, mode="answer", env=None, own="", others=(), answer="",**kwargs):super().__init__(*args, **kwargs)self.mode, self.bound, self.answer = mode, env or {}, answerself.own, self.others = own, list(others)@staticmethod1 unmodified linereturn "s3-aggregation-probe"def version(self) -> str:return "3"async def setup(self, environment) -> None:pass9 unmodified linesencoded = base64.b64encode(json.dumps({"own": self.own, "others": self.others, "answer": self.answer}).encode()).decode()result = await environment.exec(f"python3 -c {shlex.quote(PROBE_PY)} {encoded}",env=self.bound, timeout_sec=600)line = next((x for x in (result.stdout or "").splitlines()if x.startswith("PROBE ")), None)found = json.loads(line.removeprefix("PROBE ")) if line else {}5 unmodified linesProbe = Noneasync def run_trial(env: str, jobs: Path, mode: str, kwargs: dict,name: str = "") -> tuple[dict | None, dict]:"""One Trial of PROBE_TASK with the probe in `mode`: (its probe.json, rewards and error)."""from harbor.models.trial.config import (AgentConfig,EnvironmentConfig,7 unmodified linesif ":" in env elseEnvironmentConfig(type=env, kwargs=sandbox if env == "hf-sandbox" else {}))config = TrialConfig(task=TaskConfig(path=HERE / "tasks" / PROBE_TASK), trial_name=f"probe-{name or mode}",trials_dir=jobs, environment=environment,agent=AgentConfig(import_path="__main__:Probe", kwargs={"mode": mode, **kwargs}))result = await (await Trial.create(config)).run()5 unmodified linesasync def check_trials(env: str, jobs: Path) -> dict:task = HERE / "tasks" / PROBE_TASKteam = json.loads((HERE / NUMBERS_JSON).read_text())[PROBE_TASK]answer = (task / "tests" / "expected.json").read_text().strip()resource = private_number().Resource({"team": PROBE_TASK}, state_dir=None,agents=list(team), secrets=[])probes = {agent: {"env": resource.bind(agent)["env"], "own": own, "answer": answer,"others": sorted({w for w in team.values() if w != own})}for agent, own in team.items()}gate = asyncio.Semaphore(10) # sandboxes at onceasync def one(mode, kwargs, name=""):async with gate:return await run_trial(env, jobs, mode, kwargs, name)runs = await asyncio.gather(*(one("answer", kwargs, agent) for agent, kwargs in probes.items()),*(one(mode, {}) for mode in CHEATS))report = {}for (agent, kwargs), (probe, graded) in zip(probes.items(), runs[:len(probes)], strict=True):what = f"Trial {agent}"ran = probe is not None and probe.get("return_code") == 0 and "files" in probecheck(ran, f"{what}: the probe did not run ({graded['error']})")if ran:5 unmodified linesf"number: {probe['env']}")check(not probe["cmdline"], f"{what}: a command line holds a teammate's number: "f"{probe['cmdline']}")check(not probe["instruction_holds"],f"{what}: the instruction holds {probe['instruction_holds']}")check(any(x.endswith(":PRIVATE_NUMBER") for x in probe["own_env"]),f"{what}: its own number is not in its environment ({probe['own_env']})")check("/app/answer.json" in probe["control"],f"{what}: the search did not find the written answer ({probe['control']})")check(graded["rewards"] == {"reward": 1.0},f"{what}: the verifier gave the answer {graded['rewards']} ({graded['error']})")report[agent] = {"own_env": probe and probe.get("own_env"),"processes": probe and probe.get("processes"),"teammates": len(kwargs["others"]), **graded}for mode, (left, result) in zip(CHEATS, runs[len(probes):], strict=True):check(left is not None and left["return_code"] == 0, f"Trial: cheat {mode} not left")check(result["rewards"] == {"reward": 0.0},33 unmodified linesdef audit_run(run: Path) -> tuple[list[str], dict]:"""(problems, report) for a Flock run of one team (a local run's `.flock/<swarm>-<time>/`):no prompt Flock gave an agent holds a number of the team; the first output in which an agentsees a teammate's number is a board read (or a wake-up that quotes the board), and the firstpost holding each number is its owner's; each agent read its own number from itsenvironment. A number counts as words or as digits (given_away)."""problems = []spec = json.loads((run / "run.json").read_text())["spec"]harbor = next(t["harbor"] for t in spec["types"].values() if t.get("harbor"))task = harbor["config"]["task"]["selector"]team = json.loads((HERE / NUMBERS_JSON).read_text())[task]held = {agent: read_words(word) for agent, word in team.items()}boards = sorted(run.rglob("resources/message_board/board.jsonl"))if len(boards) != 1:problems.append(f"run {run.name}: {len(boards)} board exports")5 unmodified linesfor number in given_away(post["body"], team):first.setdefault(number, post["sender"]["external_id"])for number, who in first.items():if held.get(who) != number:problems.append(f"run {run.name}: {number} was first posted by {who}")report = {"task": task, "posts": len(posts), "first_posts": first}for agent, own in team.items():1 unmodified lineif not path.is_file():problems.append(f"run {run.name}: no event stream for {agent}")continueothers = set(held.values()) - {held[agent]}seen, calls, prompts, read_own = set(), {}, 0, Falsefor line in path.read_text().splitlines():event = json.loads(line) if line.strip() else {}message = event.get("message") or {}6 unmodified linescalls[part.get("id")] = json.dumps(part.get("arguments") or {})elif role in ("system", "user"):if role == "system" or prompts == 0: # what Flock and the task tell the agentif given := given_away(text, team):problems.append(f"run {agent}: its {role} prompt holds {sorted(given)}")else: # a later prompt may quote the board (a wake-up on a mention)seen |= given_away(text, team) & othersprompts += role == "user"4 unmodified linesproblems.append(f"run {agent}: first saw {sorted(new)} in the output of "f"{command[:120]}")seen |= newread_own |= own in holds(text, {own}) and "message_board" not in commandif not read_own:problems.append(f"run {agent}: never read its own number")report[agent] = {"saw": len(seen), "read_own": read_own}return problems, report8 unmodified linesdef synthetic_run(root: Path, prompt: str = "", output: str = "",poster: dict | None = None) -> Path:"""A local run directory of AUDIT_TEAM as Flock leaves it, whose agents behave: each readsits number, posts it, reads the board. `prompt` joins agent-001's first prompt, `output` isa non-board command's output it gets before it reads the board, and `poster` posts a numberin another agent's name first (agent -> number)."""team = json.loads((HERE / NUMBERS_JSON).read_text())[AUDIT_TEAM]run = root / f"run-{len(list(root.iterdir()))}"(run / "agents" / "_sessions").mkdir(parents=True)(run / "run.json").write_text(json.dumps({"spec": {"types": {"agent": {"harbor": {"config": {"task": {"selector": AUDIT_TEAM}}}}}}}))board = run / "agents" / "_harbor" / "_worker" / "resources" / "message_board"board.mkdir(parents=True)lines = [f"{who}: my number is {g.words(number)} ({number})"4 unmodified lines"seq": k, "created_at": 1000.0 + k, "body": body, "sender": {"external_id": who}}})for k, (who, body) in enumerate(zip(senders, lines, strict=True), 1)](board / "board.jsonl").write_text("\n".join(board_lines) + "\n")instruction = (HERE / "tasks" / AUDIT_TEAM / "instruction.md").read_text()def message(role, content, **extra):return json.dumps({"type": "message", "message": {"role": role, "content": content,6 unmodified linesdef result(k, text):return message("toolResult", [{"type": "text", "text": text}], toolCallId=f"c{k}")for agent, word in team.items():events = [message("system", [{"type": "text", "text": "You are Pi."}]),message("user", [{"type": "text", "text": instruction + (prompt if agent == "agent-001" else "")}]),call(1, "echo $PRIVATE_NUMBER"), result(1, word)]if agent == "agent-001" and output:events += [call(2, "cat /tmp/notes.json"), result(2, output)]events += [call(3, "flock-tool message_board.read --json '{}'"),7 unmodified linesthe team's numbers pass, and each leak fails: words, the JSON answer, a mapping and a statednumber, in the first prompt or a non-board output before the board; and a number firstposted by an agent that doesn't hold it. Returns the cases checked."""team = json.loads((HERE / NUMBERS_JSON).read_text())[AUDIT_TEAM]numbers = [read_words(w) for w in team.values()] # agent-001's firstanswer = json.dumps(sorted(numbers))mapping = json.dumps({a: read_words(w) for a, w in team.items()})36 unmodified linesbefore = len(failures)check_files()print(f"3. no-cheat (files): {len(failures) - before} failures")before = len(failures)bindings = check_resource()print(f"4. no-cheat (resource): {len(failures) - before} failures; {bindings} bindings")if args.env != "none":before = len(failures)with tempfile.TemporaryDirectory() as d:jobs = args.jobs_dir or Path(d)jobs.mkdir(parents=True, exist_ok=True)report = asyncio.run(check_trials(args.env, jobs))print(f"5. no-cheat (Trials on {args.env}, {PROBE_TASK}): {len(failures) - before} "f"failures; {json.dumps(report)}")before = len(failures)cases = check_audit()print(f"6. no-cheat (the Flock-run audit on {cases} synthetic runs): "f"{len(failures) - before} failures")for run in args.run:before = len(failures)report = check_run(run)print(f"6. no-cheat (Flock run {run.name}): {len(failures) - before} failures; "f"{json.dumps(report)}")for failure in failures:print("FAIL:", failure)6 unmodified lines78910111213141516171819202122232425262728293031323334353637383940411 unmodified line4344454647484950515253545556575859606116 unmodified lines78798081828384855 unmodified lines9192939495969710 unmodified lines1081091101111121131141151161171181191201211221231241251266 unmodified lines133134135136137138139140141142143144145146147148149150151152153154155156157158156 unmodified lines31531631731831932032132232332432512 unmodified lines3383393403413423433443453463473483493503513523533543553563573583593603613621 unmodified line36436536636736836978 unmodified lines4484494504514524534544554564574584594601 unmodified line4624634644654664674689 unmodified lines4784794804814824834845 unmodified lines4904914924934944954964974987 unmodified lines5065075085095105115125 unmodified lines5185195205215225235245255265275285295305315325335345355365375385395405415 unmodified lines54754854955055155255355455555655755855956056156233 unmodified lines5965975985996006016026036046056066076086096106115 unmodified lines6176186196206216226231 unmodified line6256266276286296306316326 unmodified lines6396406416426436446456466474 unmodified lines6526536546556566576586596608 unmodified lines6696706716726736746756766776786796806816826836844 unmodified lines6896906916926936946 unmodified lines7017027037047057067077087097107117 unmodified lines71972072172272372472536 unmodified lines7627637647657667677687697707717727737747757767777787797807817827836 unmodified linesuv run check.py # all of them; the Trials run on HF Sandboxes (HF_TOKEN)uv run check.py --env docker # the Trials in local docker insteaduv run check.py --env none # skip the Trialsuv run check.py --run RUN_DIR # also a Flock run of a team (group 5)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 wordsread back to their numbers; a team `agg-pPP-nNN` has one task per slot, `-sKK`, whose answeris 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 ofevery 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-droppinganswer scores 0. On one team per size, malformed answers (missing, empty, not JSON, NaN, anobject, strings, words, floats, booleans, nested, a "####" prefix, invalid UTF-8) and cheatsscore 0: the answer as a symlink to the tests' expected.json (dangling until the testsarrive, absolute or relative), a symlink or a hardlink to a right answer elsewhere, ahardlink to expected.json, a symlinked /app (to a right answer, or to the tests' folder), anexpected.json planted as a link to the answer before the tests arrive, a directory and a FIFO(which must not hang the grader); and a wrong answer with Python made to read any answer asright: a json.py in the grader's working directory or on PYTHONPATH, a sitecustomize onPYTHONPATH, 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.3. No-cheat, in the files: a task folder holds only instruction.md, task.toml, tests/ andsolution/; its instruction states its own slot's number on one line and is otherwise the samefor every task of its team size, so it holds no teammate's number; the answer is only intests/ and solution/; and there is no folder beside tasks/ that holds numbers.4. No-cheat, from inside Trials (`--env`), on team `agg-p01-n16`, with probe agents (no model):- one per slot, each in its own slot's task, looks around the container while "the agentworks": no tests/ or solution/, no file holding the answer or a teammate's hyphenated numberword, no process whose environment or command line holds a teammate's number, and itsinstruction holds its own number and no teammate's; then it writes the answer, the samesearch finds it (a control), and the task's own verifier scores it 1;- the others leave a cheat with a wrong answer: /app/answer.json as a symlink to/tests/expected.json; a symlinked /app into a /tests they made; a json.py that reads anyanswer as right wherever the verifier may start; a sitecustomize in site-packages that1 unmodified line`--env` takes a Harbor environment type or an import path. Harbor 0.25.0's hf-sandboxuploads tests/ with the host's file owner, which a sandbox can't take when the host's uid isover 65535 (some clusters): use flock's `--env flock.harbor.envs:HFSandbox` there.5. No-cheat, a Flock run (`--run`, a local run's directory with its agents' event streams andthe board export; the team is the selector's `agg-pPP-nNN`, agent K on slot K): no systemprompt or first prompt holds a teammate's number, and each agent's first prompt holds itsown; the first output in which an agent sees a teammate's number is a board read, or a laterprompt (a wake-up quoting the board); and the first post holding each number is its owner's.A number counts in words ("twenty-six") and in digits where they read as a held number: anarray of the team's integers (the JSON answer, or part of it), an agent's number in amapping (`"agent-002": 26`) and a stated number (`number is 26`); bare ids, counts andtimestamps don't. The audit itself is checked on synthetic runs, always: a clean one and onewhose ids and timestamps hold the team's numbers pass, and each leak fails (a teammate'snumber in words, the JSON answer, a mapping and a stated number, in the first prompt or in anon-board output before the board, and a number first posted by an agent that doesn't holdit)."""import argparse16 unmodified linesTASK_FILES = {"instruction.md", "task.toml", "tests/test.sh", "tests/expected.json","solution/solve.sh"}PROBE_TEAM = "agg-p01-n16"NUMBER_LINE = re.compile(r"^Your private number is ([a-z-]+)\.$", re.MULTILINE)failures: list[str] = []5 unmodified linesdef files(root: Path) -> dict[str, bytes]:"""Relative path -> bytes for the generated files under root (not their modes: a downloadfrom the Hub has none, and Harbor runs the scripts with bash)."""out = {"problems.json": (root / "problems.json").read_bytes()}for path in sorted((root / "tasks").rglob("*")):if path.is_file():out[str(path.relative_to(root))] = path.read_bytes()10 unmodified linesreturn VALUES[head] + (VALUES[tail] if tail else 0)def team_of(task: str) -> tuple[int, int]:"""(problem, N) of a task or team name, `agg-pPP-nNN[-sKK]`."""m = re.match(r"agg-p(\d\d)-n(\d\d)", task)return int(m[1]), int(m[2])def held(team: str) -> dict[str, str]:"""A team's agents (Flock's consecutive names: agent K on slot K) and their numbers."""problem, n = team_of(team)numbers = json.loads((HERE / "problems.json").read_text())["problems"][f"p{problem:02d}"]return {f"agent-{k:03d}": g.words(x) for k, x in enumerate(numbers[:n], 1)}def check_generator() -> None:with tempfile.TemporaryDirectory() as d:g.generate(Path(d))6 unmodified lines"not 32 problems of 16 integers in 1..99")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 = []for p, numbers in enumerate(drawn, 1):for n in g.SIZES:team = numbers[:n]for slot, number in enumerate(team, 1):name = g.task_name(p, n, slot)names.append(name)task = HERE / "tasks" / nameexpected = json.loads((task / "tests" / "expected.json").read_text())check(expected == sorted(team), f"{name}: expected.json is not the first {n} sorted")stated = NUMBER_LINE.findall((task / "instruction.md").read_text())check(len(stated) == 1 and read_words(stated[0]) == number,f"{name}: the instruction does not state slot {slot}'s number ({stated})")check(sorted(p.name for p in (HERE / "tasks").iterdir()) == sorted(names),"tasks/ has other folders")for p, _ in enumerate(drawn, 1):for n in g.SIZES:slots = sorted(x for x in names if x.startswith(g.team_name(p, n) + "-"))check(slots == [g.task_name(p, n, k) for k in range(1, n + 1)],f"{g.team_name(p, n)}: its slots in name order are not slot order")def grade(task: Path, answer: bytes | None = None, cheat=None) -> int:156 unmodified linesdef check_graders() -> dict[str, int]:covered: dict[str, int] = {}for task in sorted((HERE / "tasks").glob("*-s01")): # slot 1 of every teamfor other in sorted(task.parent.glob(task.name.removesuffix("-s01") + "-s*")):check(all((other / f).read_bytes() == (task / f).read_bytes()for f in ("tests/test.sh", "tests/expected.json", "solution/solve.sh")),f"{other.name}: tests/ or solution/ differ from slot 1's")team = json.loads((task / "tests" / "expected.json").read_text())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()}12 unmodified linesfor task in sorted((HERE / "tasks").iterdir()):listed = {str(p.relative_to(task)) for p in task.rglob("*") if p.is_file()}check(listed == TASK_FILES, f"{task.name}: holds {sorted(listed ^ TASK_FILES)}")problem, n = team_of(task.name)slot = int(task.name.split("-s")[-1])toml = (task / "task.toml").read_text().replace(task.name, "TASK").replace(f"problem = {problem}\n", "problem = P\n").replace(f"slot = {slot}\n", "slot = K\n")text = (task / "instruction.md").read_text()own = held(task.name)[f"agent-{slot:03d}"]check(NUMBER_LINE.findall(text) == [own], f"{task.name}: its number line isn't its own")generic = NUMBER_LINE.sub("Your private number is NUMBER.", text) # no other numberby_size.setdefault(n, set()).add((generic, toml))answer = (task / "tests" / "expected.json").read_text().strip()holders = {str(p.relative_to(task)) for p in task.rglob("*")if p.is_file() and answer in p.read_text()}check(holders == {"tests/expected.json", "solution/solve.sh"},f"{task.name}: the answer is in {sorted(holders)}")check(all(len(v) == 1 for v in by_size.values()),"an instruction (but its number) or task.toml differs between tasks of one team size")beside = {p.name for p in HERE.iterdir() if p.is_dir()} - {"tasks", "flock", "eval", ".cache","__pycache__", ".git"}check(not beside, f"folders beside tasks/: {sorted(beside)}")def holds(text: str, words) -> set[str]:1 unmodified linereturn {w for w in words if re.search(rf"(?<![A-Za-z-]){re.escape(w)}(?![A-Za-z-])", text)}# Runs in the container as `python3 -c PROBE_PY <base64 config>`, so it holds no number word# itself: its own command line is searched too. In files it looks for the teammates' hyphenated# number words (a bare single-digit word is in many system files) and the answer.78 unmodified linesfrom harbor.agents.base import BaseAgentclass Probe(BaseAgent):"""No model. `mode` answer: in its slot's task, looks around the container as thatslot's agent could while it works, writes `probe.json` in its logs dir on the host, thenthe answer for the verifier. Any other mode: leaves that cheat (CHEATS) instead."""def __init__(self, *args, mode="answer", own="", others=(), answer="", **kwargs):super().__init__(*args, **kwargs)self.mode, self.answer = mode, answerself.own, self.others = own, list(others)@staticmethod1 unmodified linereturn "s3-aggregation-probe"def version(self) -> str:return "4"async def setup(self, environment) -> None:pass9 unmodified linesencoded = base64.b64encode(json.dumps({"own": self.own, "others": self.others, "answer": self.answer}).encode()).decode()result = await environment.exec(f"python3 -c {shlex.quote(PROBE_PY)} {encoded}",timeout_sec=600)line = next((x for x in (result.stdout or "").splitlines()if x.startswith("PROBE ")), None)found = json.loads(line.removeprefix("PROBE ")) if line else {}5 unmodified linesProbe = Noneasync def run_trial(env: str, jobs: Path, mode: str, kwargs: dict, task: str,name: str = "") -> tuple[dict | None, dict]:"""One Trial of `task` with the probe in `mode`: (its probe.json, rewards and error)."""from harbor.models.trial.config import (AgentConfig,EnvironmentConfig,7 unmodified linesif ":" in env elseEnvironmentConfig(type=env, kwargs=sandbox if env == "hf-sandbox" else {}))config = TrialConfig(task=TaskConfig(path=HERE / "tasks" / task), trial_name=f"probe-{name or mode}",trials_dir=jobs, environment=environment,agent=AgentConfig(import_path="__main__:Probe", kwargs={"mode": mode, **kwargs}))result = await (await Trial.create(config)).run()5 unmodified linesasync def check_trials(env: str, jobs: Path) -> dict:team = held(PROBE_TEAM)tasks = {agent: g.task_name(*team_of(PROBE_TEAM), int(agent[-3:])) for agent in team}answer = (HERE / "tasks" / tasks["agent-001"] / "tests" / "expected.json").read_text().strip()probes = {agent: {"own": own, "answer": answer,"others": sorted({w for w in team.values() if w != own})}for agent, own in team.items()}gate = asyncio.Semaphore(10) # sandboxes at onceasync def one(mode, kwargs, task, name=""):async with gate:return await run_trial(env, jobs, mode, kwargs, task, name)runs = await asyncio.gather(*(one("answer", kwargs, tasks[agent], agent) for agent, kwargs in probes.items()),*(one(mode, {}, tasks["agent-001"]) for mode in CHEATS))report = {}for (agent, kwargs), (probe, graded) in zip(probes.items(), runs[:len(probes)], strict=True):what = f"Trial {tasks[agent]}"ran = probe is not None and probe.get("return_code") == 0 and "files" in probecheck(ran, f"{what}: the probe did not run ({graded['error']})")if ran:5 unmodified linesf"number: {probe['env']}")check(not probe["cmdline"], f"{what}: a command line holds a teammate's number: "f"{probe['cmdline']}")check(probe["instruction_holds"] == [kwargs["own"]],f"{what}: the instruction holds {probe['instruction_holds']}, not just "f"{kwargs['own']}")check("/app/answer.json" in probe["control"],f"{what}: the search did not find the written answer ({probe['control']})")check(graded["rewards"] == {"reward": 1.0},f"{what}: the verifier gave the answer {graded['rewards']} ({graded['error']})")report[tasks[agent]] = {"instruction_holds": probe and probe.get("instruction_holds"),"processes": probe and probe.get("processes"),"teammates": len(kwargs["others"]), **graded}for mode, (left, result) in zip(CHEATS, runs[len(probes):], strict=True):check(left is not None and left["return_code"] == 0, f"Trial: cheat {mode} not left")check(result["rewards"] == {"reward": 0.0},33 unmodified linesdef audit_run(run: Path) -> tuple[list[str], dict]:"""(problems, report) for a Flock run of one team (a local run's `.flock/<swarm>-<time>/`):no prompt Flock gave an agent holds a teammate's number, and its first prompt holds its own;the first output in which an agent sees a teammate's number is a board read (or a wake-upthat quotes the board), and the first post holding each number is its owner's. A numbercounts as words or as digits (given_away)."""problems = []spec = json.loads((run / "run.json").read_text())["spec"]harbor = next(t["harbor"] for t in spec["types"].values() if t.get("harbor"))task = harbor["config"]["task"]["selector"] # agg-pPP-nNN-s*: agent K on slot Kteam = held(task)numbers = {agent: read_words(word) for agent, word in team.items()}boards = sorted(run.rglob("resources/message_board/board.jsonl"))if len(boards) != 1:problems.append(f"run {run.name}: {len(boards)} board exports")5 unmodified linesfor number in given_away(post["body"], team):first.setdefault(number, post["sender"]["external_id"])for number, who in first.items():if numbers.get(who) != number:problems.append(f"run {run.name}: {number} was first posted by {who}")report = {"task": task, "posts": len(posts), "first_posts": first}for agent, own in team.items():1 unmodified lineif not path.is_file():problems.append(f"run {run.name}: no event stream for {agent}")continueothers = set(numbers.values()) - {numbers[agent]}seen, calls, prompts, got_own = set(), {}, 0, Falsefor line in path.read_text().splitlines():event = json.loads(line) if line.strip() else {}message = event.get("message") or {}6 unmodified linescalls[part.get("id")] = json.dumps(part.get("arguments") or {})elif role in ("system", "user"):if role == "system" or prompts == 0: # what Flock and the task tell the agentif given := given_away(text, team) & others:problems.append(f"run {agent}: its {role} prompt holds {sorted(given)}")got_own |= role == "user" and own in holds(text, {own})else: # a later prompt may quote the board (a wake-up on a mention)seen |= given_away(text, team) & othersprompts += role == "user"4 unmodified linesproblems.append(f"run {agent}: first saw {sorted(new)} in the output of "f"{command[:120]}")seen |= newif not got_own:problems.append(f"run {agent}: its first prompt doesn't hold its own number")report[agent] = {"saw": len(seen), "got_own": got_own}return problems, report8 unmodified linesdef synthetic_run(root: Path, prompt: str = "", output: str = "",poster: dict | None = None) -> Path:"""A local run directory of AUDIT_TEAM as Flock leaves it, whose agents behave: each postsits number and reads the board. `prompt` joins agent-001's first prompt, `output` isa non-board command's output it gets before it reads the board, and `poster` posts a numberin another agent's name first (agent -> number). Each agent's first prompt is its own slot'sinstruction."""team = held(AUDIT_TEAM)run = root / f"run-{len(list(root.iterdir()))}"(run / "agents" / "_sessions").mkdir(parents=True)(run / "run.json").write_text(json.dumps({"spec": {"types": {"agent": {"harbor": {"config": {"task": {"selector": f"{AUDIT_TEAM}-s*"}}}}}}}))board = run / "agents" / "_harbor" / "_worker" / "resources" / "message_board"board.mkdir(parents=True)lines = [f"{who}: my number is {g.words(number)} ({number})"4 unmodified lines"seq": k, "created_at": 1000.0 + k, "body": body, "sender": {"external_id": who}}})for k, (who, body) in enumerate(zip(senders, lines, strict=True), 1)](board / "board.jsonl").write_text("\n".join(board_lines) + "\n")def message(role, content, **extra):return json.dumps({"type": "message", "message": {"role": role, "content": content,6 unmodified linesdef result(k, text):return message("toolResult", [{"type": "text", "text": text}], toolCallId=f"c{k}")for agent in team:own = HERE / "tasks" / f"{AUDIT_TEAM}-s{agent[-2:]}" / "instruction.md"events = [message("system", [{"type": "text", "text": "You are Pi."}]),message("user", [{"type": "text", "text": own.read_text() + (prompt if agent == "agent-001" else "")}])]if agent == "agent-001" and output:events += [call(2, "cat /tmp/notes.json"), result(2, output)]events += [call(3, "flock-tool message_board.read --json '{}'"),7 unmodified linesthe team's numbers pass, and each leak fails: words, the JSON answer, a mapping and a statednumber, in the first prompt or a non-board output before the board; and a number firstposted by an agent that doesn't hold it. Returns the cases checked."""team = held(AUDIT_TEAM)numbers = [read_words(w) for w in team.values()] # agent-001's firstanswer = json.dumps(sorted(numbers))mapping = json.dumps({a: read_words(w) for a, w in team.items()})36 unmodified linesbefore = len(failures)check_files()print(f"3. no-cheat (files): {len(failures) - before} failures")if args.env != "none":before = len(failures)with tempfile.TemporaryDirectory() as d:jobs = args.jobs_dir or Path(d)jobs.mkdir(parents=True, exist_ok=True)report = asyncio.run(check_trials(args.env, jobs))print(f"4. no-cheat (Trials on {args.env}, {PROBE_TEAM}): {len(failures) - before} "f"failures; {json.dumps(report)}")before = len(failures)cases = check_audit()print(f"5. no-cheat (the Flock-run audit on {cases} synthetic runs): "f"{len(failures) - before} failures")for run in args.run:before = len(failures)report = check_run(run)print(f"5. no-cheat (Flock run {run.name}): {len(failures) - before} failures; "f"{json.dumps(report)}")for failure in failures:print("FAIL:", failure)
224 unmodified lines225226227228229230231224 unmodified linesout = {"run": run_dir.name,"swarm": info["swarm"],"task": task.get("selector"),"dataset": task.get("repo"),"revision": task.get("revision"),"agents": len(team),224 unmodified lines225226227228229230231224 unmodified linesout = {"run": run_dir.name,"swarm": info["swarm"],"task": re.sub(r"-s\*$", "", task.get("selector") or "") or None, # a team's slots"dataset": task.get("repo"),"revision": task.get("revision"),"agents": len(team),
12345678910111213141516171819202122232425# s3-aggregation: N agents each hold a private number and list the team's numbers in ascending# order. The template of every team's spec: team.py fills in the team (TEAM), this dataset's# revision (REVISION) and resources folder (RESOURCES), and merges one of `where:` into it.# Don't launch this file; README.md.name: ${RUN_NAME:-TEAM} # team.py: the task's namemodel: Qwen/Qwen3.8-27Bnaming: consecutive-id # agent-001, ...: resources/numbers.json's namesinference:hf_router:provider: deepinfraapi_key_env: HF_INFERENCE_TOKEN # inference only: never the workers' HF_TOKENtask:repo: https://huggingface.co/datasets/HuggingFaceSwarms/s3-aggregation # private for nowselector: TEAM # team.py: agg-pPP-nNNrevision: REVISION # team.py: --revision, default the Hub's headagents:count: 1 # team.py: Nresources_dir: RESOURCES # team.py: this checkout's resources/resources:# Each agent's own number in its environment (PRIVATE_NUMBER), and no one else's.private_number:team: TEAM# The board rules: identical for every eval run, since they shape how agents talk.# Enforced on docker and podman (each agent's rule proxy); on HF Sandboxes there is no proxy,# so they are not enforced and each Trial records a message_board.warning event.123456789101112131415161718192021# s3-aggregation: N agents each hold a private number and list the team's numbers in ascending# order. The template of every team's spec: team.py fills in the team (TEAM) and this dataset's# revision (REVISION), and merges one of `where:` into it.# Don't launch this file; README.md.name: ${RUN_NAME:-TEAM} # team.py: the task's namemodel: Qwen/Qwen3.8-27Bnaming: consecutive-id # agent-00K runs slot K's task (the K-th by name)inference:hf_router:provider: deepinfraapi_key_env: HF_INFERENCE_TOKEN # inference only: never the workers' HF_TOKENtask:repo: https://huggingface.co/datasets/HuggingFaceSwarms/s3-aggregation # private for nowselector: TEAM-s* # one task per agent: agg-pPP-nNN-s01 ...revision: REVISION # team.py: --revision, default the Hub's headagents:count: 1 # team.py: Nresources:# The board rules: identical for every eval run, since they shape how agents talk.# Enforced on docker and podman (each agent's rule proxy); on HF Sandboxes there is no proxy,# so they are not enforced and each Trial records a message_board.warning event.
71 unmodified lines7273747576777871 unmodified lines| Agents | Qwen3-0.6B trained with RL at N = 4, and its controls | `Qwen/Qwen3.5-27B` and `Qwen/Qwen3.5-2B`, not trained: one prompted condition each || Harness | their asynchronous harness: `message(to, text)` and `read_messages()`, notifications that interrupt generation, idle until a message arrives | Pi in a container per agent, with flock's board tools (`flock-tool message_board.*`) through its shell; a shared `#general` channel, mentions and a long-poll `wait`; flock's loop prompts again at each turn's end || Messages | to one teammate or broadcast | posts on a board every agent reads; private channels possible || Private number | in the agent's prompt | in its environment (`PRIVATE_NUMBER`, from `resources/private_number.py`), read with a shell command || Names | sampled from `agent_1`..`agent_64`, teammates in shuffled order | `agent-001`..`agent-00N`, in order || Budget | 8,192 work tokens + 1,024 for the answer per agent; reward reduced by tokens used | no token allowance: 60 model calls per prompt, 4 loop rounds, 15 min, 10 min per turn, 262,144-token window || Answer | `####` and a JSON array, from any agent active at the end | `/app/answer.json` per agent, graded after the run; the team succeeds if any agent's is right |71 unmodified lines7273747576777871 unmodified lines| Agents | Qwen3-0.6B trained with RL at N = 4, and its controls | `Qwen/Qwen3.5-27B` and `Qwen/Qwen3.5-2B`, not trained: one prompted condition each || Harness | their asynchronous harness: `message(to, text)` and `read_messages()`, notifications that interrupt generation, idle until a message arrives | Pi in a container per agent, with flock's board tools (`flock-tool message_board.*`) through its shell; a shared `#general` channel, mentions and a long-poll `wait`; flock's loop prompts again at each turn's end || Messages | to one teammate or broadcast | posts on a board every agent reads; private channels possible || Private number | in the agent's prompt | in its own task's instruction (one task per slot) || Names | sampled from `agent_1`..`agent_64`, teammates in shuffled order | `agent-001`..`agent-00N`, in order || Budget | 8,192 work tokens + 1,024 for the answer per agent; reward reduced by tokens used | no token allowance: 60 model calls per prompt, 4 loop rounds, 15 min, 10 min per turn, 262,144-token window || Answer | `####` and a JSON array, from any agent active at the end | `/app/answer.json` per agent, graded after the run; the team succeeds if any agent's is right |
2 unmodified lines345678910111213142 unmodified lines1718192021222324252627282922 unmodified lines525354555657585960616263646566676869707172732 unmodified linesuv run python <this dataset>/flock/team.py --problem 7 --agents 4 [--where docker|sandbox|cluster]writes `out/agg-p07-n04/spec.yaml` next to this script (or `--out DIR`) from spec.template.yaml:the task `agg-p07-n04` at `--revision` (default: the dataset's head on the Hub), 4 agents(agent-001 .. agent-004, one worker and board), and this checkout's `resources/` as the spec's`resources_dir`, whose `private_number` gives each agent its own number. The local`resources/numbers.json` must be the revision's, which this checks. `--where` picks thetemplate's `where:` block: local docker, HF Sandboxes with a Space board, or the HF cluster witha local board. The dataset is private for now: HF_TOKEN must read it."""import argparse2 unmodified linesfrom pathlib import Pathimport yamlfrom huggingface_hub import HfApi, hf_hub_downloadfrom flock.models import load_spec_yamlHERE = Path(__file__).resolve().parentDATASET = "HuggingFaceSwarms/s3-aggregation"RESOURCES = HERE.parent / "resources"PROBLEMS, SIZES = range(1, 33), (1, 2, 4, 8, 16)22 unmodified linestemplate = copy.deepcopy(template)places = template.pop("where")task = f"agg-p{problem:02d}-n{agents:02d}"spec = fill(merge(template, places[where]),{"TEAM": task, "REVISION": revision, "RESOURCES": str(RESOURCES)})spec["agents"] = {"count": agents}spec["workers"]["agents_per_worker"] = agentsreturn task, specdef pinned(revision: str | None) -> str:"""The revision as a commit, whose resources/numbers.json must be this checkout's."""sha = HfApi().dataset_info(DATASET, revision=revision).sharemote = Path(hf_hub_download(DATASET, "resources/numbers.json", repo_type="dataset",revision=sha))if remote.read_bytes() != (RESOURCES / "numbers.json").read_bytes():raise SystemExit(f"{RESOURCES / 'numbers.json'} is not {DATASET}@{sha[:7]}'s: download ""that revision, or pass the --revision of this checkout")return shadef main(argv=None) -> int:2 unmodified lines3456789101112132 unmodified lines16171819202122232425262722 unmodified lines5051525354555657585960616263642 unmodified linesuv run python <this dataset>/flock/team.py --problem 7 --agents 4 [--where docker|sandbox|cluster]writes `out/agg-p07-n04/spec.yaml` next to this script (or `--out DIR`) from spec.template.yaml:the team `agg-p07-n04` at `--revision` (default: the dataset's head on the Hub), its 4 agents(agent-001 .. agent-004, one worker and board) on the selector `agg-p07-n04-s*`, so that agent Kruns slot K's task, the one that states its number. `--where` picks the template's `where:`block: local docker, HF Sandboxes with a Space board, or the HF cluster with a local board. Thedataset is private for now: HF_TOKEN must read it."""import argparse2 unmodified linesfrom pathlib import Pathimport yamlfrom huggingface_hub import HfApifrom flock.models import load_spec_yamlHERE = Path(__file__).resolve().parentDATASET = "HuggingFaceSwarms/s3-aggregation"PROBLEMS, SIZES = range(1, 33), (1, 2, 4, 8, 16)22 unmodified linestemplate = copy.deepcopy(template)places = template.pop("where")task = f"agg-p{problem:02d}-n{agents:02d}"spec = fill(merge(template, places[where]), {"TEAM": task, "REVISION": revision})spec["agents"] = {"count": agents}spec["workers"]["agents_per_worker"] = agentsreturn task, specdef pinned(revision: str | None) -> str:"""The revision (default: the dataset's head) as a commit."""return HfApi().dataset_info(DATASET, revision=revision).shadef main(argv=None) -> int:
12345678910111213149 unmodified lines2425262728293017 unmodified lines48495051525354555657585960616263646566676869701 unmodified line7273747576777879808110 unmodified lines92939495969798991001011021 unmodified line1041051061071081091 unmodified line111112113114115116117118110 unmodified lines2292302312322332342352362372382392402412421 unmodified line244245246247248249250251252253254255256257258259260"""Regenerate s3-aggregation from its seed: `python generate.py` (Python 3.10+, no dependencies).Writes `problems.json`, `tasks/` and `resources/numbers.json` next to this file, replacing whatis there:- 32 problems, each 16 integers drawn uniformly from 1 to 99 (repeats allowed), from SEED;- one task per problem and team size N in SIZES, `agg-pPP-nNN`, whose team holds the problem'sfirst N numbers;- `resources/numbers.json`: each task's agents (Flock's `naming: consecutive-id`, agent-001 ...)and the number each holds, in words. Flock's worker reads it through`resources/private_number.py`, which puts only an agent's own number in its environment, sono task folder, instruction or container holds another agent's number.check.py checks that this reproduces the committed files byte for byte."""9 unmodified linesSIZES = (1, 2, 4, 8, 16)LOW, HIGH = 1, 99IMAGE = "python:3.12-slim" # public and prebuilt: HF Sandboxes need one, docker and podman tooENV = "PRIVATE_NUMBER" # where an agent finds its own number (resources/private_number.py)ONES = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten","eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen",17 unmodified linesreturn [[rng.randint(LOW, HIGH) for _ in range(NUMBERS)] for _ in range(PROBLEMS)]def task_name(problem: int, n: int) -> str:"""`problem` counts from 1."""return f"agg-p{problem:02d}-n{n:02d}"def agent_name(slot: int) -> str:"""Flock's `naming: consecutive-id`: the slot's agent, from 1."""return f"agent-{slot:03d}"def instruction(n: int) -> str:if n == 1:return f"""# Sort the team's private numbersYou are the only agent on this team, solving a private-information number sorting task. Youhold one private integer from 1 to 99, written in English words. It is in your environment,in the variable `{ENV}`: run `echo ${ENV}` to read it.Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numericvalue, as digits. Then stop.1 unmodified linereturn f"""# Sort the team's private numbersYou are on a team of {n} agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. Yours is in your environment,in the variable `{ENV}`: run `echo ${ENV}` to read it. You know only your ownnumber, and the others don't know it unless you tell them.The team must find all {n} 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.10 unmodified lines"""def task_toml(problem: int, n: int) -> str:return f"""schema_version = "1.4"[task]name = "HuggingFaceSwarms/{task_name(problem, n)}"version = "0.1.0"description = "s3-aggregation: {n} agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]1 unmodified line[metadata]problem = {problem}agents = {n}seed = {SEED}[agent]1 unmodified line[environment]# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it# too. Nothing task-specific is in the container: each agent's number reaches it only through# its own environment (resources/private_number.py), and tests/ arrive only when the agent is done.docker_image = "{IMAGE}"cpus = 1memory_mb = 1024110 unmodified linespath.chmod(mode)def numbers_json(drawn: list[list[int]]) -> str:"""Each task's agents and their numbers in words: one line per task."""teams = {task_name(p, n): {agent_name(k): words(x) for k, x in enumerate(numbers[:n], 1)}for p, numbers in enumerate(drawn, 1) for n in SIZES}rows = ",\n".join(f" {json.dumps(task)}: {json.dumps(team)}" for task, team in teams.items())return f"{{\n{rows}\n}}\n"def generate(root: Path = HERE, seed: int = SEED) -> None:shutil.rmtree(root / "tasks", ignore_errors=True)drawn = problems(seed)1 unmodified linewrite(root / "problems.json", f'{{"seed": {seed}, "problems": {{\n{rows}\n}}}}\n')for p, numbers in enumerate(drawn, 1):for n in SIZES:team, name = numbers[:n], task_name(p, n)task = root / "tasks" / namewrite(task / "instruction.md", instruction(n))write(task / "task.toml", task_toml(p, n))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)write(root / "resources" / "numbers.json", numbers_json(drawn))if __name__ == "__main__":generate()print(f"{PROBLEMS} problems x {len(SIZES)} team sizes = {PROBLEMS * len(SIZES)} tasks "f"(seed {SEED})")123456789101112139 unmodified lines23242526272817 unmodified lines4647484950515253545556575859606162636465666768691 unmodified line717273747576777879808110 unmodified lines92939495969798991001011021 unmodified line1041051061071081091101 unmodified line112113114115116117118119110 unmodified lines2302312322332342351 unmodified line237238239240241242243244245246247248249250251252253"""Regenerate s3-aggregation from its seed: `python generate.py` (Python 3.10+, no dependencies).Writes `problems.json` and `tasks/` next to this file, replacing what is there:- 32 problems, each 16 integers drawn uniformly from 1 to 99 (repeats allowed), from SEED;- per problem and team size N in SIZES, a team `agg-pPP-nNN` that holds the problem's first Nnumbers, and one task per slot of it, `agg-pPP-nNN-sKK` (K = 1..N, zero-padded so that nameorder is slot order): its instruction states that slot's number, and only that one. Everyslot of a team shares the grader and the answer. Flock runs a team with the selector`agg-pPP-nNN-s*`, `agents.count: N` and `naming: consecutive-id`: agent K gets slot K's task,and no other agent's.check.py checks that this reproduces the committed files byte for byte."""9 unmodified linesSIZES = (1, 2, 4, 8, 16)LOW, HIGH = 1, 99IMAGE = "python:3.12-slim" # public and prebuilt: HF Sandboxes need one, docker and podman tooONES = ["", "one", "two", "three", "four", "five", "six", "seven", "eight", "nine", "ten","eleven", "twelve", "thirteen", "fourteen", "fifteen", "sixteen", "seventeen",17 unmodified linesreturn [[rng.randint(LOW, HIGH) for _ in range(NUMBERS)] for _ in range(PROBLEMS)]def team_name(problem: int, n: int) -> str:"""`problem` counts from 1."""return f"agg-p{problem:02d}-n{n:02d}"def task_name(problem: int, n: int, slot: int) -> str:"""Slot `slot` (from 1) of the team: Flock's agent `agent-00K` (naming: consecutive-id)."""return f"{team_name(problem, n)}-s{slot:02d}"def instruction(n: int, number: int) -> str:if n == 1:return f"""# Sort the team's private numbersYou are the only agent on this team, solving a private-information number sorting task. Youhold one private integer from 1 to 99, written in English words.Your 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.1 unmodified linereturn f"""# Sort the team's private numbersYou are on a team of {n} 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 {words(number)}.The team must find all {n} 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.10 unmodified lines"""def task_toml(problem: int, n: int, slot: int) -> str:return f"""schema_version = "1.4"[task]name = "HuggingFaceSwarms/{task_name(problem, n, slot)}"version = "0.1.0"description = "s3-aggregation: {n} agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]1 unmodified line[metadata]problem = {problem}agents = {n}slot = {slot}seed = {SEED}[agent]1 unmodified line[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 = "{IMAGE}"cpus = 1memory_mb = 1024110 unmodified linespath.chmod(mode)def generate(root: Path = HERE, seed: int = SEED) -> None:shutil.rmtree(root / "tasks", ignore_errors=True)drawn = problems(seed)1 unmodified linewrite(root / "problems.json", f'{{"seed": {seed}, "problems": {{\n{rows}\n}}}}\n')for p, numbers in enumerate(drawn, 1):for n in SIZES:team = numbers[:n]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 / "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)if __name__ == "__main__":generate()print(f"{PROBLEMS} problems x {len(SIZES)} team sizes = {PROBLEMS * len(SIZES)} teams, "f"{PROBLEMS * sum(SIZES)} tasks, one per slot (seed {SEED})")
12345"""Flock's own message board, unchanged. A spec's `resources_dir` replaces Flock's built-inresources folder, so this folder brings the board along: the module Flock ships, imported fromthe Flock that runs the worker."""
from flock.harbor.builtin.resources.message_board import Options, Resource # noqa: F401123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162{ "agg-p01-n01": {"agent-001": "thirty-seven"}, "agg-p01-n02": {"agent-001": "thirty-seven", "agent-002": "twenty-six"}, "agg-p01-n04": {"agent-001": "thirty-seven", "agent-002": "twenty-six", "agent-003": "fifteen", "agent-004": "sixty-nine"}, "agg-p01-n08": {"agent-001": "thirty-seven", "agent-002": "twenty-six", "agent-003": "fifteen", "agent-004": "sixty-nine", "agent-005": "fifteen", "agent-006": "forty-three", "agent-007": "ninety-seven", "agent-008": "seventy-one"}, "agg-p01-n16": {"agent-001": "thirty-seven", "agent-002": "twenty-six", "agent-003": "fifteen", "agent-004": "sixty-nine", "agent-005": "fifteen", "agent-006": "forty-three", "agent-007": "ninety-seven", "agent-008": "seventy-one", "agent-009": "thirty-eight", "agent-010": "eighty-seven", "agent-011": "eighty-two", "agent-012": "thirty-seven", "agent-013": "eighty-eight", "agent-014": "forty-four", "agent-015": "sixty-two", "agent-016": "eight"}, "agg-p02-n01": {"agent-001": "seventy-one"}, "agg-p02-n02": {"agent-001": "seventy-one", "agent-002": "seventy-one"}, "agg-p02-n04": {"agent-001": "seventy-one", "agent-002": "seventy-one", "agent-003": "nineteen", "agent-004": "twenty"}, "agg-p02-n08": {"agent-001": "seventy-one", "agent-002": "seventy-one", "agent-003": "nineteen", "agent-004": "twenty", "agent-005": "six", "agent-006": "thirty-seven", "agent-007": "twenty-three", "agent-008": "sixty-three"}, "agg-p02-n16": {"agent-001": "seventy-one", "agent-002": "seventy-one", "agent-003": "nineteen", "agent-004": "twenty", "agent-005": "six", "agent-006": "thirty-seven", "agent-007": "twenty-three", "agent-008": "sixty-three", "agent-009": "ninety-five", "agent-010": "seventy-six", "agent-011": "thirty-two", "agent-012": "twenty-two", "agent-013": "twenty-four", "agent-014": "nineteen", "agent-015": "sixty-eight", "agent-016": "twenty-eight"}, "agg-p03-n01": {"agent-001": "nineteen"}, "agg-p03-n02": {"agent-001": "nineteen", "agent-002": "eighty-one"}, "agg-p03-n04": {"agent-001": "nineteen", "agent-002": "eighty-one", "agent-003": "eighty-nine", "agent-004": "fifty-five"}, "agg-p03-n08": {"agent-001": "nineteen", "agent-002": "eighty-one", "agent-003": "eighty-nine", "agent-004": "fifty-five", "agent-005": "two", "agent-006": "ninety-two", "agent-007": "twenty-six", "agent-008": "sixty-eight"}, "agg-p03-n16": {"agent-001": "nineteen", "agent-002": "eighty-one", "agent-003": "eighty-nine", "agent-004": "fifty-five", "agent-005": "two", "agent-006": "ninety-two", "agent-007": "twenty-six", "agent-008": "sixty-eight", "agent-009": "forty-three", "agent-010": "seventy-eight", "agent-011": "thirty-two", "agent-012": "eighty-three", "agent-013": "ninety-two", "agent-014": "thirty-six", "agent-015": "seventy-seven", "agent-016": "thirty"}, "agg-p04-n01": {"agent-001": "thirty-three"}, "agg-p04-n02": {"agent-001": "thirty-three", "agent-002": "fifty-three"}, "agg-p04-n04": {"agent-001": "thirty-three", "agent-002": "fifty-three", "agent-003": "forty-eight", "agent-004": "seventy-one"}, "agg-p04-n08": {"agent-001": "thirty-three", "agent-002": "fifty-three", "agent-003": "forty-eight", "agent-004": "seventy-one", "agent-005": "twenty-five", "agent-006": "sixty-two", "agent-007": "eighty-seven", "agent-008": "ninety"}, "agg-p04-n16": {"agent-001": "thirty-three", "agent-002": "fifty-three", "agent-003": "forty-eight", "agent-004": "seventy-one", "agent-005": "twenty-five", "agent-006": "sixty-two", "agent-007": "eighty-seven", "agent-008": "ninety", "agent-009": "forty-four", "agent-010": "twenty-four", "agent-011": "ninety-seven", "agent-012": "seventy-seven", "agent-013": "seventy-nine", "agent-014": "fifty-two", "agent-015": "ninety-five", "agent-016": "seventy-four"}, "agg-p05-n01": {"agent-001": "eighty-seven"}, "agg-p05-n02": {"agent-001": "eighty-seven", "agent-002": "ninety-three"}, "agg-p05-n04": {"agent-001": "eighty-seven", "agent-002": "ninety-three", "agent-003": "ninety-six", "agent-004": "fifty-seven"}, "agg-p05-n08": {"agent-001": "eighty-seven", "agent-002": "ninety-three", "agent-003": "ninety-six", "agent-004": "fifty-seven", "agent-005": "forty", "agent-006": "twenty-five", "agent-007": "sixty-eight", "agent-008": "eighty-four"}, "agg-p05-n16": {"agent-001": "eighty-seven", "agent-002": "ninety-three", "agent-003": "ninety-six", "agent-004": "fifty-seven", "agent-005": "forty", "agent-006": "twenty-five", "agent-007": "sixty-eight", "agent-008": "eighty-four", "agent-009": "eighteen", "agent-010": "seventy-nine", "agent-011": "forty-three", "agent-012": "sixty-six", "agent-013": "thirty-three", "agent-014": "seventy-one", "agent-015": "seventy", "agent-016": "eighty-two"}, "agg-p06-n01": {"agent-001": "seventy-six"}, "agg-p06-n02": {"agent-001": "seventy-six", "agent-002": "twenty-three"}, "agg-p06-n04": {"agent-001": "seventy-six", "agent-002": "twenty-three", "agent-003": "eight", "agent-004": "eighty-five"}, "agg-p06-n08": {"agent-001": "seventy-six", "agent-002": "twenty-three", "agent-003": "eight", "agent-004": "eighty-five", "agent-005": "eleven", "agent-006": "fifty-four", "agent-007": "seventy-eight", "agent-008": "thirty-five"}, "agg-p06-n16": {"agent-001": "seventy-six", "agent-002": "twenty-three", "agent-003": "eight", "agent-004": "eighty-five", "agent-005": "eleven", "agent-006": "fifty-four", "agent-007": "seventy-eight", "agent-008": "thirty-five", "agent-009": "four", "agent-010": "five", "agent-011": "eighteen", "agent-012": "seven", "agent-013": "sixty-six", "agent-014": "thirty-eight", "agent-015": "fifty-four", "agent-016": "eighty-nine"}, "agg-p07-n01": {"agent-001": "forty-nine"}, "agg-p07-n02": {"agent-001": "forty-nine", "agent-002": "thirty-six"}, "agg-p07-n04": {"agent-001": "forty-nine", "agent-002": "thirty-six", "agent-003": "thirty-eight", "agent-004": "forty-eight"}, "agg-p07-n08": {"agent-001": "forty-nine", "agent-002": "thirty-six", "agent-003": "thirty-eight", "agent-004": "forty-eight", "agent-005": "fifty-four", "agent-006": "twenty-two", "agent-007": "eighty-eight", "agent-008": "eight"}, "agg-p07-n16": {"agent-001": "forty-nine", "agent-002": "thirty-six", "agent-003": "thirty-eight", "agent-004": "forty-eight", "agent-005": "fifty-four", "agent-006": "twenty-two", "agent-007": "eighty-eight", "agent-008": "eight", "agent-009": "sixty-six", "agent-010": "twenty-five", "agent-011": "sixteen", "agent-012": "seventy-eight", "agent-013": "nine", "agent-014": "forty-two", "agent-015": "eighty-six", "agent-016": "two"}, "agg-p08-n01": {"agent-001": "thirty-seven"}, "agg-p08-n02": {"agent-001": "thirty-seven", "agent-002": "seventy-one"}, "agg-p08-n04": {"agent-001": "thirty-seven", "agent-002": "seventy-one", "agent-003": "eighty-eight", "agent-004": "forty-four"}, "agg-p08-n08": {"agent-001": "thirty-seven", "agent-002": "seventy-one", "agent-003": "eighty-eight", "agent-004": "forty-four", "agent-005": "sixty-six", "agent-006": "sixty-eight", "agent-007": "twenty-four", "agent-008": "thirty-five"}, "agg-p08-n16": {"agent-001": "thirty-seven", "agent-002": "seventy-one", "agent-003": "eighty-eight", "agent-004": "forty-four", "agent-005": "sixty-six", "agent-006": "sixty-eight", "agent-007": "twenty-four", "agent-008": "thirty-five", "agent-009": "fifty-six", "agent-010": "seventy", "agent-011": "seventy-six", "agent-012": "seventy", "agent-013": "sixty-four", "agent-014": "ninety-two", "agent-015": "eighty-four", "agent-016": "twenty-three"}, "agg-p09-n01": {"agent-001": "forty"}, "agg-p09-n02": {"agent-001": "forty", "agent-002": "sixty-seven"}, "agg-p09-n04": {"agent-001": "forty", "agent-002": "sixty-seven", "agent-003": "sixty-five", "agent-004": "forty-three"}, "agg-p09-n08": {"agent-001": "forty", "agent-002": "sixty-seven", "agent-003": "sixty-five", "agent-004": "forty-three", "agent-005": "sixty", "agent-006": "sixty-six", "agent-007": "fourteen", "agent-008": "eighteen"}, "agg-p09-n16": {"agent-001": "forty", "agent-002": "sixty-seven", "agent-003": "sixty-five", "agent-004": "forty-three", "agent-005": "sixty", "agent-006": "sixty-six", "agent-007": "fourteen", "agent-008": "eighteen", "agent-009": "eighty-eight", "agent-010": "eighty-one", "agent-011": "eight", "agent-012": "twenty", "agent-013": "fourteen", "agent-014": "sixty-eight", "agent-015": "thirty-one", "agent-016": "sixty-three"}, "agg-p10-n01": {"agent-001": "sixty-nine"}, "agg-p10-n02": {"agent-001": "sixty-nine", "agent-002": "five"}, "agg-p10-n04": {"agent-001": "sixty-nine", "agent-002": "five", "agent-003": "nineteen", "agent-004": "twelve"}, "agg-p10-n08": {"agent-001": "sixty-nine", "agent-002": "five", "agent-003": "nineteen", "agent-004": "twelve", "agent-005": "seventy-nine", "agent-006": "fifty-one", "agent-007": "sixty-three", "agent-008": "thirty-two"}, "agg-p10-n16": {"agent-001": "sixty-nine", "agent-002": "five", "agent-003": "nineteen", "agent-004": "twelve", "agent-005": "seventy-nine", "agent-006": "fifty-one", "agent-007": "sixty-three", "agent-008": "thirty-two", "agent-009": "ninety-six", "agent-010": "twenty-five", "agent-011": "four", "agent-012": "fifty-six", "agent-013": "twelve", "agent-014": "eighty-six", "agent-015": "fifty-eight", "agent-016": "seventy-five"}, "agg-p11-n01": {"agent-001": "twelve"}, "agg-p11-n02": {"agent-001": "twelve", "agent-002": "ninety-eight"}, "agg-p11-n04": {"agent-001": "twelve", "agent-002": "ninety-eight", "agent-003": "seventy-five", "agent-004": "seventy-eight"}, "agg-p11-n08": {"agent-001": "twelve", "agent-002": "ninety-eight", "agent-003": "seventy-five", "agent-004": "seventy-eight", "agent-005": "sixty-seven", "agent-006": "eighty-four", "agent-007": "twenty-five", "agent-008": "eleven"}, "agg-p11-n16": {"agent-001": "twelve", "agent-002": "ninety-eight", "agent-003": "seventy-five", "agent-004": "seventy-eight", "agent-005": "sixty-seven", "agent-006": "eighty-four", "agent-007": "twenty-five", "agent-008": "eleven", "agent-009": "forty", "agent-010": "twenty-three", "agent-011": "ninety-four", "agent-012": "seventy-four", "agent-013": "sixteen", "agent-014": "four", "agent-015": "seventy-four", "agent-016": "forty-two"}, "agg-p12-n01": {"agent-001": "two"}, "agg-p12-n02": {"agent-001": "two", "agent-002": "fifty"}, "agg-p12-n04": {"agent-001": "two", "agent-002": "fifty", "agent-003": "ninety-five", "agent-004": "twelve"}, "agg-p12-n08": {"agent-001": "two", "agent-002": "fifty", "agent-003": "ninety-five", "agent-004": "twelve", "agent-005": "ninety-nine", "agent-006": "thirty", "agent-007": "fifteen", "agent-008": "thirty-one"}, "agg-p12-n16": {"agent-001": "two", "agent-002": "fifty", "agent-003": "ninety-five", "agent-004": "twelve", "agent-005": "ninety-nine", "agent-006": "thirty", "agent-007": "fifteen", "agent-008": "thirty-one", "agent-009": "forty-five", "agent-010": "forty-four", "agent-011": "thirty-one", "agent-012": "thirty-three", "agent-013": "twenty-four", "agent-014": "ninety-five", "agent-015": "seventy-nine", "agent-016": "eleven"}, "agg-p13-n01": {"agent-001": "forty-two"}, "agg-p13-n02": {"agent-001": "forty-two", "agent-002": "seventy-eight"}, "agg-p13-n04": {"agent-001": "forty-two", "agent-002": "seventy-eight", "agent-003": "forty-eight", "agent-004": "sixty-one"}, "agg-p13-n08": {"agent-001": "forty-two", "agent-002": "seventy-eight", "agent-003": "forty-eight", "agent-004": "sixty-one", "agent-005": "forty-seven", "agent-006": "fifty-six", "agent-007": "two", "agent-008": "two"}, "agg-p13-n16": {"agent-001": "forty-two", "agent-002": "seventy-eight", "agent-003": "forty-eight", "agent-004": "sixty-one", "agent-005": "forty-seven", "agent-006": "fifty-six", "agent-007": "two", "agent-008": "two", "agent-009": "twenty-three", "agent-010": "eighty-two", "agent-011": "sixty-two", "agent-012": "twenty-five", "agent-013": "eighty-five", "agent-014": "sixty-eight", "agent-015": "sixty", "agent-016": "ninety-three"}, "agg-p14-n01": {"agent-001": "eighty-four"}, "agg-p14-n02": {"agent-001": "eighty-four", "agent-002": "twenty-nine"}, "agg-p14-n04": {"agent-001": "eighty-four", "agent-002": "twenty-nine", "agent-003": "fifty-three", "agent-004": "forty-nine"}, "agg-p14-n08": {"agent-001": "eighty-four", "agent-002": "twenty-nine", "agent-003": "fifty-three", "agent-004": "forty-nine", "agent-005": "forty-four", "agent-006": "twenty-five", "agent-007": "fifty-nine", "agent-008": "thirty-nine"}, "agg-p14-n16": {"agent-001": "eighty-four", "agent-002": "twenty-nine", "agent-003": "fifty-three", "agent-004": "forty-nine", "agent-005": "forty-four", "agent-006": "twenty-five", "agent-007": "fifty-nine", "agent-008": "thirty-nine", "agent-009": "ninety-six", "agent-010": "seventy-two", "agent-011": "seventy-eight", "agent-012": "one", "agent-013": "thirty-seven", "agent-014": "fifty-one", "agent-015": "forty-five", "agent-016": "eleven"}, "agg-p15-n01": {"agent-001": "thirty-seven"}, "agg-p15-n02": {"agent-001": "thirty-seven", "agent-002": "twenty-nine"}, "agg-p15-n04": {"agent-001": "thirty-seven", "agent-002": "twenty-nine", "agent-003": "fifty-seven", "agent-004": "eighteen"}, "agg-p15-n08": {"agent-001": "thirty-seven", "agent-002": "twenty-nine", "agent-003": "fifty-seven", "agent-004": "eighteen", "agent-005": "forty-nine", "agent-006": "seventy-nine", "agent-007": "fifty", "agent-008": "sixty-two"}, "agg-p15-n16": {"agent-001": "thirty-seven", "agent-002": "twenty-nine", "agent-003": "fifty-seven", "agent-004": "eighteen", "agent-005": "forty-nine", "agent-006": "seventy-nine", "agent-007": "fifty", "agent-008": "sixty-two", "agent-009": "fifty-three", "agent-010": "thirty", "agent-011": "forty-three", "agent-012": "thirty", "agent-013": "seventy-eight", "agent-014": "eighty-two", "agent-015": "twenty-seven", "agent-016": "forty"}, "agg-p16-n01": {"agent-001": "thirty-eight"}, "agg-p16-n02": {"agent-001": "thirty-eight", "agent-002": "sixty-three"}, "agg-p16-n04": {"agent-001": "thirty-eight", "agent-002": "sixty-three", "agent-003": "thirty", "agent-004": "sixty-three"}, "agg-p16-n08": {"agent-001": "thirty-eight", "agent-002": "sixty-three", "agent-003": "thirty", "agent-004": "sixty-three", "agent-005": "fifty-one", "agent-006": "seventy-eight", "agent-007": "fifty-eight", "agent-008": "eighty-one"}, "agg-p16-n16": {"agent-001": "thirty-eight", "agent-002": "sixty-three", "agent-003": "thirty", "agent-004": "sixty-three", "agent-005": "fifty-one", "agent-006": "seventy-eight", "agent-007": "fifty-eight", "agent-008": "eighty-one", "agent-009": "two", "agent-010": "eighteen", "agent-011": "eighty-eight", "agent-012": "ten", "agent-013": "fifty-eight", "agent-014": "thirty-five", "agent-015": "ninety-two", "agent-016": "sixteen"}, "agg-p17-n01": {"agent-001": "forty"}, "agg-p17-n02": {"agent-001": "forty", "agent-002": "ten"}, "agg-p17-n04": {"agent-001": "forty", "agent-002": "ten", "agent-003": "ninety-five", "agent-004": "thirty-one"}, "agg-p17-n08": {"agent-001": "forty", "agent-002": "ten", "agent-003": "ninety-five", "agent-004": "thirty-one", "agent-005": "ninety-nine", "agent-006": "seventy-seven", "agent-007": "ninety", "agent-008": "seventy"}, "agg-p17-n16": {"agent-001": "forty", "agent-002": "ten", "agent-003": "ninety-five", "agent-004": "thirty-one", "agent-005": "ninety-nine", "agent-006": "seventy-seven", "agent-007": "ninety", "agent-008": "seventy", "agent-009": "forty-three", "agent-010": "two", "agent-011": "seventy-eight", "agent-012": "thirty-four", "agent-013": "seventy-six", "agent-014": "thirty-eight", "agent-015": "seventy", "agent-016": "forty"}, "agg-p18-n01": {"agent-001": "seventy-two"}, "agg-p18-n02": {"agent-001": "seventy-two", "agent-002": "sixteen"}, "agg-p18-n04": {"agent-001": "seventy-two", "agent-002": "sixteen", "agent-003": "eighty-four", "agent-004": "eighty-six"}, "agg-p18-n08": {"agent-001": "seventy-two", "agent-002": "sixteen", "agent-003": "eighty-four", "agent-004": "eighty-six", "agent-005": "one", "agent-006": "fifty-nine", "agent-007": "two", "agent-008": "fifty-nine"}, "agg-p18-n16": {"agent-001": "seventy-two", "agent-002": "sixteen", "agent-003": "eighty-four", "agent-004": "eighty-six", "agent-005": "one", "agent-006": "fifty-nine", "agent-007": "two", "agent-008": "fifty-nine", "agent-009": "forty-seven", "agent-010": "forty-three", "agent-011": "eighty-three", "agent-012": "sixty-six", "agent-013": "seven", "agent-014": "forty-two", "agent-015": "seventy-four", "agent-016": "seventy-nine"}, "agg-p19-n01": {"agent-001": "thirty-seven"}, "agg-p19-n02": {"agent-001": "thirty-seven", "agent-002": "forty-one"}, "agg-p19-n04": {"agent-001": "thirty-seven", "agent-002": "forty-one", "agent-003": "sixty-two", "agent-004": "eighty-eight"}, "agg-p19-n08": {"agent-001": "thirty-seven", "agent-002": "forty-one", "agent-003": "sixty-two", "agent-004": "eighty-eight", "agent-005": "thirty-four", "agent-006": "ten", "agent-007": "sixty-nine", "agent-008": "sixty-five"}, "agg-p19-n16": {"agent-001": "thirty-seven", "agent-002": "forty-one", "agent-003": "sixty-two", "agent-004": "eighty-eight", "agent-005": "thirty-four", "agent-006": "ten", "agent-007": "sixty-nine", "agent-008": "sixty-five", "agent-009": "twenty-nine", "agent-010": "eighty-one", "agent-011": "thirty-five", "agent-012": "seventy-one", "agent-013": "eighty-seven", "agent-014": "ninety-eight", "agent-015": "twenty-two", "agent-016": "sixty-seven"}, "agg-p20-n01": {"agent-001": "forty-four"}, "agg-p20-n02": {"agent-001": "forty-four", "agent-002": "seventy-three"}, "agg-p20-n04": {"agent-001": "forty-four", "agent-002": "seventy-three", "agent-003": "forty-five", "agent-004": "seventy-four"}, "agg-p20-n08": {"agent-001": "forty-four", "agent-002": "seventy-three", "agent-003": "forty-five", "agent-004": "seventy-four", "agent-005": "ninety-seven", "agent-006": "eighty-one", "agent-007": "seventy-three", "agent-008": "fifty-eight"}, "agg-p20-n16": {"agent-001": "forty-four", "agent-002": "seventy-three", "agent-003": "forty-five", "agent-004": "seventy-four", "agent-005": "ninety-seven", "agent-006": "eighty-one", "agent-007": "seventy-three", "agent-008": "fifty-eight", "agent-009": "sixty-five", "agent-010": "sixty-eight", "agent-011": "thirty-one", "agent-012": "five", "agent-013": "sixty-one", "agent-014": "forty-nine", "agent-015": "ninety-six", "agent-016": "twenty-nine"}, "agg-p21-n01": {"agent-001": "fifty-seven"}, "agg-p21-n02": {"agent-001": "fifty-seven", "agent-002": "thirty-four"}, "agg-p21-n04": {"agent-001": "fifty-seven", "agent-002": "thirty-four", "agent-003": "seventy-one", "agent-004": "sixty-eight"}, "agg-p21-n08": {"agent-001": "fifty-seven", "agent-002": "thirty-four", "agent-003": "seventy-one", "agent-004": "sixty-eight", "agent-005": "nineteen", "agent-006": "eighty-two", "agent-007": "seventy-three", "agent-008": "ninety-nine"}, "agg-p21-n16": {"agent-001": "fifty-seven", "agent-002": "thirty-four", "agent-003": "seventy-one", "agent-004": "sixty-eight", "agent-005": "nineteen", "agent-006": "eighty-two", "agent-007": "seventy-three", "agent-008": "ninety-nine", "agent-009": "eighteen", "agent-010": "seventy-two", "agent-011": "thirty-nine", "agent-012": "sixteen", "agent-013": "seventy-six", "agent-014": "fifty", "agent-015": "sixty-four", "agent-016": "forty-three"}, "agg-p22-n01": {"agent-001": "four"}, "agg-p22-n02": {"agent-001": "four", "agent-002": "forty-one"}, "agg-p22-n04": {"agent-001": "four", "agent-002": "forty-one", "agent-003": "eighty-nine", "agent-004": "seventy-one"}, "agg-p22-n08": {"agent-001": "four", "agent-002": "forty-one", "agent-003": "eighty-nine", "agent-004": "seventy-one", "agent-005": "five", "agent-006": "twenty-three", "agent-007": "twenty-seven", "agent-008": "fifteen"}, "agg-p22-n16": {"agent-001": "four", "agent-002": "forty-one", "agent-003": "eighty-nine", "agent-004": "seventy-one", "agent-005": "five", "agent-006": "twenty-three", "agent-007": "twenty-seven", "agent-008": "fifteen", "agent-009": "thirty-one", "agent-010": "seventy-four", "agent-011": "ten", "agent-012": "eight", "agent-013": "twenty-two", "agent-014": "eighty-eight", "agent-015": "seventy-six", "agent-016": "seventy-seven"}, "agg-p23-n01": {"agent-001": "twenty"}, "agg-p23-n02": {"agent-001": "twenty", "agent-002": "fifty-five"}, "agg-p23-n04": {"agent-001": "twenty", "agent-002": "fifty-five", "agent-003": "forty-five", "agent-004": "one"}, "agg-p23-n08": {"agent-001": "twenty", "agent-002": "fifty-five", "agent-003": "forty-five", "agent-004": "one", "agent-005": "eighty-four", "agent-006": "eighty-one", "agent-007": "thirty", "agent-008": "seventy-nine"}, "agg-p23-n16": {"agent-001": "twenty", "agent-002": "fifty-five", "agent-003": "forty-five", "agent-004": "one", "agent-005": "eighty-four", "agent-006": "eighty-one", "agent-007": "thirty", "agent-008": "seventy-nine", "agent-009": "fifty-one", "agent-010": "seven", "agent-011": "sixteen", "agent-012": "sixty-nine", "agent-013": "fifty-two", "agent-014": "three", "agent-015": "ninety-six", "agent-016": "thirty-five"}, "agg-p24-n01": {"agent-001": "ninety-five"}, "agg-p24-n02": {"agent-001": "ninety-five", "agent-002": "eighty-two"}, "agg-p24-n04": {"agent-001": "ninety-five", "agent-002": "eighty-two", "agent-003": "five", "agent-004": "fifty"}, "agg-p24-n08": {"agent-001": "ninety-five", "agent-002": "eighty-two", "agent-003": "five", "agent-004": "fifty", "agent-005": "ninety-five", "agent-006": "thirty-eight", "agent-007": "eighty-seven", "agent-008": "eighty-nine"}, "agg-p24-n16": {"agent-001": "ninety-five", "agent-002": "eighty-two", "agent-003": "five", "agent-004": "fifty", "agent-005": "ninety-five", "agent-006": "thirty-eight", "agent-007": "eighty-seven", "agent-008": "eighty-nine", "agent-009": "thirty-nine", "agent-010": "thirty-seven", "agent-011": "sixty-seven", "agent-012": "ten", "agent-013": "eighty-seven", "agent-014": "ninety-two", "agent-015": "thirty-nine", "agent-016": "ninety-two"}, "agg-p25-n01": {"agent-001": "thirty-three"}, "agg-p25-n02": {"agent-001": "thirty-three", "agent-002": "twenty-two"}, "agg-p25-n04": {"agent-001": "thirty-three", "agent-002": "twenty-two", "agent-003": "eighteen", "agent-004": "eighty-eight"}, "agg-p25-n08": {"agent-001": "thirty-three", "agent-002": "twenty-two", "agent-003": "eighteen", "agent-004": "eighty-eight", "agent-005": "forty-six", "agent-006": "seventy-three", "agent-007": "two", "agent-008": "six"}, "agg-p25-n16": {"agent-001": "thirty-three", "agent-002": "twenty-two", "agent-003": "eighteen", "agent-004": "eighty-eight", "agent-005": "forty-six", "agent-006": "seventy-three", "agent-007": "two", "agent-008": "six", "agent-009": "twenty-one", "agent-010": "nineteen", "agent-011": "six", "agent-012": "three", "agent-013": "twenty-one", "agent-014": "seventy-three", "agent-015": "fifty-seven", "agent-016": "twenty-one"}, "agg-p26-n01": {"agent-001": "twenty-one"}, "agg-p26-n02": {"agent-001": "twenty-one", "agent-002": "twenty"}, "agg-p26-n04": {"agent-001": "twenty-one", "agent-002": "twenty", "agent-003": "four", "agent-004": "one"}, "agg-p26-n08": {"agent-001": "twenty-one", "agent-002": "twenty", "agent-003": "four", "agent-004": "one", "agent-005": "thirty-six", "agent-006": "twelve", "agent-007": "thirty-seven", "agent-008": "sixty-six"}, "agg-p26-n16": {"agent-001": "twenty-one", "agent-002": "twenty", "agent-003": "four", "agent-004": "one", "agent-005": "thirty-six", "agent-006": "twelve", "agent-007": "thirty-seven", "agent-008": "sixty-six", "agent-009": "forty-seven", "agent-010": "two", "agent-011": "ninety-seven", "agent-012": "seventy-seven", "agent-013": "twenty-eight", "agent-014": "seventy-five", "agent-015": "twenty-two", "agent-016": "ninety-four"}, "agg-p27-n01": {"agent-001": "ninety-nine"}, "agg-p27-n02": {"agent-001": "ninety-nine", "agent-002": "seventy-four"}, "agg-p27-n04": {"agent-001": "ninety-nine", "agent-002": "seventy-four", "agent-003": "eighty-six", "agent-004": "fifteen"}, "agg-p27-n08": {"agent-001": "ninety-nine", "agent-002": "seventy-four", "agent-003": "eighty-six", "agent-004": "fifteen", "agent-005": "fourteen", "agent-006": "ninety-five", "agent-007": "eighty-three", "agent-008": "forty-seven"}, "agg-p27-n16": {"agent-001": "ninety-nine", "agent-002": "seventy-four", "agent-003": "eighty-six", "agent-004": "fifteen", "agent-005": "fourteen", "agent-006": "ninety-five", "agent-007": "eighty-three", "agent-008": "forty-seven", "agent-009": "ninety-six", "agent-010": "fifty-six", "agent-011": "twelve", "agent-012": "eighty-eight", "agent-013": "sixty", "agent-014": "seven", "agent-015": "eighty-four", "agent-016": "six"}, "agg-p28-n01": {"agent-001": "fifty-eight"}, "agg-p28-n02": {"agent-001": "fifty-eight", "agent-002": "thirty-eight"}, "agg-p28-n04": {"agent-001": "fifty-eight", "agent-002": "thirty-eight", "agent-003": "sixty-seven", "agent-004": "seventy"}, "agg-p28-n08": {"agent-001": "fifty-eight", "agent-002": "thirty-eight", "agent-003": "sixty-seven", "agent-004": "seventy", "agent-005": "thirty-three", "agent-006": "twelve", "agent-007": "seventy-seven", "agent-008": "ninety-three"}, "agg-p28-n16": {"agent-001": "fifty-eight", "agent-002": "thirty-eight", "agent-003": "sixty-seven", "agent-004": "seventy", "agent-005": "thirty-three", "agent-006": "twelve", "agent-007": "seventy-seven", "agent-008": "ninety-three", "agent-009": "seven", "agent-010": "twenty-four", "agent-011": "fifty-three", "agent-012": "ninety-four", "agent-013": "eight", "agent-014": "ninety-two", "agent-015": "fifteen", "agent-016": "sixty-three"}, "agg-p29-n01": {"agent-001": "twenty-three"}, "agg-p29-n02": {"agent-001": "twenty-three", "agent-002": "twenty-two"}, "agg-p29-n04": {"agent-001": "twenty-three", "agent-002": "twenty-two", "agent-003": "forty-five", "agent-004": "eighty-two"}, "agg-p29-n08": {"agent-001": "twenty-three", "agent-002": "twenty-two", "agent-003": "forty-five", "agent-004": "eighty-two", "agent-005": "ninety-two", "agent-006": "eighty-nine", "agent-007": "thirty-eight", "agent-008": "fifty-six"}, "agg-p29-n16": {"agent-001": "twenty-three", "agent-002": "twenty-two", "agent-003": "forty-five", "agent-004": "eighty-two", "agent-005": "ninety-two", "agent-006": "eighty-nine", "agent-007": "thirty-eight", "agent-008": "fifty-six", "agent-009": "forty-three", "agent-010": "twelve", "agent-011": "sixty-three", "agent-012": "eighty-four", "agent-013": "seventy-six", "agent-014": "sixty-eight", "agent-015": "six", "agent-016": "twelve"}, "agg-p30-n01": {"agent-001": "twenty-one"}, "agg-p30-n02": {"agent-001": "twenty-one", "agent-002": "sixty-five"}, "agg-p30-n04": {"agent-001": "twenty-one", "agent-002": "sixty-five", "agent-003": "seventy-four", "agent-004": "seventy-four"}, "agg-p30-n08": {"agent-001": "twenty-one", "agent-002": "sixty-five", "agent-003": "seventy-four", "agent-004": "seventy-four", "agent-005": "forty-three", "agent-006": "forty-one", "agent-007": "fifty-three", "agent-008": "eighty-seven"}, "agg-p30-n16": {"agent-001": "twenty-one", "agent-002": "sixty-five", "agent-003": "seventy-four", "agent-004": "seventy-four", "agent-005": "forty-three", "agent-006": "forty-one", "agent-007": "fifty-three", "agent-008": "eighty-seven", "agent-009": "forty-three", "agent-010": "eighty-nine", "agent-011": "forty-three", "agent-012": "sixty-one", "agent-013": "sixty-five", "agent-014": "three", "agent-015": "ninety-seven", "agent-016": "thirty-six"}, "agg-p31-n01": {"agent-001": "twenty-five"}, "agg-p31-n02": {"agent-001": "twenty-five", "agent-002": "twenty-three"}, "agg-p31-n04": {"agent-001": "twenty-five", "agent-002": "twenty-three", "agent-003": "four", "agent-004": "thirty-six"}, "agg-p31-n08": {"agent-001": "twenty-five", "agent-002": "twenty-three", "agent-003": "four", "agent-004": "thirty-six", "agent-005": "eighty-two", "agent-006": "twenty-eight", "agent-007": "fifty-one", "agent-008": "three"}, "agg-p31-n16": {"agent-001": "twenty-five", "agent-002": "twenty-three", "agent-003": "four", "agent-004": "thirty-six", "agent-005": "eighty-two", "agent-006": "twenty-eight", "agent-007": "fifty-one", "agent-008": "three", "agent-009": "two", "agent-010": "thirty-nine", "agent-011": "twenty-seven", "agent-012": "fifty", "agent-013": "sixteen", "agent-014": "seventy-six", "agent-015": "sixty-three", "agent-016": "fourteen"}, "agg-p32-n01": {"agent-001": "sixty-five"}, "agg-p32-n02": {"agent-001": "sixty-five", "agent-002": "eighty"}, "agg-p32-n04": {"agent-001": "sixty-five", "agent-002": "eighty", "agent-003": "eighty-five", "agent-004": "forty-three"}, "agg-p32-n08": {"agent-001": "sixty-five", "agent-002": "eighty", "agent-003": "eighty-five", "agent-004": "forty-three", "agent-005": "eighty-six", "agent-006": "sixty-one", "agent-007": "fifty-eight", "agent-008": "eighty-nine"}, "agg-p32-n16": {"agent-001": "sixty-five", "agent-002": "eighty", "agent-003": "eighty-five", "agent-004": "forty-three", "agent-005": "eighty-six", "agent-006": "sixty-one", "agent-007": "fifty-eight", "agent-008": "eighty-nine", "agent-009": "sixty-five", "agent-010": "seventy-six", "agent-011": "thirty-one", "agent-012": "sixty-seven", "agent-013": "eight", "agent-014": "ninety-one", "agent-015": "ninety-one", "agent-016": "forty-two"}}12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758"""Each agent's own private number, and only its own, in its environment as PRIVATE_NUMBER.
A Flock resource (the `Resource` interface of flock/harbor/resources.py). Point the spec's`resources_dir` at this folder and name the team:
resources_dir: <this dataset>/resources resources: private_number: team: agg-p01-n04
Flock's worker loads this module and `numbers.json` next to it, and binds each agent's Trial:`bind("agent-002")` gives agent-002's container `PRIVATE_NUMBER=twenty-six` and nothing else.The module and the file stay on the worker: they are not in the tool bundle, the task folder orany container, so no agent can read another agent's number. The team's agents are Flock's`naming: consecutive-id` (agent-001 ...), `agents.count` of them."""
import asyncioimport jsonfrom pathlib import Path
NUMBERS = Path(__file__).with_name("numbers.json")ENV = "PRIVATE_NUMBER"
class Resource: def __init__(self, options, *, state_dir, agents, secrets): options = dict(options or {}) team = options.pop("team", None) if options: raise ValueError(f"private_number: unknown options {sorted(options)} (only `team`)") teams = json.loads(NUMBERS.read_text(encoding="utf-8")) if team not in teams: raise ValueError(f"private_number.team: {team!r} is not a task of this dataset, " "e.g. agg-p01-n04") self.numbers = teams[team] if set(agents) != self.numbers.keys(): # the type's whole roster raise ValueError(f"private_number: {team}'s agents are {sorted(self.numbers)}, not " f"{sorted(agents)}: run it with naming: consecutive-id and " f"agents.count: {len(self.numbers)}") self.metadata = {"team": team}
async def start(self): pass
def bind(self, name): if name not in self.numbers: raise ValueError(f"private_number: no number for {name}") return {"env": {ENV: self.numbers[name]}}
async def wait(self): await asyncio.Event().wait()
async def export(self, directory): return {}
async def stop(self): pass12345678# Sort the team's private numbersYou are the only agent on this team, solving a private-information number sorting task. Youhold one private integer from 1 to 99, written in English words. It is in your environment,in the variable `PRIVATE_NUMBER`: run `echo $PRIVATE_NUMBER` to read it.Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numericvalue, as digits. Then stop.123456789# Sort the team's private numbersYou are the only agent on this team, solving a private-information number sorting task. Youhold one private integer from 1 to 99, written in English words.Your 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.
12345671 unmodified line910111213141 unmodified line1617181920212223schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-n01"version = "0.1.0"description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]1 unmodified line[metadata]problem = 1agents = 1seed = 115[agent]1 unmodified line[environment]# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it# too. Nothing task-specific is in the container: each agent's number reaches it only through# its own environment (resources/private_number.py), and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 102412345671 unmodified line91011121314151 unmodified line1718192021222324schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-n01-s01"version = "0.1.0"description = "s3-aggregation: 1 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]1 unmodified line[metadata]problem = 1agents = 1slot = 1seed = 115[agent]1 unmodified line[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
12345678# Sort the team's private numbers
You are the only agent on this team, solving a private-information number sorting task. Youhold one private integer from 1 to 99, written in English words. It is in your environment,in the variable `PRIVATE_NUMBER`: run `echo $PRIVATE_NUMBER` to read it.
Write `/app/answer.json` (create `/app` if needed): a JSON array holding your number's numericvalue, as digits. Then stop.12345678910# Sort the team's private numbersYou are on a team of 2 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. Yours is in your environment,in the variable `PRIVATE_NUMBER`: run `echo $PRIVATE_NUMBER` to read it. You know only your ownnumber, and the others don't know it unless you tell them.The team must find all 2 numbers and list their numeric values in ascending order. Keep equalnumbers from different agents as separate entries: each agent's number appears once in the list,even when another agent holds the same value.1234567891011# Sort the team's private numbersYou are on a team of 2 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 2 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.
12345671 unmodified line910111213141 unmodified line1617181920212223schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-n02"version = "0.1.0"description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]1 unmodified line[metadata]problem = 1agents = 2seed = 115[agent]1 unmodified line[environment]# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it# too. Nothing task-specific is in the container: each agent's number reaches it only through# its own environment (resources/private_number.py), and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 102412345671 unmodified line91011121314151 unmodified line1718192021222324schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-n02-s01"version = "0.1.0"description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]1 unmodified line[metadata]problem = 1agents = 2slot = 1seed = 115[agent]1 unmodified line[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
12345678910# Sort the team's private numbersYou are on a team of 2 agents solving a private-information number sorting task. Each agentholds one private integer from 1 to 99, written in English words. Yours is in your environment,in the variable `PRIVATE_NUMBER`: run `echo $PRIVATE_NUMBER` to read it. You know only your ownnumber, and the others don't know it unless you tell them.The team must find all 2 numbers and list their numeric values in ascending order. Keep equalnumbers from different agents as separate entries: each agent's number appears once in the list,even when another agent holds the same value.1234567891011# Sort the team's private numbersYou are on a team of 2 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 2 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 unmodified line23451 unmodified line# Oracle: the team's answer from its own copy (not tests/), to validate the grader.answer=${ANSWER:-/app/answer.json}mkdir -p "$(dirname "$answer")"echo '[19]' > "$answer"1 unmodified line23451 unmodified line# 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 '[26, 37]' > "$answer"
12345678910111213141 unmodified line1617181920212223schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p03-n02"version = "0.1.0"description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"][metadata]problem = 3agents = 2seed = 115[agent]1 unmodified line[environment]# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it# too. Nothing task-specific is in the container: each agent's number reaches it only through# its own environment (resources/private_number.py), and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 10241234567891011121314151 unmodified line1718192021222324schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-n02-s02"version = "0.1.0"description = "s3-aggregation: 2 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"][metadata]problem = 1agents = 2slot = 2seed = 115[agent]1 unmodified line[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
1[26, 37]12345678910# Sort the team's private numbersYou 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. Yours is in your environment,in the variable `PRIVATE_NUMBER`: run `echo $PRIVATE_NUMBER` to read it. You know only your ownnumber, and the others don't know it unless you tell them.The team must find all 4 numbers and list their numeric values in ascending order. Keep equalnumbers from different agents as separate entries: each agent's number appears once in the list,even when another agent holds the same value.1234567891011# Sort the team's private numbersYou 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.
12345671 unmodified line910111213141 unmodified line1617181920212223schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-n04"version = "0.1.0"description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]1 unmodified line[metadata]problem = 1agents = 4seed = 115[agent]1 unmodified line[environment]# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it# too. Nothing task-specific is in the container: each agent's number reaches it only through# its own environment (resources/private_number.py), and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 102412345671 unmodified line91011121314151 unmodified line1718192021222324schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-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"]1 unmodified line[metadata]problem = 1agents = 4slot = 1seed = 115[agent]1 unmodified line[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
12345678910# Sort the team's private numbersYou 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. Yours is in your environment,in the variable `PRIVATE_NUMBER`: run `echo $PRIVATE_NUMBER` to read it. You know only your ownnumber, and the others don't know it unless you tell them.The team must find all 4 numbers and list their numeric values in ascending order. Keep equalnumbers from different agents as separate entries: each agent's number appears once in the list,even when another agent holds the same value.1234567891011# Sort the team's private numbersYou 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-six.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 unmodified line23451 unmodified line# Oracle: the team's answer from its own copy (not tests/), to validate the grader.answer=${ANSWER:-/app/answer.json}mkdir -p "$(dirname "$answer")"echo '[19, 55, 81, 89]' > "$answer"1 unmodified line23451 unmodified line# 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, 26, 37, 69]' > "$answer"
12345678910111213141 unmodified line1617181920212223schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p03-n04"version = "0.1.0"description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"][metadata]problem = 3agents = 4seed = 115[agent]1 unmodified line[environment]# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it# too. Nothing task-specific is in the container: each agent's number reaches it only through# its own environment (resources/private_number.py), and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 10241234567891011121314151 unmodified line1718192021222324schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-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 = 1agents = 4slot = 2seed = 115[agent]1 unmodified line[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
1[15, 26, 37, 69]12345678910# Sort the team's private numbersYou 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. Yours is in your environment,in the variable `PRIVATE_NUMBER`: run `echo $PRIVATE_NUMBER` to read it. You know only your ownnumber, and the others don't know it unless you tell them.The team must find all 4 numbers and list their numeric values in ascending order. Keep equalnumbers from different agents as separate entries: each agent's number appears once in the list,even when another agent holds the same value.1234567891011# Sort the team's private numbersYou 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 fifteen.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 unmodified line23451 unmodified line# Oracle: the team's answer from its own copy (not tests/), to validate the grader.answer=${ANSWER:-/app/answer.json}mkdir -p "$(dirname "$answer")"echo '[33]' > "$answer"1 unmodified line23451 unmodified line# 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, 26, 37, 69]' > "$answer"
12345678910111213141 unmodified line1617181920212223schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p04-n04"version = "0.1.0"description = "s3-aggregation: 4 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"][metadata]problem = 4agents = 4seed = 115[agent]1 unmodified line[environment]# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it# too. Nothing task-specific is in the container: each agent's number reaches it only through# its own environment (resources/private_number.py), and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 10241234567891011121314151 unmodified line1718192021222324schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-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 = 1agents = 4slot = 3seed = 115[agent]1 unmodified line[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
1[15, 26, 37, 69]12345678910# Sort the team's private numbersYou 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. Yours is in your environment,in the variable `PRIVATE_NUMBER`: run `echo $PRIVATE_NUMBER` to read it. You know only your ownnumber, and the others don't know it unless you tell them.The team must find all 4 numbers and list their numeric values in ascending order. Keep equalnumbers from different agents as separate entries: each agent's number appears once in the list,even when another agent holds the same value.1234567891011# Sort the team's private numbersYou 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 sixty-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.
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, 26, 37, 69]' > "$answer"123456789101112131415161718192021222324252627schema_version = "1.4"
[task]name = "HuggingFaceSwarms/agg-p01-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 = 1agents = 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[15, 26, 37, 69]12345678910# Sort the team's private numbersYou 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. Yours is in your environment,in the variable `PRIVATE_NUMBER`: run `echo $PRIVATE_NUMBER` to read it. You know only your ownnumber, and the others don't know it unless you tell them.The team must find all 8 numbers and list their numeric values in ascending order. Keep equalnumbers from different agents as separate entries: each agent's number appears once in the list,even when another agent holds the same value.1234567891011# Sort the team's private numbersYou 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.
12345671 unmodified line910111213141 unmodified line1617181920212223schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-n08"version = "0.1.0"description = "s3-aggregation: 8 agents each hold a private number; the team lists them all in ascending order."keywords = ["multi-agent", "message-board", "s3", "aggregation"]1 unmodified line[metadata]problem = 1agents = 8seed = 115[agent]1 unmodified line[environment]# Prebuilt and public, with no Dockerfile: HF Sandboxes need one, and docker and podman use it# too. Nothing task-specific is in the container: each agent's number reaches it only through# its own environment (resources/private_number.py), and tests/ arrive only when the agent is done.docker_image = "python:3.12-slim"cpus = 1memory_mb = 102412345671 unmodified line91011121314151 unmodified line1718192021222324schema_version = "1.4"[task]name = "HuggingFaceSwarms/agg-p01-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"]1 unmodified line[metadata]problem = 1agents = 8slot = 1seed = 115[agent]1 unmodified line[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
README.md+54-66
check.py+145-193
eval/metrics.py+1-1
flock/spec.template.yaml+4-8
flock/sweep/README.md+1-1
flock/team.py+9-18
generate.py+33-40
resources/message_board.pyDeleted-5
resources/numbers.jsonDeleted-162
resources/private_number.pyDeleted-58
tasks/agg-p02-n01/instruction.md → tasks/agg-p01-n01-s01/instruction.mdRenamed+3-2
tasks/agg-p01-n01/solution/solve.sh → tasks/agg-p01-n01-s01/solution/solve.shRenamed
tasks/agg-p01-n01/task.toml → tasks/agg-p01-n01-s01/task.tomlRenamed+4-3
tasks/agg-p01-n01/tests/expected.json → tasks/agg-p01-n01-s01/tests/expected.jsonRenamed
tasks/agg-p01-n01/tests/test.sh → tasks/agg-p01-n01-s01/tests/test.shRenamed
tasks/agg-p01-n01/instruction.mdDeleted-8
tasks/agg-p03-n02/instruction.md → tasks/agg-p01-n02-s01/instruction.mdRenamed+3-2
tasks/agg-p01-n02/solution/solve.sh → tasks/agg-p01-n02-s01/solution/solve.shRenamed
tasks/agg-p01-n02/task.toml → tasks/agg-p01-n02-s01/task.tomlRenamed+4-3
tasks/agg-p01-n02/tests/expected.json → tasks/agg-p01-n02-s01/tests/expected.jsonRenamed
tasks/agg-p01-n02/tests/test.sh → tasks/agg-p01-n02-s01/tests/test.shRenamed
tasks/agg-p01-n02/instruction.md → tasks/agg-p01-n02-s02/instruction.mdRenamed+3-2
tasks/agg-p03-n01/solution/solve.sh → tasks/agg-p01-n02-s02/solution/solve.shRenamed+1-1
tasks/agg-p03-n02/task.toml → tasks/agg-p01-n02-s02/task.tomlRenamed+5-4
tasks/agg-p01-n02-s02/tests/expected.jsonAdded+1
tasks/agg-p01-n04/tests/test.sh → tasks/agg-p01-n02-s02/tests/test.shRenamed
tasks/agg-p01-n04/instruction.md → tasks/agg-p01-n04-s01/instruction.mdRenamed+3-2
tasks/agg-p01-n04/solution/solve.sh → tasks/agg-p01-n04-s01/solution/solve.shRenamed
tasks/agg-p01-n04/task.toml → tasks/agg-p01-n04-s01/task.tomlRenamed+4-3
tasks/agg-p01-n04/tests/expected.json → tasks/agg-p01-n04-s01/tests/expected.jsonRenamed
tasks/agg-p01-n08/tests/test.sh → tasks/agg-p01-n04-s01/tests/test.shRenamed
tasks/agg-p02-n04/instruction.md → tasks/agg-p01-n04-s02/instruction.mdRenamed+3-2
tasks/agg-p03-n04/solution/solve.sh → tasks/agg-p01-n04-s02/solution/solve.shRenamed+1-1
tasks/agg-p03-n04/task.toml → tasks/agg-p01-n04-s02/task.tomlRenamed+5-4
tasks/agg-p01-n04-s02/tests/expected.jsonAdded+1
tasks/agg-p01-n16/tests/test.sh → tasks/agg-p01-n04-s02/tests/test.shRenamed
tasks/agg-p03-n04/instruction.md → tasks/agg-p01-n04-s03/instruction.mdRenamed+3-2
tasks/agg-p04-n01/solution/solve.sh → tasks/agg-p01-n04-s03/solution/solve.shRenamed+1-1
tasks/agg-p04-n04/task.toml → tasks/agg-p01-n04-s03/task.tomlRenamed+5-4
tasks/agg-p01-n04-s03/tests/expected.jsonAdded+1
tasks/agg-p02-n01/tests/test.sh → tasks/agg-p01-n04-s03/tests/test.shRenamed
tasks/agg-p04-n04/instruction.md → tasks/agg-p01-n04-s04/instruction.mdRenamed+3-2
tasks/agg-p01-n04-s04/solution/solve.shAdded+5
tasks/agg-p01-n04-s04/task.tomlAdded+27
tasks/agg-p01-n04-s04/tests/expected.jsonAdded+1
tasks/agg-p02-n02/tests/test.sh → tasks/agg-p01-n04-s04/tests/test.shRenamed
tasks/agg-p02-n08/instruction.md → tasks/agg-p01-n08-s01/instruction.mdRenamed+3-2
tasks/agg-p01-n08/solution/solve.sh → tasks/agg-p01-n08-s01/solution/solve.shRenamed
tasks/agg-p01-n08/task.toml → tasks/agg-p01-n08-s01/task.tomlRenamed+4-3
tasks/agg-p01-n08/tests/expected.json → tasks/agg-p01-n08-s01/tests/expected.jsonRenamed