ADR-0001 build step 6. requestNewSite creates a client-site or demo as a
Loki project plus a sites row with an honest version 1 (its name and "being
written" — nothing invented), and returns the preview URL at once: no
repository, no queue, no deploy. Apps keep the repository path.
- addSiteVersion: validated n+1 that becomes the preview; theme and settings
carry over; the site row is locked so two edits cannot take the same n.
- publishSiteVersion: publish the preview, or an earlier n (undo).
- /api/sites/[siteId] (GET, versions, publish, state), owner-only through one
rule (requireSiteOwner); someone else's site answers like a missing one.
- The existing Retire button maps its modes onto the state of a data site
(offline, private → preview, restore, delete) with the same plan/confirm.
- The OrangeCat door returns 201 + previewUrl for a data site, and its daily
ceiling counts sites as well as queued apps.
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>