# Permit city ## What this builds A small-map city builder where almost nothing is built on the day you ask for it. Parcels have zones. A building needs a permit, and a permit can be delayed, denied, or (if the option is on) appealed. The joke is the paperwork, but the rules are strict and testable. The map, the buildings and the forms are original. Read `spekkr.inputs.json` first. `city_name` and `budget` start the game. `map` chooses the parcel file. `hearings` and `appeals` turn those rules on. ## Out of scope - A 3D city or a traffic microsimulation. - Network, multiplayer, or real-world GIS. - A real legal system. The rules are a game. ## Requirements Each requirement has an id. Checks name the id they cover. ### R1. Zoning - Each parcel has a zone: `house`, `shop`, `works`, or `park`, or `none`. - A building type may only be requested on a parcel whose zone is in that type's list in `design.md`. - Rezoning is itself a permit of type `rezone`. Accept when: a house on a `works` parcel is refused, and a house on a `house` parcel is accepted as a request. ### R2. Permits and denials - A permit has a cost, a decision delay of 0 or 3 days if `hearings` is on and the type requires it, and a documented reason if denied. - Denial reasons are the codes in `design.md` (budget, zone, neighbour, hearing). - If `appeals` is on, a denied permit may be appealed once; an appeal costs 200 and is decided the next day, at a 50% chance from a seeded rng. Tests use a seed that produces a known yes and a known no. Accept when: the permit fixtures grant, delay and deny as in the table, and the seeded appeal cases match. ### R3. A scripted city - `fixtures/millstead-script.json` is a list of days and actions. Starting from the `river` map and budget 12000, it must end at the city state in `fixtures/millstead-day-40.json` (budget, buildings, open permits). - A golden map screenshot is taken at day 0, after zoning, at a hearing, and at day 40. Accept when: the ending state matches the file, and the four frames match the goldens. ### R4. Files - One command runs zoning, permit, appeal and script tests, and writes the screenshots. No network. Chance only where a seed is given. Accept when: the command passes on both maps, with hearings off (delays become 0) and on. ### 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 Rule tests cover zoning, permit grants, delays, denials and seeded appeals. A scripted city starting from the river map reaches the documented day-40 state. Four golden map screenshots are checked. No live GIS and no network. ## 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 building type.