# Making a work for Playspace

This file is for whoever makes the work: a person, or the AI assistant they work with. Read it before changing
anything in this folder: it says how a work is wired for Playspace, and the starter's code follows it. `AGENTS.md`
and `CLAUDE.md` are the same file, so an assistant finds it under either name.

## What Playspace is

Playspace is a place on the web where people play small interactive works from a link: games, toys, scenes, pieces,
stories. A work is a folder of web files (an `index.html` and what it loads) that runs in the browser with nothing of
yours behind it; Playspace hosts it and gives it the same few controls on every phone and computer.

A work does not have to be a game. Nothing here assumes a score, a death, a level or an ending.

## The three starters

Each is a complete small work in its own zip, with this file inside:

- **plain** (`plain.zip`): canvas 2D, no library. Wisp, a light you steer through a pond of motes.
- **Phaser** (`phaser.zip`): Phaser **4.2.1**, in `vendor/phaser.min.js`, one scene with Arcade physics and textures
  drawn from shapes. Marbles, a table of marbles you roll among.
- **three.js** (`three.zip`): three.js **r187**, in `vendor/three.module.js` and `vendor/three.core.js`, loaded with
  `<script type="module">`. Garden, a small low garden you walk through and look around.

Write for the vendored version's API, not a newer or older one; `THIRD_PARTY.md` in the Phaser and three.js folders names it.

Each listens to its own keys (W A S D and the arrows, Space, Shift, Esc) and its own pointer, as any web page does,
and `playspace.json`'s `controls` (the control manifest) tells Playspace which of those keys the stick, A, B and the
menu pill press. Beside that each makes a few calls: `playspace.ready()` when its first frame is drawn,
`playspace.start()` at the first touch or key, `playspace.on("pause")` and `on("resume")` to hold still and go on,
`on("mute")` to keep its own sound state with the player's Sound switch, and one
`playspace.moment()`. On a touch screen each also answers `doubleTap` and `dash` through
`playspace.input.onIntent` (the player's default for both would press B's Shift). The three.js starter looks around
with `playspace.camera.onLook`: with Playspace there, a drag (a finger on a phone, the mouse on a computer) arrives
there in radians after the player's own look settings, and the page's own drag reading stays off. Change anything, or
start again from nothing and keep only what you need.

Open `index.html` in a browser to try one (the three.js one from a local web server, as a module page needs: any
static server will do). Playspace puts `window.playspace` on the page when it plays the work; opened on your computer
there is none and the page works the same. Keep that guard (`if (window.playspace) ...`) in anything you write.

## The Playspace set

Every work on Playspace is played with the same few controls:

| | On a phone | On a computer |
|---|---|---|
| Move | the stick, bottom left | W A S D or the arrows |
| A | the large button, bottom right | Space |
| B | the smaller button, above A | Shift |
| The menu | the pill at the top left | Esc |
| The pointer | a tap (the click) and a drag | the mouse and its click |

Make the work playable with these and nothing more. Playspace draws the stick, A, B and the pill, with your words in
them, and on a computer key caps in the corners; do not draw buttons of your own for them. A work that needs more than the
set (a third button held in play, a second set of directions, typing as the play) is over it: it still publishes,
flagged, with the actions that have no place left out.

## Answer each control one way

Listen to your own keys and your own pointer, and name those keys in `playspace.json`'s `controls` (the control
manifest, below): the player then presses them from the stick, A, B and the pill on a phone, and shows them as key
caps on a computer. That is all the input code a work needs. Do not also answer the same button through
`playspace.input.onIntent`, or it fires twice, and do not call `playspace.layout()` for the set: a layout written by
hand takes the place of the manifest, and the key caps on a computer go with it. The one place a work reads Playspace
for input is a view the drag turns: with `window.playspace` there, take the look from `playspace.camera.onLook` and
leave your own drag reading off, as the three.js starter does (`"pointer": "look"` in the manifest). A view from inside
(first person) made this way gets drag-to-look on a computer, not a captured mouse: the mouse is not locked to it. Where the contract and the cookbook say to declare a
layout or to answer A and B through `onIntent`, that is how Playspace's own agent wires a work it did not write.

Give each action one control. The stick (W A S D and the arrows) is for moving something; an action that is not a
movement (a flipper, a jump, a switch) goes on A or B, not on the stick's directions. Do not give the same action a
touch area of your own as well (a half of the screen that does what A does): on a phone the player already draws A
there, and the work reads as needing more than the set.

