# Type the novel ## What this builds A trainer that asks you to type a passage from a bundled public-domain book. Correct and incorrect keystrokes are tracked, and a words-per-minute figure is computed from an injectable clock. A fixture passage has a documented score. The book files are shipped; a test fails if the loader needs a network. Rights are listed in a licence file. Read `spekkr.inputs.json` first. `title` labels the page. `book` chooses a bundled id. `passage` is the length. `sounds` and `caret` change the chrome. The clock is injectable. ## Out of scope - A copyrighted novel, or a live bookstore. - A network fetch of a book in the checks. - A secretarial certification. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Loading a book - Each bundled book is a text file and a licence note. The default excerpt loads without a network, and a hook fails if a fetch is attempted. - A missing book id is refused with a message that names it. Accept when: the default book loads, a bad id is refused, and the hook stays quiet. ### R2. Scoring - The fixture tape `fixtures/type-run.json` types the short passage of the default book, with listed mistakes, on an injected clock. - Correct and incorrect keystroke counts, and WPM, match the file. WPM is (correct words / minutes), with a word as five characters, as in the file. - A backspace un-types the last character and can correct a mistake, as in a second tape. Accept when: both tapes match the counts and WPM in their files. ### R3. Frames and files - Goldens: the start of the passage, a mid point, a visible error, and a result card. - One command loads the book, runs the tapes, the hook, and writes the frames. No network. Accept when: the command passes for both passage lengths, and the frames match the goldens. ### R4. 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 A fixture passage tracks correct and incorrect keystrokes and a WPM figure against a file, using an injectable clock. A bundled public-domain book loads with no network; a fetch hook fails otherwise. Licence notes are shipped. Golden frames cover the run. ## Definition of done - Every acceptance check above runs from one command, and all pass at the person's inputs. - A README says how to pick a book, how the books are licensed, and how to run the checks.