# 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. ## The standard script Sixteen rules, in this order. `short` is the first eight. | # | Id | Statement | Satisfied when | | --- | --- | --- | --- | | 1 | `length` | At least 8 characters | `len(text) >= 8` | | 2 | `digit` | A digit | any `0-9` | | 3 | `capital` | An uppercase letter | any `A-Z` | | 4 | `roman` | A Roman numeral | a substring in the set in the Roman table, case-insensitive | | 5 | `vowel-count` | The Roman numeral equals the number of vowels | vowels are `aeiouAEIOU`; the last Roman token in the text equals that count | | 6 | `month` | A month name or abbreviation | a token in the month table | | 7 | `chess` | A legal pawn move in algebraic notation | a token matching `^[a-h][2-7]$` or a capture `^[a-h]x[a-h][2-7]$` | | 8 | `moon` | A moon-phase character | one of `๐ŸŒ‘๐ŸŒ’๐ŸŒ“๐ŸŒ”๐ŸŒ•๐ŸŒ–๐ŸŒ—๐ŸŒ˜` | | 9 | `prime-length` | The length is prime | 11, 13, 17, 19, 23, 29, 31 | | 10 | `no-repeat-3` | No character appears three times in a row | no run of length 3+ | | 11 | `balanced` | Parentheses are balanced | `()` only; no leftover | | 12 | `colour` | A CSS hex colour | `#` plus 3 or 6 hex digits | | 13 | `sum-digits` | The digits sum to 25 | decimal digits only | | 14 | `weekday` | An English weekday | `Monday`โ€ฆ`Sunday` or a 3-letter abbreviation, any case | | 15 | `anagram` | Contains an anagram of `RULE` | four letters that sort to `ELRU`, any case, not necessarily consecutive | | 16 | `period` | Ends with a period | last character is `.` | Roman tokens recognised: I, II, III, IV, V, VI, VII, VIII, IX, X, XI, XII, XIII, XIV, XV, XVI, XVII, XVIII, XIX, XX. Month table: Januaryโ€“December and Janโ€“Dec, any case. ## Prefix fixtures The exact strings live in `fixtures/prefix-8.txt` and `fixtures/prefix-8-plus.txt` next to the tests. Tests must read those files, not a re-typed copy. - `prefix-8.txt` satisfies rules 1โ€“8 and fails rule 9 (`prime-length`). - `prefix-8-plus.txt` satisfies rules 1โ€“16. A setup test fails if either file is missing, and a check test fails if a file no longer has the claimed properties. ## 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/form.png` | The default form mid-invention: a tree is still required. | ## Dates Rules that could depend on "today" must not. The moon rule is a character in the text, not the real moon. No rule reads the system clock, except the optional `timer`. ## Inputs | Key | Label | Default | Notes | | --- | --- | --- | --- | | `title` | Title | Please choose a password | Shown above the field. | | `start_rules` | Rules at the start | 3 | A whole number from 1 to 5. How many rules are visible before the first success. | | `show_why` | Explain failed rules | on | A failed rule says what it wanted. | | `timer` | Count the time | off | A clock starts on the first keystroke and stops when the last rule is satisfied. | | `script` | Rule script | standard | standard has 16 rules. short stops at 8, for a quicker path. | ## 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/prefix-8-plus.txt` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `fixtures/prefix-8.txt` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `prefix-8-plus.txt` | A shipped fixture. The build may move it, but then `design.md` must name the new path. | | `prefix-8.txt` | 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. ## 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. Unit tests cover each rule with at least one string that passes and one that fails. A checked fixture file satisfies a known prefix of rules and is rejected by the next. A second fixture satisfies the whole script. No rule reads the real date, the real moon, or the network. UI tests take the four screenshots.