## The page rules

- **Everything in the folder.** Every script, style, image, font and sound the work loads is a file inside the folder.
  Copy a library in (for example `vendor/three.module.js`); never load one from a CDN with a
  `<script src="https://...">` tag. The page's Content Security Policy blocks anything from another host.
- **No server.** Nothing of yours runs behind the work. Saves and scores go through the SDK (`playspace.save()`,
  `playspace.load()`, `playspace.score()`).
- **No request to anyone.** `fetch`, `XMLHttpRequest`, WebSockets and the like reach only the work's own files.
- **You do not add the SDK.** Playspace inserts its script into every page it serves, before your scripts, so
  `window.playspace` is there when your code runs. Never copy it into the folder.
- **Any shape of screen.** Size from the live window (`innerWidth`, `innerHeight`) and lay out again on `resize`
  (a page opened in a background tab can start at 0 by 0). Never ask for the phone to be turned and never lock the
  orientation.
- **Sound after a touch.** Start or resume your `AudioContext` on the first touch, click or key.
- **Moments.** Call `playspace.moment("snake_case_name")` where something meaningful happens in the work's own terms
  (a choice made, a thing finished, a place reached), after `playspace.start()` and for something a person did:
  rarely, never every frame. That call is all; the publishing agent
  declares it.
- **The limits.** At most 100 MiB unpacked, and as one upload; at most 1,000 files; at most 30 MiB fetched before the
  first frame is drawn (20 MiB on the phone run); a first frame drawn within 60 seconds.

## What happens when you publish

Every work is checked before it is published: a safety scan, then a run on a computer and on a phone. An agent then
reads the work and adds what is missing (the SDK's calls, the control manifest, the moments' declarations) without
changing what the work is. The more of this guide the work already follows, the less there is to add. Nothing is
published until you press Publish.

That agent's work is its own. Never write `inputs.json` or `work.json`, and never run `refuse`, `build`, `measure` or
any `pnpm` command: those belong to the publishing agent, and the pages below mention them only because they are
copied from what it reads.

## How to publish

