Elevator toy

A tiny physics playground of cabins, shafts and timing, deterministic from a seed, made for one more run.

This is a browser game spec on Spekkr, published by nova. It is listed with the other specs. Paste the line to an agent that can open a web address, and the agent fetches the files and builds from them.

Spec
nova/elevator-toy
Version
0.2.2
Published by
nova
Updated
15 Nov 2026

Build this spec

Build the spec at https://spekkr.com/nova/elevator-toy/start.md.

Paste this to your AI agent. It opens the address, fetches the spec's files, records your choices and builds from them. Nothing to install, no account.

Published by nova.

What does the result look like?

Elevator toy: heroElevator toy: idleElevator toy: loop

What can I customize?

Units metric uses metres and seconds. playful uses floors and beats.

Your choices go into the line you copy. Anything else is yours to edit, but it leaves the tested path.

What do I get?

  • spec.md Requirements and acceptance checks.

    Elevator toy

    What this builds

    A side-on view of several elevator shafts. Cabins have mass, cables, and a motor that accelerates up to a speed cap. They must not occupy the same shaft segment. A run is a sequence of call-button presses and cabin commands, and with a fixed seed it is deterministic. This is an original toy, not a copy of another playground.

    Read spekkr.inputs.json first. shafts and floors size the building. seed fixes any passenger spawn. passengers and cables change what is drawn. units only change labels; the numbers in design.md are in metres and seconds and always hold.

    Out of scope

    • A real building controller, safety certification, or hardware.
    • Network or a multiplayer lobby.
    • A story mode longer than a single building.

    Requirements

    Each requirement has an id. Checks name the id they cover.

    R1. The building
    • Shafts are 2.4 m wide and 0.4 m apart. Each floor is 3.2 m high, with a 0.2 m slab.
    • A cabin is 2.2 m wide and 2.8 m high, mass 800 kg, max speed 4 m/s, max acceleration 1.5 m/s².
    • The origin is the floor of the ground storey, at the left of shaft 0. Time is in seconds, stepped at 1/60 s.

    Accept when: the default building's bounding numbers match design.md, and a cabin at rest on floor 0 has its floor at z = 0.05 m (the sill).

    R2. Motion
    • A command to a floor accelerates, cruises, and decelerates so the cabin stops at that floor's sill, within 0.01 m, with speed 0.
    • The motion is the trapezoid in design.md. There is no bounce.
    • The same commands and the same seed produce the same position at every step, bit-identical in the recorded trail.

    Accept when: the fixture run in design.md has the cabin positions listed at t = 1, 2, 4 and 8 seconds, each within 0.01 m, and a second run hashes to the same trail.

    R3. Collisions and doors
    • Two cabins in the same shaft may not overlap. A command that would cause an overlap is refused, and the cabin already moving keeps its plan.
    • Doors may be open only when speed is 0 and the cabin floor is within 0.01 m of a sill. A passenger may enter only through an open door.
    • A cabin with passengers off never spawns people; the physics of empty cabins still holds.

    Accept when: the near-miss fixture stops the second cabin one floor short, and a door-open at speed 0.1 m/s is refused.

    R4. Recording
    • One command writes a headless recording: a JSON trail of cabin positions each step, and a 5-second frame sequence at 30 frames a second for the fixture run.
    • Screenshots idle-shafts, two-moving, near-miss and all-parked are frames from that sequence at the times in design.md.

    Accept when: the frames match the goldens within the tolerance, and the JSON trail matches the fixture positions.

    R5. Files
    • The build has no network. Units only change labels.

    Accept when: the command passes for 2 shafts and for 5, and for both unit labels.

    Verification

    A deterministic run with a fixed seed reaches the cabin positions in the fixture trail. Collision and door-timing tests cover the near-miss and a door opening at speed. A short headless recording is written and the four frames are checked against goldens. No hardware and no network.

    Definition of done

    • Every acceptance check above runs from one command, and all pass at the person's inputs.
    • A README says how to play, how to replay a seed, and how to run the checks.
    # Elevator toy
    
    ## What this builds
    
    A side-on view of several elevator shafts. Cabins have mass, cables, and a
    motor that accelerates up to a speed cap. They must not occupy the same
    shaft segment. A run is a sequence of call-button presses and cabin
    commands, and with a fixed seed it is deterministic. This is an original
    toy, not a copy of another playground.
    
    Read `spekkr.inputs.json` first. `shafts` and `floors` size the building.
    `seed` fixes any passenger spawn. `passengers` and `cables` change what is
    drawn. `units` only change labels; the numbers in `design.md` are in
    metres and seconds and always hold.
    
    ## Out of scope
    
    - A real building controller, safety certification, or hardware.
    - Network or a multiplayer lobby.
    - A story mode longer than a single building.
    
    ## Requirements
    
    Each requirement has an id. Checks name the id they cover.
    
    ### R1. The building
    
    - Shafts are 2.4 m wide and 0.4 m apart. Each floor is 3.2 m high, with a
      0.2 m slab.
    - A cabin is 2.2 m wide and 2.8 m high, mass 800 kg, max speed 4 m/s, max
      acceleration 1.5 m/s².
    - The origin is the floor of the ground storey, at the left of shaft 0.
      Time is in seconds, stepped at 1/60 s.
    
    Accept when: the default building's bounding numbers match `design.md`,
    and a cabin at rest on floor 0 has its floor at z = 0.05 m (the sill).
    
    ### R2. Motion
    
    - A command to a floor accelerates, cruises, and decelerates so the cabin
      stops at that floor's sill, within 0.01 m, with speed 0.
    - The motion is the trapezoid in `design.md`. There is no bounce.
    - The same commands and the same seed produce the same position at every
      step, bit-identical in the recorded trail.
    
    Accept when: the fixture run in `design.md` has the cabin positions listed
    at t = 1, 2, 4 and 8 seconds, each within 0.01 m, and a second run hashes
    to the same trail.
    
    ### R3. Collisions and doors
    
    - Two cabins in the same shaft may not overlap. A command that would cause
      an overlap is refused, and the cabin already moving keeps its plan.
    - Doors may be open only when speed is 0 and the cabin floor is within
      0.01 m of a sill. A passenger may enter only through an open door.
    - A cabin with `passengers` off never spawns people; the physics of empty
      cabins still holds.
    
    Accept when: the near-miss fixture stops the second cabin one floor short,
    and a door-open at speed 0.1 m/s is refused.
    
    ### R4. Recording
    
    - One command writes a headless recording: a JSON trail of cabin positions
      each step, and a 5-second frame sequence at 30 frames a second for the
      fixture run.
    - Screenshots `idle-shafts`, `two-moving`, `near-miss` and `all-parked`
      are frames from that sequence at the times in `design.md`.
    
    Accept when: the frames match the goldens within the tolerance, and the
    JSON trail matches the fixture positions.
    
    ### R5. Files
    
    - The build has no network. Units only change labels.
    
    Accept when: the command passes for 2 shafts and for 5, and for both unit
    labels.
    
    ## Verification
    
    A deterministic run with a fixed seed reaches the cabin positions in the
    fixture trail. Collision and door-timing tests cover the near-miss and a
    door opening at speed. A short headless recording is written and the four
    frames are checked against goldens. No hardware and no network.
    
    ## Definition of done
    
    - Every acceptance check above runs from one command, and all pass at the
      person's inputs.
    - A README says how to play, how to replay a seed, and how to run the
      checks.
    

    Open spec.md as plain text

  • design.md Shaft geometry, the motion trapezoid, and the fixture trail.

    Design

    This file fixes the parts that are easy to get wrong. The language and tools are up to you, as long as the numbers here hold.

    Default building

    3 shafts, 6 floors. Shaft i's centre is at x = 1.2 + i * 2.8 m. Floor n's sill is at z = n * 3.2 m. The top of the last floor's slab is 6 * 3.2 + 0.2 = 19.4 m.

    Trapezoid move

    To go a distance d metres (absolute), with v = 4, a = 1.5:

    • If d is less than v² / a (10.666… m), the move is a triangle: accelerate halfway, decelerate halfway. Peak speed is sqrt(a * d).
    • Otherwise: accelerate 4/1.5 s, cruise, decelerate 4/1.5 s.

    Fixture run (seed 1, passengers off, 3 shafts)

    Commands at t = 0: cabin 0 to floor 5, cabin 1 to floor 3, cabin 2 stays at 0.

    Documented positions of cabin 0's floor, in metres, at 1/60 s steps nearest these times (exact step index round(t * 60)):

    t (s)Cabin 0 zCabin 1 zCabin 2 z

    The machine-checked trail is fixtures/elevator-trail.json. Tests compare every cabin's z at every step through t = 12 s to that file, not to a re-typed table. Resting z on floor n is n * 3.2 + 0.05 metres.

    Near-miss fixture

    Two cabins share shaft 0: A starts at floor 0 going to 5, B starts at floor 5 going to 0, both commanded at t = 0. They must not overlap. B stops at floor 4 (resting z 12.85 m). The closest-approach frame is screenshot near-miss. The trail for this fixture is fixtures/elevator-nearmiss.json.

    Screenshot times (fixture run, except near-miss)

    Filet (s)
    idle-shafts0
    two-moving2
    all-parked12

    Tolerance: 8 levels, 98% of pixels.

    Inputs

    KeyLabelDefaultNotes
    shaftsNumber of shafts3From 2 to 5.
    floorsNumber of floors6From 4 to 12.
    seedPhysics seed1A whole number. The same seed and the same inputs replay the same run.
    passengersShow passengersonPeople appear at floors and wait for a cabin.
    cablesShow cablesonA line from each cabin to the top of its shaft.
    unitsUnitsmetricmetric uses metres and seconds. playful uses floors and beats.

    Acceptance at the defaults

    The numbers, names and fixture paths already in this file are the authority. Where a later table or a shipped fixture file disagrees with prose, the table or the fixture wins.

    FixtureRole
    design.mdA shipped fixture. The build may move it, but then design.md must name the new path.
    fixtures/elevator-nearmiss.jsonA shipped fixture. The build may move it, but then design.md must name the new path.
    fixtures/elevator-trail.jsonA shipped fixture. The build may move it, but then design.md must name the new path.

    Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement names another size. Tolerance, unless a tighter figure is given above: 8 levels, 98% of pixels, with motion, cursors and clocks frozen as this file says. A build's goldens are of that build; they do not have to match a shipped reference preview pixel-for-pixel if the tool or the type is different, but they do have to match this file's layout, counts and copy.

    Screenshots

    These pictures are headless-Chrome captures of the working reference in reference/preview.html, at the default inputs. They are not drawings of a product that has not been built. The first picture is the one Spekkr shows on the spec's card. A build may ship its own goldens; those goldens are of that build and do not have to match these frames pixel-for-pixel.

    FileWhat it shows
    shots/shafts.pngThree shafts, six floors, seed 1; the mid cabin sits between 3 and 4.

    How to verify

    1. Run the checks at the default inputs, without a network.
    2. Walk through the scripted playthroughs, fixture lookups or goldens named in the requirements; each must match this file.
    3. Repeat once at the person's inputs when they differ from the defaults.
    4. A deterministic run with a fixed seed reaches the cabin positions in the fixture trail. Collision and door-timing tests cover the near-miss and a door opening at speed. A short headless recording is written and the four frames are checked against goldens. No hardware and no network.
    # Design
    
    This file fixes the parts that are easy to get wrong. The language and
    tools are up to you, as long as the numbers here hold.
    
    ## Default building
    
    3 shafts, 6 floors. Shaft i's centre is at x = 1.2 + i * 2.8 m. Floor n's
    sill is at z = n * 3.2 m. The top of the last floor's slab is 6 * 3.2 +
    0.2 = 19.4 m.
    
    ## Trapezoid move
    
    To go a distance `d` metres (absolute), with `v = 4`, `a = 1.5`:
    
    - If `d` is less than `v² / a` (10.666… m), the move is a triangle:
      accelerate halfway, decelerate halfway. Peak speed is `sqrt(a * d)`.
    - Otherwise: accelerate 4/1.5 s, cruise, decelerate 4/1.5 s.
    
    ## Fixture run (seed 1, passengers off, 3 shafts)
    
    Commands at t = 0: cabin 0 to floor 5, cabin 1 to floor 3, cabin 2 stays
    at 0.
    
    Documented positions of cabin 0's floor, in metres, at 1/60 s steps
    nearest these times (exact step index `round(t * 60)`):
    
    | t (s) | Cabin 0 z | Cabin 1 z | Cabin 2 z |
    | --- | --- | --- | --- |
    The machine-checked trail is `fixtures/elevator-trail.json`. Tests compare
    every cabin's z at every step through t = 12 s to that file, not to a
    re-typed table. Resting z on floor n is `n * 3.2 + 0.05` metres.
    
    ## Near-miss fixture
    
    Two cabins share shaft 0: A starts at floor 0 going to 5, B starts at
    floor 5 going to 0, both commanded at t = 0. They must not overlap. B
    stops at floor 4 (resting z 12.85 m). The closest-approach frame is
    screenshot `near-miss`. The trail for this fixture is
    `fixtures/elevator-nearmiss.json`.
    
    ## Screenshot times (fixture run, except near-miss)
    
    | File | t (s) |
    | --- | --- |
    | idle-shafts | 0 |
    | two-moving | 2 |
    | all-parked | 12 |
    
    Tolerance: 8 levels, 98% of pixels.
    
    ## Inputs
    
    | Key | Label | Default | Notes |
    | --- | --- | --- | --- |
    | `shafts` | Number of shafts | 3 | From 2 to 5. |
    | `floors` | Number of floors | 6 | From 4 to 12. |
    | `seed` | Physics seed | 1 | A whole number. The same seed and the same inputs replay the same run. |
    | `passengers` | Show passengers | on | People appear at floors and wait for a cabin. |
    | `cables` | Show cables | on | A line from each cabin to the top of its shaft. |
    | `units` | Units | metric | metric uses metres and seconds. playful uses floors and beats. |
    
    ## Acceptance at the defaults
    
    The numbers, names and fixture paths already in this file are the
    authority. Where a later table or a shipped fixture file disagrees with
    prose, the table or the fixture wins.
    
    | Fixture | Role |
    | --- | --- |
    | `design.md` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    | `fixtures/elevator-nearmiss.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    | `fixtures/elevator-trail.json` | A shipped fixture. The build may move it, but then `design.md` must name the new path. |
    
    Golden frames are compared at 1400 by 1000 CSS pixels unless a requirement
    names another size. Tolerance, unless a tighter figure is given above: 8
    levels, 98% of pixels, with motion, cursors and clocks frozen as this file
    says. A build's goldens are of that build; they do not have to match a
    shipped reference preview pixel-for-pixel if the tool or the type is
    different, but they do have to match this file's layout, counts and copy.
    
    ## Screenshots
    
    These pictures are headless-Chrome captures of the working reference in
    `reference/preview.html`, at the default inputs. They are not drawings of a
    product that has not been built. The first picture is the one Spekkr shows on
    the spec's card. A build may ship its own goldens; those goldens are of that
    build and do not have to match these frames pixel-for-pixel.
    
    | File | What it shows |
    | --- | --- |
    | `shots/shafts.png` | Three shafts, six floors, seed 1; the mid cabin sits between 3 and 4. |
    
    
    ## How to verify
    
    1. Run the checks at the default inputs, without a network.
    
    2. Walk through the scripted playthroughs, fixture lookups or goldens
    named in the requirements; each must match this file.
    
    3. Repeat once at the person's inputs when they differ from the defaults.
    
    4. A deterministic run with a fixed seed reaches the cabin positions in
    the fixture trail. Collision and door-timing tests cover the near-miss and
    a door opening at speed. A short headless recording is written and the
    four frames are checked against goldens. No hardware and no network.
    

    Open design.md as plain text

  • tasks.md Build tasks in order, each with a check.

    Tasks

    Work in order. Finish a task's check before starting the next.

    1. Set up. Set up a web app (or the stack you have chosen) and a test runner that can open a page, click, and compare screenshots. Read spekkr.inputs.json first. Check: a blank or heading page loads, and an empty test run passes.
    2. The building (R1). Build what R1. The building asks for, to the numbers in design.md. In particular: Shafts are 2.4 m wide and 0.4 m apart. Each floor is 3.2 m high, with a 0.2 m slab. Check: the R1. The building acceptance checks pass.
    3. Motion (R2). Build what R2. Motion asks for, to the numbers in design.md. In particular: A command to a floor accelerates, cruises, and decelerates so the cabin stops at that floor's sill, within 0.01 m, with speed 0. Check: the R2. Motion acceptance checks pass.
    4. Collisions and doors (R3). Build what R3. Collisions and doors asks for, to the numbers in design.md. In particular: Two cabins in the same shaft may not overlap. A command that would cause an overlap is refused, and the cabin already moving keeps its plan. Check: the R3. Collisions and doors acceptance checks pass.
    5. Recording (R4). Build what R4. Recording asks for, to the numbers in design.md. In particular: One command writes a headless recording: a JSON trail of cabin positions each step, and a 5-second frame sequence at 30 frames a second for the fixture run. Check: the R4. Recording acceptance checks pass.
    6. Files (R5). Build what R5. Files asks for, to the numbers in design.md. In particular: The build has no network. Units only change labels. Check: the R5. Files acceptance checks pass.
    7. Goldens. Capture the frames named in design.md at the defaults, with motion frozen where the file says so. Compare them within the stated tolerance. Check: the frames match, and a pixel-level check fails if a documented element is removed on purpose.
    8. Finish. Write a README that says how to install what is needed, how to change the inputs, and how to run the checks. Run the one command from a clean folder. Check: every item under Definition of done in spec.md is true.
    # Tasks
    
    Work in order. Finish a task's check before starting the next.
    
    1. **Set up.** Set up a web app (or the stack you have chosen) and a test
    runner that can open a page, click, and compare screenshots. Read
    `spekkr.inputs.json` first.
       Check: a blank or heading page loads, and an empty test run passes.
    
    2. **The building (R1).** Build what `R1. The building` asks for, to the
    numbers in `design.md`. In particular: Shafts are 2.4 m wide and 0.4 m
    apart. Each floor is 3.2 m high, with a 0.2 m slab.
       Check: the `R1. The building` acceptance checks pass.
    
    3. **Motion (R2).** Build what `R2. Motion` asks for, to the numbers in
    `design.md`. In particular: A command to a floor accelerates, cruises, and
    decelerates so the cabin stops at that floor's sill, within 0.01 m, with
    speed 0.
       Check: the `R2. Motion` acceptance checks pass.
    
    4. **Collisions and doors (R3).** Build what `R3. Collisions and doors`
    asks for, to the numbers in `design.md`. In particular: Two cabins in the
    same shaft may not overlap. A command that would cause an overlap is
    refused, and the cabin already moving keeps its plan.
       Check: the `R3. Collisions and doors` acceptance checks pass.
    
    5. **Recording (R4).** Build what `R4. Recording` asks for, to the numbers
    in `design.md`. In particular: One command writes a headless recording: a
    JSON trail of cabin positions each step, and a 5-second frame sequence at
    30 frames a second for the fixture run.
       Check: the `R4. Recording` acceptance checks pass.
    
    6. **Files (R5).** Build what `R5. Files` asks for, to the numbers in
    `design.md`. In particular: The build has no network. Units only change
    labels.
       Check: the `R5. Files` acceptance checks pass.
    
    7. **Goldens.** Capture the frames named in `design.md` at the defaults,
    with motion frozen where the file says so. Compare them within the stated
    tolerance.
       Check: the frames match, and a pixel-level check fails if a documented
    element is removed on purpose.
    
    8. **Finish.** Write a README that says how to install what is needed, how
    to change the inputs, and how to run the checks. Run the one command from
    a clean folder.
       Check: every item under Definition of done in `spec.md` is true.
    

    Open tasks.md as plain text

  • reference/preview.html A working reference preview of the default view, used to make the listing pictures. A build does not have to start from this file.
  • reference/fonts/fonts.css Webfont faces for the reference preview.
  • reference/fonts/Geist.ttf Geist variable typeface for the reference preview.
  • reference/fonts/GeistMono.ttf Geist Mono variable typeface for the reference preview.
  • reference/fonts/InstrumentSerif.ttf Instrument Serif for the reference preview.
  • reference/fonts/InstrumentSerif-Italic.ttf Instrument Serif italic for the reference preview.

Is it for me?

Platforms
web
Tools
TypeScript

What does it need?

Agent permissions
shell
Commands it runs
install a test runner install a tool that writes a frame sequence

What changed?

  • 0.2.215 Nov 2026Names what it builds.
  • 0.2.115 Nov 2026Enrich the cutaway with lit floors, cabin doors, and side wings, and add an animated loop.
  • 0.2.014 Nov 2026Polished reference preview and new listing shots, including a short loop.
  • 0.1.014 Nov 2026First version.

For agents: start.md says how to build this spec, spec.json holds everything on this page, and bundle.tar.gz holds its files.