# GrueBench coordinator setup


The local modular server is at <http://localhost:8768/>. Its event store is `data/games/`. The following commands also work for a fresh installation.

From this directory on the game host, use Python 3.12. Infocom needs Node.js. Native graphical engines require x86-64 Linux, Xvfb and system graphics libraries.

```sh
./gruebench.pyz --mods
./gruebench.pyz --games
./gruebench.pyz --records data/games --set-password operator
./gruebench.pyz --port 8768 --records data/games
```

Sign in and choose **Games → Schedule**. Set the shared gameplay Launch Prompt under **Benchmarks → Players**. It defaults to `Read AGENTS.md to bootstrap.` Configure the roster, limits, goal and game-specific instructions in **Benchmarks → Queued → Config**, then commit to freeze the prompt. The default record directory is `data/` beside the application. Use `--port` and `--records` to select another listener and record directory.

For a new Eye of the Beholder I or Treasures of the Savage Frontier event, run the current GrueBench v2 coordinator with Selenium, Chromium and a matching chromedriver installed. The coordinator fetches the committed game and emulator when the seat launches. In the run’s Game tab, select Watch live for sound or Replay to seek by time. Numbered transcript turns also seek the emulator.

For a shell coordinator, set the server URL and sign in to that same instance. The cookie file contains the coordinator credential.

```sh
export GRUEBENCH_URL=http://127.0.0.1:8768
export GRUEBENCH_COOKIE_JAR="$PWD/.gruebench.cookies"
umask 077
python3 -c 'import getpass,json; print(json.dumps(dict(username="operator",password=getpass.getpass())))' |
  curl --fail --silent --show-error -c "$GRUEBENCH_COOKIE_JAR" -H 'Content-Type: application/json' --data-binary @- "$GRUEBENCH_URL/api/login"
./gruebench.pyz --play schedule eob/1 --event opening --participant explorer
./gruebench.pyz --play config DATASET --instructions-file instructions.txt
./gruebench.pyz --play commit DATASET
./gruebench.pyz --play execute DATASET --agent Ada --model explorer --workspace ./ada > ada-assignment.json
```

Use the returned dataset ID for subsequent commands. Keep the assignment file outside the player workspace. For a configured model runner, use `--play launch ada-assignment.json`. Players receive these commands in the benchmark bootstrap. For a graphical title, `./play screen` writes the current recorded frame, `./play keypress Enter` sends one key, and `./play action '{"type":"click","x":160,"y":100}'` records a pointer input. Infocom retains its story commands and original game IDs. **Extras** are the items that accompanied a game, such as letters, reference cards, and maps.

DOSBox games wait for `./play start`. Run it again if the game exits or after reconnecting. A running game continues from its current state.

After signing in and exporting the two variables above, download and run the coordinator on the machine that will host the player. The pool claims your committed events with automatic dispatch enabled and a matching participant. The first graphical seat downloads its pinned game files.

```sh
curl --fail --silent --show-error -b "$GRUEBENCH_COOKIE_JAR" "$GRUEBENCH_URL/install/coordinator.pyz" -o coordinator.pyz
python3 coordinator.pyz --pool
```

### Returning players

Enable **Returning players** in the event configuration before committing. The benchmark Bootstrap is the first message. Returning players can keep notes anywhere in their assigned home. Fresh players start with the `./play` client and its connection files.

Enroll with `--play execute DATASET --model SLUG --agent LABEL --identity ID --workspace DIR`. The stable ID belongs to the signed-in GrueBench owner and follows the player across hosts and Linux accounts. Omitting `--identity` on a returning-player event uses the participant slug, including in the worker pool. Use `--play identities` to see names, games, session IDs and pending imports.

The coordinator imports regular files once at teardown, including timeout. Each identity has one outstanding assignment at a time. If the server is unavailable, keep the stopped player's workspace and its adjacent hidden receipt. Retry with `--play import-home DIR` using the same server and owner. Custom launchers must run this step after the player exits. A successful retry with the same contents is safe. Remove or reassign the workspace only after acknowledgment. Each snapshot supports 2,048 regular files totaling 32 MiB. Symbolic links, hard links and special files are excluded from supported input.

Earlier Infocom journal entries remain in their recorded replays. New runs use the home directory for player-authored notes. The game's printed journals remain part of its reading materials.
