# Element craft ## What this builds A bench of elements. Drag one onto another and a recipe table decides what, if anything, appears. The table is a frozen file shipped with the project, so a build and its tests never call a live model or an API. The tables in this spec are original. People can later swap in their own table without changing the rules. Read `spekkr.inputs.json` first. `title` labels the bench. `table` chooses the recipe file. `starting_pack` is the opening set, and must be ids that exist in that table's starting list or be refused. `discoveries` and `duplicates` change the bench. ## Out of scope - A live language model or any network call to invent recipes. - Accounts, clouds, or a public recipe book. - Chemistry claims. Names are playful, not scientific. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. The bench - At start, one tile per id in `starting_pack` is on the bench, with the label from the table. - Tiles can be dragged. Dropping a tile on another is a combine. Dropping it on empty space just moves it. - `title` is the heading. Accept when: a load with the default pack shows four tiles, and a screenshot of the bench matches the `bench` golden within the tolerance in `design.md`. ### R2. The recipe table - A recipe is an unordered pair of ids and a product id, or a miss (no product). - The chosen `table` is a JSON file in the repo. Combining A with B is the same as B with A. - The product, if any, is added to the bench as a new tile. If `duplicates` is off and the product is already on the bench, no second tile is added, but the discovery is still recorded if new. Accept when: every fixture pair in `design.md` returns the stated product or miss, and a swapped-order call returns the same. ### R3. Discoveries - A discovery is a product the person has made at least once. It is recorded even if `discoveries` is off. - If `discoveries` is on, a side list shows each discovery in the order it was first made, with the pair that first made it. - Starting-pack tiles are not discoveries. Accept when: the first-combo fixture records one discovery, the list shows it only when the option is on, and making it again does not add a second row. ### R4. Unknown pairs - A pair with no recipe is a miss. The two tiles stay where they are. A short miss note appears for one second and then leaves. - A tile cannot be combined with itself unless the table has a recipe for that pair. Accept when: the miss fixture leaves both tiles and writes no discovery. ### R5. Inputs - A `starting_pack` id that is not in the chosen table is refused before the bench loads, with a message that names the id. - An empty pack is refused. Accept when: the bad id `bogus` is refused, and the default pack loads. ### R6. Files - One command runs the table tests, the UI combine tests, and writes the four screenshots. No network. Accept when: the command passes for both tables. ## Verification A frozen recipe table, never a live model, returns the specified product for each fixture pair and a miss for an unknown pair. Order of the two inputs does not matter. UI tests cover drag-combine and take a golden screenshot of a known combo. No network is used in the checks. ## 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 run the checks, and how to add a recipe.