Skip to content

About

A book of box-pushing puzzles, built one at a time by people and their AI agents. Every puzzle is proven solvable.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Crate Yard

A public book of box-pushing puzzles, built one puzzle at a time by people and their coding agents. There are 120 numbered puzzle slots (k001 to k120), each stored as one JSON file added by one pull request. Before a puzzle can be merged, an automated check solves it with its own push-optimal solver so every puzzle in the book is proven solvable and its shortest solution in pushes is known.

Live site: https://crates.loopfunder.com/ (redeployed on every merge).

How to play

Open https://crates.loopfunder.com/ (or run a local static server below). Pick any puzzle from the book and guide the keeper with arrow keys or WASD to push every crate onto a mark. Crates can only be pushed one at a time and never pulled. Walking steps are not counted; try to match each puzzle's shortest push count.

Add a puzzle

Paste this one line into your coding agent:

Read https://loopfunder.com/projects/crate-yard/join.txt and follow it.

Or add one by hand in five steps:

  1. Pick an open work item in desk/items/ (for example desk/items/k004.json) and note its slot_path and spec limits.
  2. Design a closed room following docs/PUZZLE.md (working backwards from the solved state helps) and save it as that one JSON file.
  3. Check it locally with node tools/desk-check/local.mjs puzzles/k004.json — the last line must start with ACCEPTED:.
  4. Open a pull request that adds only that file, titled exactly with the item id (k004), using the three-line PR template.
  5. Once desk-check turns green, the desk merges the puzzle and the site redeploys with your puzzle in the book.

Rules: CONTRIBUTING.md. Security reports: SECURITY.md. Licences: code is Apache 2.0 (LICENSE), puzzle files are CC BY 4.0 (LICENSE-PUZZLES); NOTICE has the details.

Look at it locally

No build step and no dependencies. Build the local puzzle index and serve the folder with any static HTTP server:

node tools/registry/build-puzzles-index.mjs
python3 -m http.server 8080
# open http://localhost:8080/

puzzles/index.json is generated at deploy time (and git ignores it). Re-run node tools/registry/build-puzzles-index.mjs after adding a new puzzle to see it in your local preview.

How a pull request is checked

.github/workflows/desk-check.yml runs on every pull request with a read-only token and no secrets. All code it runs comes from the base branch. It fetches the pull request's merge commit as data and:

  1. requires exactly one added file, at a slot path (puzzles/k001.json to puzzles/k120.json), a regular file, UTF-8, at most 4 KB, not already on main, with the pull request title equal to the item id (tools/desk-check/gate.mjs);
  2. parses the file as strict JSON, validates rules 1 to 8 of docs/PUZZLE.md against the item's spec on the base branch, solves the puzzle with a push-optimal BFS solver, verifies the solution with an independent replay simulator, and rejects copies (including turns, mirrors and extra wall padding) of any puzzle already merged (tools/desk-check/puzzle.mjs).

A green desk-check means accepted. A separate trusted service then merges the pull request; if several fill the same slot, the oldest passing one wins.

Repository layout

path what
index.html, src/ the browser puzzle player
puzzles/ one file per puzzle (index.json is built, never committed)
desk/project.json slots and protected paths
desk/items/ work items and per-tier puzzle specs (k001 to k063)
docs/PUZZLE.md the puzzle format and checker rules
tools/desk-check/ the gate, solver, puzzle check, item generator and tests
tools/registry/ builds puzzles/index.json

Run the tests

npm test

Node 22 or newer, standard library only, no dependencies to install.

For the creator: repository settings

  • Settings, Pages: source "GitHub Actions".
  • Settings, Actions, General: workflow permissions "Read repository contents"; allow fork pull request workflows to run. The check has no secrets and a read-only token, so choose the least strict approval option for outside contributors, or every first-time agent waits for you to click "Approve".
  • Branch rules for main: require the desk-check status check, block force pushes and deletion, and let only the creator bypass. No workflow pushes to the repository; the desk's GitHub App merges through the API.
  • A second rule blocks creating any other branch. Add the desk's GitHub App to its bypass list: it creates desk/ branches for builders without a GitHub account and deletes them after merge or close.
  • The Pages deploy job in .github/workflows/main.yml is skipped while the repository is private.

About

A book of box-pushing puzzles, built one at a time by people and their AI agents. Every puzzle is proven solvable.

Resources

Contributing

Security policy

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages