# Window swap ## What this builds A quiet page that shows a window view, then swaps to another. The views are fixture clips with documented locations, not a live camera network. An upload hook can be tested with a file, including a refusal of an oversized or typeless file, without opening a camera. The clips are original or permissively licensed. Read `spekkr.inputs.json` first. `title` sits under the frame. `interval` is the swap time; tests inject the clock. `set` chooses the clips. `caption` and `audio` change the chrome. ## Out of scope - A live camera network, or other people's private windows. - A webcam in the checks. - Network to a public swap service in the checks. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Fixture clips and swap - The sample set lists clips, each with a file, a location string, and a duration. At t = 0 the first clip is shown; after `interval` seconds of injected time, the next is shown, wrapping the list. - The caption, if on, is the location string of the current clip. - A fetch hook fails if a camera or a remote clip host is contacted. Accept when: the first and second clips and captions match the file at t = 0 and t = interval, and the hook stays quiet. ### R2. Upload hook and frames - An upload endpoint (in-process) accepts a fixture file of an allowed type and size, and refuses a file that is too large or of a disallowed type, with a message. - There is no getUserMedia path in the checks. Goldens: the first window, after a swap, a caption, and an upload preview of the accepted fixture. - One command runs the swap, the hook, the upload cases, and writes the frames. The clock is injected. No camera and no network. Accept when: accept and refuse cases match, and the four frames match the goldens. ### R3. 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. ### R4. Checks and report - One command runs every acceptance check at the defaults and at the person's inputs, including golden frames where a requirement asks for them. - Checks do not need a network, a paid API, or physical hardware. Accept when: the command passes at the defaults, and a deliberately broken fixture or a wrong price fails it. ## Verification Fixture clips are served with documented locations and swap on an injected clock. Upload and moderation hooks are tested with files, not a live camera. A fetch hook fails if a remote camera host is contacted. Golden frames are taken. Licences are shipped. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how the clips are licensed, how to test an upload, and how to run the checks.