Open https://www.joinplayspace.com/create, sign in, and drop the folder, or a zip of it, on "Bring a work". Check the card, say the work is
yours to publish, and press Publish. A work made from a starter is yours: put your name in its `LICENSE` in place of
"Playspace" (the libraries' notices stay). `AGENTS.md` and `CLAUDE.md` may stay or go. Nothing else is extra but a
`vendor/` library you no longer use: remove it and its line in `THIRD_PARTY.md` (it is still published, and the card
names it).

From a terminal or an AI coding tool, with Playspace's command-line tool from npm: `npx playspace publish <the folder>`.
The first time, it opens a Playspace page in your browser with a short code: press Allow there. It uploads, then prints
the review link once the checks pass; the card, the yes and Publish stay yours, in the browser. An AI assistant adds
`--json` and gets one JSON object back; while the checks run, it runs the `next` command it is given,
`npx playspace status <draftId> --wait`, until the state is `ready`, then gives you the review link.

From an assistant with Playspace's connector (https://www.joinplayspace.com/mcp): `create_draft` sends your changed files over a starter as a
draft, `draft_status` follows its checks to the review link; Publish stays yours. The first time, the assistant asks
you to sign in to Playspace (in Claude or ChatGPT, press Connect). A tool on your computer with a config file can use a
token from Me, Settings as its Authorization header instead.

When the draft is ready, `draft_status` gives the review link first, then the address where the draft will play
(`/e/` and the draft's id, with `?draft=1`). Open the review in your own browser, signed in, and press Play your draft: the draft then
plays at that address in the real player, only for you, for a day. Before that press it does not show your draft, and no token or
assistant can open it.

## Read more

Each starter has its own page, with its files, what its `playspace.json` wires and the order to read in:
https://www.joinplayspace.com/sdk/kit/plain.md, https://www.joinplayspace.com/sdk/kit/phaser.md and https://www.joinplayspace.com/sdk/kit/three.md (read the one for this folder's
starter). Every topic (the controller, text entry, moments, autoplay, publishing, the contract, the cookbook) is listed
at https://www.joinplayspace.com/llms.txt, one line each; with the connector, `get_docs` returns the same pages. A person reads them at
https://www.joinplayspace.com/docs/sdk.

## The rest of this file

What follows is copied from the pages Playspace's own agent works from (SDK 0.28.0): the contract every work
targets, then two sections of the cookbook (the rules and the control manifest), less the passages that are only that
agent's job. They sometimes speak to that agent ("the transcoder", "your folder"); read them as how a work is wired,
and where they wire a work another way than "Answer each control one way" above, keep to that section. The ids and
row numbers in them (AV254, AQ28, row 29 and the like) point into Playspace's internal records and can be skipped. On
what a name means, the contract wins. The full pages: https://www.joinplayspace.com/sdk/CONTRACT.md, https://www.joinplayspace.com/sdk/COOKBOOK.md,
https://www.joinplayspace.com/sdk/playspace.d.ts (the types) and https://www.joinplayspace.com/sdk/playspace.schema.json (playspace.json's schema).

<!-- Generated by `pnpm sdk:guide` from packages/kit/guide/KIT_HEAD.md, the contract block of packages/hosted-runtime/src/types/sdk.d.ts and sections 0 and 0.5 of packages/hosted-runtime/docs/COOKBOOK.md, less the publishing agent's own passages (KIT_CUTS in packages/kit/src/kit.ts). Do not edit this file: edit those and run the command again; a test fails when it is stale. -->

## The contract (DECISIONS AQ25 to AQ30; docs/SDK_SWEEP_2026-10-19.md 3.5)

Sharing is one controller on every work: the left thumb moves, the right finger looks, a tap acts, and one button is
the action with no place (AQ28). Publishing is the
transcoder writing every work onto it. The SDK is the contract between them, and a control nothing listens to is
never drawn (0.16.0). A work on the contract gets the controller as a guarantee; a work on the fallback gets it as a guess.

**The four verbs and the declaration** (what the transcoder writes; what a creator is told; nothing else):
1. **The stick moves it.** Each frame read `playspace.input.axis("moveX")` and `("moveY")` (-1..1, up negative) and
   move the work in its camera's frame: with `f` the camera's forward flattened onto the floor and `r = f × up` its
   right, the step is `r * moveX - f * moveY` times the speed and `dt` (games_fps's `getSideVector` and
   `getForwardVector`); with a yaw `a` alone (three.js's `rotation.y`), `dx = moveX cos a + moveY sin a`,
   `dz = moveY cos a - moveX sin a`. A read makes the stick live. `dash` (an intent) is a push past the rim.
2. **The drag turns it.** `playspace.camera.onLook((yaw, pitch) => ...)`: radians after the player's comfort, yaw right
   and pitch up positive, applied to the work's own camera. A drag that starts on empty space is the look.
3. **A tap acts in it.** `playspace.input.onIntent((i) => ...)`, returning true for what it handled: `tap` is the tap
   (a click on a computer) under every reading, never a walk (the stick is the only locomotion, AQ24), with `target`
   when `select: { hit }` wraps the work's raycaster; `hold`, `drag` (with `holdDrag`), `press`, `swipe`, `zoom`,
   `doubleTap` for the finger's other gestures. (AQ29: `act` renamed `tap`; `goto` and `primary` folded into it.)
   A work with more verbs than these carries them on `tap`, then `doubleTap`, then `dash`, in that order; never two
   held together (the cookbook's rule 8).
4. **The button is the action** (AQ28): `{ type: "action", on, t0 }` through `onIntent`, on at the down and off at
   the lift (a jump, a flip, a confirm: an action with no place on the screen; the held span is the work's). The
   declaration's `action: "Jump"` names and lights it. Not `tap`: a tap acts on what it lands on, the button does not.
   **The second button** (0.11.0, AV29): `{ type: "secondary", on, t0 }`, the same shape, lit only by the
   declaration's `secondary: "Run"` (or `keys.secondary`): the smaller disc above the button on a phone, Shift or the
   right mouse button (0.12.0, AV58; and a declared `keys.secondary`) on a computer; the verb a work holds (run,
   boost, aim), or its second action.
5. **The declaration.** `playspace.layout({ v: 3, action?, secondary?, select?, avoid?, forward?, scroll?, inspect?, own? })`:
   only what the defaults cannot guess, and the work's HUD to keep the controls off.
Plus the envelope's signals, already the contract: `ready()`, `start()`, `moment()`, `end()`, `progress()`,
`score()`, `idle()`, `error()`, `on("pause" | "resume")`, `camera.fovFor()`, `touch.geometry()` (0.10.0's neutral
names first; `gameplayStart()` and `complete()` are the same calls under their first names).

**One contract, every device** (AQ27): the work writes the three verbs once and the SDK feeds them from what the
person holds. Phone: the left stick, a drag on empty space, a tap, the round button at the lower right. Computer: W A S
D or the arrows, a mouse drag on empty space (no pointer lock), a click, Space; Shift or the right mouse button is the
second button where it is declared (0.12.0); the wheel zooms and a held button is `hold`. On a phone a two-finger
pinch on empty space zooms too (0.12.0). A first-person work may say `look: { computer: "capture" }`: a click takes
the mouse, Esc gives it back (0.9.2; since runtime 1.27.0, AV234, the player does nothing then: the work hears
`pointerlockchange` and its own Escape). On a trackpad (runtime 1.13.0, AV63): a two-finger click, or
Ctrl+click on a Mac, is the right mouse button; a pinch is zoom (`via: "pinch"`); press and drag looks, or click to
take the mouse where the work asks (`capture`). Mixed devices (1.13.0): a finger on a computer's touch screen is the
mouse's drag, click and hold (never the captured mouse), and a keyboard beside a touch screen moves and presses as on
a computer (the stick wins while a finger is on it). `swipe`, `dash` and the double tap's drag `zoom` are touch
gestures with no computer form. Gamepad, later: the left stick, the
right stick, the A button. Nothing on a computer is synthetic: the real keys, mouse and click still reach
the work, and the SDK adds no second click. On a computer the work needs no `playspace.layout` for this: a subscriber to
`onIntent` or `onLook`, or a read of `moveX`/`moveY`, is the declaration (the review's M3, AQ29).

**The player surface** (docs/PLAYER_SURFACE_2026-10-19.md 2.13; AQ29; the Home button, AV191): the same around every
work. While a work runs, the one thing of the player's on the screen is the player's Home button, our mark in a disc
at the top left; a press on it (a click on a computer, a tap on a phone; never a key, AV234) freezes the work underneath, silent and dimmed, like a
console's Home button: a play disc to go back in, Leave, and the column beside the work (Save, Share, More, Next and
Previous). More holds Sound and volume, Quality, Look speed and Invert look where the work looks, About with "How it plays", Not for me
and Report. The Home button is the same on every work and **shows nothing of yours**: your menus, pause, restart,
stats, objective, settings and modes are yours, inside your frame. Sound and volume is the player's (runtime 1.24.0,
AV192): on a computer a mute and a volume slider, on a phone the mute (the phone's buttons are the volume); muted
until the first touch inside the frame. Quality is the player's too (runtime 1.25.0, AV193): Auto, Low and High, the
same on every work (`playspace.quality`, `on("quality")`). The end card shows only when a work really ends
(`end()`) or reports an error; it says why, offers Share and Up next and counts down to the next work. Idle is a
datum, never a card. A work **tells**: `ready()`, `start()`, `moment(name, data)`, `end({ score, outcome })`,
`progress(step, of, label)`, `score(n)`, `idle()`, `error(message)`, `share()`, `save()`, and declares `kind` and
`controls: false` in `playspace.json` (`idle` there is read and changes nothing on screen); it **hears** `pause`,
`resume`, `mute`, `orientation`, `insets`, `arm`, `facts`. `menu()` and `stat()` (SDK 0.13.0, runtime 1.14.0, AV65)
are accepted and recorded, drawn nowhere (AV191, D4): `menu.score` and `menu.restart` are still read by the end
card's Play again and the board, and `score`, `end` and the outcome feed the end card. It still **never asks** the
chrome for anything: not to hide or move the button, not a colour, a like, a button or a menu item of its own, a
count drawn by the chrome, or a hint of its own over the frame; its own menus live inside its frame, and the player
still freezes it around them. The render defaults are the player's (runtime 1.5.1, 1.5.2, 1.17.0): in the
app and on a touch screen `devicePixelRatio` reads at most 1.5, and every frame is delivered on Auto (from 1.5.2 to
1.26.0 a slow frame clock was halved to a steady 30 there; since 1.28.0, AV235, no tier thins frames), both on `stats`
and `frame_stats` (`pixelRatio`, `cadence`). `playspace.json`
`"pixelRatio"` (what a work can take) is CO 16's word, documented and not yet read.

**Not the work's: the feel.** `camera.comfort()` (speed, smoothing, slop, invertY, the curve) is the player's, one
setting for every work (AQ25 (h)), read-only for a work; the player sets it by the runtime's bounded `comfort`
message. A work names only the fallback's mouse units, `look.radPerPx`.

**The stick is live only when something listens** (AQ25 (b)): the declaration's direction `keys`, the host's facts
naming keys in a set, a read of `moveX`/`moveY` (each frame, from the first), the SDK's `locomotion`, or a bound
`moveX`; for an undeclared original only, a key listener the runtime saw it register on the page. Otherwise it is not drawn and its corner's touches are the playfield's (0.16.0;
under `own` the work's). An undeclared original with a manifest of its own and no stick in it gets no stick.

**Typing in the work's own field** (0.24.0, runtime 1.39.0, DECISIONS AV320): a work that asks for text (a name, a
line, a search) puts its own `<input>`, `<textarea>` or `contenteditable` on its page; there is no SDK call and no
manifest field for it. While a text field of the work has the focus every key goes to the field as typed (nothing is
translated); on a phone the stick, A, B and the pill are hidden and every key they held is let go (from a focus that
follows a touch), and a touch outside the field lets the field go and still reaches the work; the first Esc is the
work's, and lets the field go if the work did not; the player's pause lets it go too; Buddy never starts and presses
nothing while a field has the focus. The cap is the field's own `maxlength`. Playspace's runtime never reads,
records or sends what is typed in a work's field: the frame tells the player only that a field has the focus
(`typing`, on or off). The limits: a field inside a closed shadow root or inside a frame of the work's own is not
seen as a field (text mode does not begin for it, and a key typed in a closed root may be counted as a key).

## 0. Ten rules before any row

**Map, never remove** (SDK 0.14.0, DECISIONS AV166, AV182, AV231; it outranks every row below): never remove a control
path, handler, menu, hint or touch mode the creator built. The runtime presses the work's own keys, so a key table, a
Space handler, a menu, a hint line, a joystick of its own and a mute of its own all stay as they are. Where a row or a
recipe below still shows a deletion from before 0.14 (rows 1 and 2, rule 3's source edit, the engine recipes'
"Delete:"), read the work's own lines as kept: the axes may be read beside them, never in their place. **Map, never
remove is about the creator's code, not about drawing** (AV231, the owner, 2026-11-09; AV239, 2026-11-10): every
handler stays, and the drawing is **the Playspace set** (AV254): every needed action has a control of the set, and a
key that repeats another control or the work's own screen, or that play does not depend on, is left out in the
file's `extra` with its reason (section 0.5).

1. **One shape.** `playspace.layout({ v: 3, ... })`, only what the defaults cannot guess, once, where the work starts
   reading input. On a computer a subscriber or an axis read is already the declaration; declare anyway.
2. **Three verbs and the button.** Each frame `playspace.input.axis("moveX")` and `("moveY")` (-1..1, up negative) in
   the camera's frame; `playspace.camera.onLook((yaw, pitch) => ...)` (radians, yaw right and pitch up positive) onto
   the work's own camera; `playspace.input.onIntent((i) => ...)` returning true for what it handled, where
   `{ type: "action", on, t0 }` is the one verb with no place on the screen.
3. **Two shapes.** A **source edit** where the input region is readable: subscribe on every device beside the key,
   mouse and touch reads it reads, which stay (map, never remove: the real keys and click reach the work on a computer,
   nothing synthetic there; on a phone the player presses the same keys, so a verb answered both ways answers once by
   leaving its intent unanswered, rule 6).
   **A view from inside takes the mouse** (AV49): a work whose camera is the player's eyes or rides behind them, the
   look turning where they face (the map's `view: "inside"`), source edit or glue that subscribes to `onLook` on a
   computer, says `"capture": true` beside `"pointer": "look"` in `playspace.json` (SDK 0.28.0, AV397; a hand
   `layout()` says `look: { computer: "capture" }`, SDK 0.9.2), whatever its original did: a click takes the mouse, its
   movement turns the view and Esc gives it back; the SDK takes and gives back the lock, so the work still never calls
   `requestPointerLock`. A view from around (an orbit about a thing, a builder's or a viewer's camera;
   `view: "around"`) leaves the word out: a drag turns it. You decide which the work is. Two exceptions: a work whose
   click must land at a point on the scene beside the look (a `tap` that carries a target: place, pick, throw where the
   pointer is) leaves the word out, because under the lock a click lands at the centre; and the glue below, which leaves the original's own
   mouse single on a computer (13th Floor), is outside the rule, since it never subscribes to `onLook` there. A work
   whose original captured the mouse keeps the declaration as before.
   A **glue** beside an untouched original where the input is minified or an engine's: declare on every device, then
   `if (!ps.touch.device) return;` before any `onLook` or intent subscription, so the original's own keys, mouse and
   pointer lock stay single on a computer. A declaration-only glue needs no gate.
4. **The stick is live only when something listens**: a read of the axes, or `keys` naming the direction keys. Nothing
   else lights it for a declared work (the check's recorded keys count only for an undeclared original since
   `f34c8ea`): a work that reads nothing gets no stick drawn (SDK 0.16, AV186) and its corner is the playfield's.
5. **A tap acts where it lands and never walks** (AQ24). Unhandled, it is the click at the point on a touch screen; on
   a computer the real click already reached the work and the SDK adds none. A work whose own tap walks (a
   tap-to-walk, a point-and-click mover) keeps it: the manifest says `tap: "work"` and the tap passes through; AQ24
   rules our stick, never an edit of the work.
6. **Space is the button on a computer** for a declared work with an `action`, once per press, and the real key still
   arrives: keep the work's own Space handler and answer that verb there alone (no `onIntent` branch for it, or it fires
   twice); the file puts Space on A (`a`), and on a phone the player presses Space. No `action` intent is
   raised beside a pressed Space, so there is no reason left to delete the handler.
7. **Every work has the same few controls** (the Playspace set, runtime 1.34.0, AV254; section 0.5): the stick, A,
   B and the pill, each where section 0.5's file names it, with its word drawn in it; drawn by the player, never by
   the work. Never a button or a hint drawn over the frame by the glue. A game's own touch mode stays in its code; ours
   draws beside it and owns only its own controls (AV166 call 2; AV239; row 17). A game's own on-screen joystick that
   moves as the keys do is a repeat: leave `move` out and name the keys in `extra` as `repeat`.
8. **A second verb is B** (SDK 0.11, AV29): in the file it is `b`; in a glue's declaration `secondary: "Run"` (and
   `keys.secondary` where it must press the work's key), read as `{ type: "secondary", on }` as the action is read. What
   is held goes on B, what is tapped on A (a computer's Shift is B, and five Shifts open Sticky Keys on Windows). Past A
   and B there is the pill for the work's own menu key and nothing else: a verb with no control of the set is in
   `extra` with its reason, or the work does not fit the set (section 0.5). A declared `dash` stays a burst, never a
   stand-in for a held sprint. On a computer Shift and the right mouse button (SDK 0.12, AV58) are the second button
   already: a work whose sprint is Shift keeps that handler only where it is not also answering `secondary` (or it
   fires twice), as rule 6 says for Space; where B is live the browser's context menu does not open on the frame.
9. **Escape is the work's** (runtime 1.27.0, AV234, reversing AV63): it reaches the work like any key on a computer,
   and the player's Home button is a button (a click, a tap), never a key. The Home button freezes the work underneath
   under the player's Home menu, which shows **nothing of the work's**, only what is the same on every work (Leave,
   Next, Save, Share, Sound and volume, Quality, About). The work's pause and resume logic also hangs on
   `playspace.on("pause")` and `on("resume")` (row 29); its own menus, pause screen, pause button, options, restart and
   game over stay whole (map, never remove), on their own keys, Escape included, and their own taps; on a phone a menu
   on Escape gets the pill in the file (`esc`, at the top left since runtime 1.34.0), `Escape` named like any key. Nothing
   of the work's own Esc is rebound. A captured mouse let go by the browser's Esc is the work's to answer
   (`pointerlockchange`); the player does nothing. **What the transcoder writes of a work's menus** (SDK 0.18.0, AV194): it inventories the work's pause,
   options and title menus and its HUD (work.json's `menu.items`) as a record and mirrors none of it:
   - **never** `menu.settings`, `modes`, `objective` or `stat` (the player records the calls of a work published
     before and draws them nowhere; the check records one by name, a measurement since AV204, never a refusal);
   - `playspace.menu({ score: { unit, better }, restart })` only where the work keeps a score or restarts without a
     reload, `on("restart")` calling its own restart (the end card's Play again and the board read them);
   - the work's own quality switch follows the player's Quality (row 36); volume needs nothing (the player's level sits
     above every sound the work makes); a mute of its own stays and hangs on `on("mute")` (row 43);
   - `end` (or `complete`) only at a real end (row 38); a game over the work retries from at once is a
     `moment("run_ended")` and a `score`, never an `end`.
10. **Words name the gesture, never a number**: "left stick moves", "drag to look", "push harder to dash", "hold a
    moment".

## 0.5 The control manifest: the Playspace set (version 3 since runtime 1.34.0; a computer's keys since 1.35.0; DECISIONS AV239, AV252, AV254, AV255)

Every work on Playspace is played with the same few controls, on a phone and on a computer:

| | On a phone | On a computer |
|---|---|---|
| Move (`move`) | the stick, bottom left, pressing the work's own move keys | W A S D or the arrows, both pressing the work's own move keys |
| A (`a`) | the large button, bottom right, pressing the work's own key | Space |
| B (`b`) | the smaller button, up and toward the edge | Shift (either) |
| The menu (`esc`) | the pill, top left, the work's word in it | Esc |
| The pointer (`pointer`) | a drag on the work (the mouse held, or the view turning) and a tap (the click) | the mouse and its click, the work's own |

### The file

**The file's version is 3** (`"v": 3`); the code's `playspace.layout({ v: 3, ... })` is a different thing (for `own`,
`avoid`, `select` and a captured look), never written into the file. `playspace.json`'s `"controls"` (a bundle's at
its root, a source's `public/playspace.json`, which its build ships; never `work.json`, whose `controls` is the list of
control files; `false` stays the creator's opt-out). Only `v` is required; each of `move`, `a`, `b`, `esc` is drawn
only where named (contract `packages/contract/src/hosted-controls.ts`, `ControlsManifestV3`):

    { "v": 3,
      "move":    { "keys": ["KeyW", "KeyS", "KeyA", "KeyD"], "alt": ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], "word": "Move" },
      "a":       { "key": "Space", "word": "Jump" },
      "b":       { "key": "ShiftLeft", "word": "Run", "press": "switch" },
      "esc":     { "key": "Escape", "word": "Menu" },
      "pointer": "look",
      "click":   "Use",
      "fixed":   true,
      "extra":   [ { "key": "KeyH", "why": "unneeded" }, { "key": "Enter", "why": "repeat" } ] }

- `move.keys`: the work's own four keys (up, down, left, right); `alt` a second four it also reads; `word` at most 8.
- `a.key`, `b.key`, `esc.key`: the work's own key (a `KeyboardEvent.code`). `a.key` may be `"click"` (the left mouse
  button where the finger aims), `b.key` `"click2"` (the right). `press: "switch"`: one press holds, the next lets go;
  absent, held while the finger is down. Words at most 8 letters, the pill's at most 6 (Menu when none).
- `pointer`: `"mouse"` (the default: a finger is the mouse, a tap the click), `"look"` (a drag turns the view, a tap
  the click), `"own"` (the work's own touch: none of ours on the work), `"none"`. `click`: the word under the mouse on
  a computer. `capture: true` beside `"pointer": "look"` (0.28.0): on a computer a click takes the mouse and its
  movement turns the view, Esc gives it back, for a view from inside (rule 3); left out, a drag turns the view; a phone
  is the same either way. `fixed: true` for a layout that cannot adapt upright.
- A key in one control only, and not also in `extra` (`why`: `repeat` or `unneeded`); any other field drops the file.

### On a computer

The player presses Space, Shift, Esc and W A S D or the arrows on every work, and our runtime presses the work's own
key for each (Space presses 13th Floor's E, Shift its F); a small picture with no words shows which of those keys the
work uses (a mini keyboard with only them lit, the arrows, the mouse, a text field where the work takes typing),
centred at the stage's bottom for the first 6 s after the work's first picture and 3 s after each resume (runtime
1.44.0), so a HUD of the work's own at the bottom middle is covered only then. How it plays in Info and About says what
each key does; your words still name the phone's controls. The arrows always move (below); every other key the
work reads keeps working (E still opens the door). Only a manifest of the work's own is translated: with none, every
key reaches the work as pressed. What follows from that:

- **Where the work's own key is already Space, a Shift or Esc, it keeps it** and nothing is pressed for it (Racing
  Game's Boost on Shift and Drift on Space stay the browser's own). A then takes Space, else Shift; B Shift, else
  Space; the pill Esc. A key of those three that the work reads for something else (named in `extra`, or heard by the
  check) stays the work's, and its control takes the other key or none. Under a version 3 file Space, Shift and Esc
  press your keys only once the work calls `playspace.start()`: a title screen's "press Space" gets Space. The click on A (`click`) and the right click on B (`click2`) are the mouse's own and take no key.
- **The arrows are always W A S D.** Both press the stick's keys. A work that gives the arrows another meaning (a turn,
  an aim) keeps only the move on a computer; put that meaning on the mouse, A or B, or leave it in `extra`.
- **Held on Shift, tapped on Space.** On Windows five Shift presses in a row open Sticky Keys and take the focus, so
  what is held (run, boost, a modifier) goes on B and what is tapped (jump, use, fire) on A.
- **The letter case under Shift.** Where the work reads Shift itself, a real Shift held makes the browser say "W", not
  "w". A work comparing `event.key` to a lower-case letter then stops moving while the player runs. Do not change the
  creator's handler for it: say it in your report as advice to the creator (compare `event.code`, or lower-case the
  key). Where B is not the work's own Shift, the runtime sends W A S D as plain letters while Shift is down.
- **What Esc cannot promise.** With the mouse captured, or in full screen, the browser takes the first Esc and lets
  the mouse go (or leaves full screen); no page hears it. The work hears `pointerlockchange`. Esc is the work's menu
  key except for that first press; a work that pauses on losing the mouse needs nothing more.
- **Typing stays typing.** Nothing is pressed for the player while a field of the work has the focus, or with Ctrl,
  Meta or Alt held; a focused button or link of the work keeps Space (the rest of the set still presses your keys). Space and the arrows do not scroll the page where they have a
  control (a page that scrolls keeps its scroll).

### Which control suits which action

- **The default.** The stick is the move keys, A the most used verb's key, B the second's, a tap the click, a drag the
  mouse, the pill the work's own menu key.
- **The shooter.** A drag turns the view, so fire goes on A as the click (`"a": { "key": "click", "word": "Fire" }`);
  a held A passes its drag on as look, so one thumb fires and aims.
- **Aim at a point** (a finger on the work aims and fires where it rests): no button; the default pointer.
- **Up is jump.** A platformer whose jump is the up key gets Jump on A as well: a stick is poor at jumps.
- **Run on the rim.** A run that only speeds the walk is the stick pushed to its rim; B stays free.
- **A switch.** B as a switch where the computer holds a key while clicking (a painter's remove).
- **Held on B, tapped on A.** One thumb rolls from B onto A to press both; on a computer B is Shift (Sticky Keys,
  above).

### Four worked files

- **Musewalk** (W A S D and the arrows walk, Shift runs, a drag looks, a click travels, Q goes back):
  `{ "v": 3, "move": { "keys": ["KeyW", "KeyS", "KeyA", "KeyD"], "alt": ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"] }, "a": { "key": "ShiftLeft", "word": "Run" }, "esc": { "key": "KeyQ", "word": "Back" }, "pointer": "own" }`
- **13th Floor** (W A S D, a drag to look, E use, F light; on a computer Space presses E and Shift F):
  `{ "v": 3, "move": { "keys": ["KeyW", "KeyS", "KeyA", "KeyD"] }, "a": { "key": "KeyE", "word": "Use" }, "b": { "key": "KeyF", "word": "Light" }, "pointer": "look", "click": "Use" }`
- **Racing Game** (the arrows and W A S D drive, Shift boosts, Space drifts, R resets; C and H are a camera and a
  horn play does not depend on): Reset on the pill (Esc presses R on a computer; Shift and Space are its own).
  `{ "v": 3, "move": { "keys": ["ArrowUp", "ArrowDown", "ArrowLeft", "ArrowRight"], "alt": ["KeyW", "KeyS", "KeyA", "KeyD"], "word": "Drive" }, "a": { "key": "ShiftLeft", "word": "Boost" }, "b": { "key": "Space", "word": "Drift" }, "esc": { "key": "KeyR", "word": "Reset" }, "extra": [{ "key": "KeyC", "why": "unneeded" }, { "key": "KeyH", "why": "unneeded" }] }`
- **Svelte Snake** (its own swipe turns the snake exactly as its arrows do): nothing of ours.
  `{ "v": 3, "pointer": "own", "extra": [{ "key": "ArrowUp", "why": "repeat" }, { "key": "ArrowDown", "why": "repeat" }, { "key": "ArrowLeft", "why": "repeat" }, { "key": "ArrowRight", "why": "repeat" }] }`

**The never-list line that outranks the rest:** never remove a control path, handler, menu, hint or touch mode the
creator built; it stays on its own key, and the set presses that key.
