1# Clockwork (world bible)23Pack: [`mods/worlds/clockwork.cjs`](../../mods/worlds/clockwork.cjs) (id4`clockwork`, `manifest.engine: 1`). Contract and engine asks:5[clockwork-api.md](clockwork-api.md).67## Theme89A clock tower workshop after hours. Wind-up mice pace their tracks, cogs line10the floor, and a brass bell waits somewhere the cat can't quite reach. Nothing11here is alive, but some things keep moving between your steps.1213World identity (`manifest.world`): glyph ⚙️, tagline "Some things keep walking14after you stop.", accent `push`. The shipped loader accepts the field without15validating it (see F-CW8).1617| Noun | Glyph | Facing | Role |18| --- | --- | --- | --- |19| MIAU | 🐈 | left (built-in) | the player |20| MOUSE | 🐁 | left (profile) | the clockwork helper |21| COG | ⚙️ | none | floor hazard (`COG IS DEFEAT`) |22| BELL | 🔔 | none | the goal (`BELL IS WIN`) |23| WALL | 🧱 | none | terrain |2425## The custom property: TICK2627`X IS TICK` makes every X repeat the level's step pattern, one beat per turn28(a move or a wait). This is the engine's declarative `level.automata`. Every29level declares its pattern as data. Levels 1, 2, and 5 bind the pattern to30MOUSE with `subject`. Levels 3, 4, and 6 leave `subject` out, so whichever31noun holds the `TICK` word follows the pattern. Moving the word hands the32clockwork to something else.3334Rules players meet, in order:35361. Clockwork moves on its own, one step per turn, and pushes words.372. It only runs while its sentence holds.383. The word carries the clockwork: `BELL IS TICK` makes the goal walk.394. You can be clockwork too, and a double step skips the cell in between.405. Clockwork combines with core properties: a `SINK` mouse takes a cog with it.416. Challenge: the clockwork delivers a noun, and the hazard becomes the goal.4243The world's second property (`OPEN` and `SHUT`, a paired contact effect) is a44**proposal** (`level.pairs`, see clockwork-api.md). Its three draft levels run45only on the prototype and aren't in the pack.4647## Levels4849Solver: `node --max-old-space-size=8000 tools/solve.mjs mods/worlds/clockwork.cjs --max 4000000`50on the shipped engine. The full run takes about 4 minutes, and the default heap51runs out of memory on an earlier, roomier layout of `ring-for-service`. HANDS-OFF comes from `/tmp/clockwork-proto/verify.mjs`: the52level is winnable without the player pushing any word (F-CK9). No level is53flagged BYPASS or TRIVIAL.5455| # | id | Title | Category | Teaches | Steps | Flags | Intended insight |56| --- | --- | --- | --- | --- | --- | --- | --- |57| 1 | `mouse-keeps-time` | The mouse keeps time | required | TICK exists; clockwork pushes words | 11 | HANDS-OFF (by design) | Just walk. The mouse delivers `WIN` into `BELL IS _` in a sealed lane on beat 5. |58| 2 | `wind-it-up` | Wind it up | required | Writing `MOUSE IS TICK` | 18 | none | The mouse is idle until you push `TICK` into `MOUSE IS _`. Then it delivers `WIN`. |59| 3 | `ring-for-service` | Ring for service | required | The word carries the pattern | 10 | none | The cat can't cross the cogs, but the bell can. Move `TICK` from the mouse to `BELL IS _` and the bell walks to you. |60| 4 | `double-time` | Double time | required | `MIAU IS TICK`; end-of-turn contacts | 11 | none | The pattern is one step down. Make yourself `TICK`, stand above the cogs, and step down. You move twice and never stop on a cog. |61| 5 | `mouse-hole` | Mouse hole | required | TICK with core `SINK` | 23 | none | Push `SINK` into `MOUSE IS TICK AND _`. The diving mouse sinks one cog and leaves a gap. |62| 6 | `escapement` | Escapement | challenge | Delivering a noun; transformation | 29 | none | `WIN` is the bait: `COG IS WIN` still kills you, because `DEFEAT` beats `WIN`. Load `BELL` into the mouse's column instead, time it with the press, and `COG IS BELL` turns the hazard into the goal. |6364Shortest solutions (real solver):6566- `mouse-keeps-time`: `DRRRRRRRRRR`67- `wind-it-up`: `RRRRURULLDDRRRRRRR`68- `ring-for-service`: `URRRDRRUDL`69- `double-time`: `RRURULLLLDR`70- `mouse-hole`: `URRRRRDRUUUUDDDDRDDDLLL`71- `escapement`: `UUDUDUDUDURRRRRRRRRDRDLLLUDLD` (the opening bobs are waits for the press to cycle; `W` works too)7273All boards fit in 14×10, the largest being 11×10.7475### Bypass notes7677- `mouse-keeps-time` is hands-off **on purpose**. It's the "just watch" level78 that shows a word moving with nobody pushing it. It isn't flagged BYPASS,79 because the mouse moves a word.80- Every other level needs the player to push a word. Both the frozen-words81 search (BYPASS) and the player-pushes-nothing search (HANDS-OFF) come back82 unsolvable.8384## Design notes8586- **Locking sentences.** No word tile can be fixed, so every rule the player87 must not break sits in a corner or fills an edge row (for example,88 `mouse-hole` row 0 is `MIAU IS YOU MOUSE IS TICK AND _ BELL IS WIN`, with89 the slot as the only gap). This costs rows and reads as clutter. Same90 finding as F-CW2 and F-XW2.91- **No patrol guards.** Contacts resolve once, at the end of the turn, so a92 moving `DEFEAT` can be swapped through head-on (F-CK6). The world uses93 static cogs as the hazard and moving helpers as the tool. A guard level94 (`stop-the-clock`) was cut after three layouts.95- **Spacing.** Stacked horizontal sentences keep a blank row between them. The96 only vertical sentences are deliberate crossings (`BELL / IS / _` under97 `BELL IS WIN`, `MIAU / IS / _` under `MIAU IS YOU`).98- **The last-moment transform in `escapement`.** The shortest route steps onto99 a cog on the same turn the mouse pushes `BELL` into place. That's legal,100 because transforms run before contacts. A human will usually wait a turn101 and then step.102- **Solver cost.** `mouse-hole` and `escapement` need `--max 4000000` and103 about 3 minutes each. At the default they return LIMIT (F-CK9, F-CW4).104- **The engine changed three times during authoring.** It went from no105 automata, to subject-bound automata with pushed things skipping their106 beat, to the shipped model. Levels were re-verified after each change.107108## OPEN and SHUT (proposal, not in the pack)109110The draft levels are in `/tmp/clockwork-proto/clockwork-pairs.cjs`, verified111on the prototype. See Appendix B of clockwork-api.md.112113| id | Title | Steps | Idea |114| --- | --- | --- | --- |115| `key-and-door` | Every door has a key | 17 | Build `KEY IS PUSH AND OPEN`, then push the key into the door. |116| `any-wall-will-do` | Any wall will do | 32 | `WALL IS STOP AND SHUT`: any wall is a lock. Pick the thin side. |117| `let-the-mouse-in` | Let the mouse in | 13 | Sealed in, you write `MOUSE IS OPEN`, and the pacing mouse opens your door. |118119If pairs ship, these slot in after level 2. The world would then teach120`TICK`, then `OPEN`/`SHUT`, then a combination (`let-the-mouse-in`).