# Vote roadtrip ## What this builds A view of a road, four possible ways, and a countdown. People vote on the next way. When the turn ends, the plurality wins, ties break by a documented order, and the view advances along a graph. In checks the views are fixture images and the voters are scripted; no live street-level service is used. The route and the pictures are original. Read `spekkr.inputs.json` first. `title` sits over the view. `turn_seconds` is the window. `route` chooses the fixture graph. `names` shows counts. `chat` is a local strip and is off in the default checks. ## Out of scope - A live commercial street-level API in the checks. - A real public vote server in the checks; voters are a fake in-process room. - Vehicle physics. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. The graph - A route is a graph of nodes, each with a view image, and edges labelled `left`, `straight`, `right`, or `back` (not every node has every way). - The starting node of `coast` is `c0`. The starting node of `grid` is `g0`. - A missing way cannot be voted for and is not drawn. Accept when: both routes load, `c0` has the ways listed in `design.md`, and a vote for a missing way is refused. ### R2. Votes and ties - During a turn, each voter id may cast or change one vote. - At the end of the turn, the way with the most votes is taken. A tie is broken in the order `straight`, `right`, `left`, `back`. - If no vote was cast, the default way `straight` is taken if it exists, else `right`, else the first listed edge. Accept when: the tally fixtures in `design.md` produce the documented chosen way, including a 2–2 tie and a no-vote turn. ### R3. A scripted session - `fixtures/coast-session.json` is a list of turns, votes, and the expected node after each turn. Starting from `c0`, the session ends at `c-end` after 8 turns. - Views are the fixture images, never a network fetch. A hook around fetch fails the test if a street-view host is contacted. Accept when: the session follows the documented path, and the four screenshots (first view, mid-vote, after the first turn, arrival) match the goldens. ### R4. Files - One command runs graph, tally, session, and fetch-hook tests, and writes the screenshots. The clock is injected. No network. Accept when: the command passes for both routes. ### R5. Inputs - The build reads `spekkr.inputs.json`. Settings label the UI, options turn features on or off, and a swap must be one of its choices. - A value outside a stated range, or a swap that is not one of its choices, is refused before the app starts its checks, with a message that names the key. Accept when: the default inputs render, an illegal swap is refused by name, and changing a visible setting (for example the title) shows up in a later check. ## Verification Vote-tally and turn-protocol tests cover plurality, the documented tie order, and a turn with no votes. A scripted session on fixture imagery follows a documented path. Checks hook fetches so no live street-level API can sneak in. The clock is injected. No public vote server. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to run a local room, how to add a route, and how to run the checks.