Drafts and slots
A draft is a version of the site that the owner can look at before it goes live.
A draft is unlisted, it is noindex, and its forms send no mail.
Slots
A site has a small number of preview slots. Each slot is one draft address at a time.
A slot can own a branch: refs/heads/slot-1 and up. No slot owns a branch
by default. The first write with that slot starts one. A read with
a slot reads the site, because looking is not starting.
Approval
A draft reaches the public only when the owner approves it in the browser.
Approval moves the slot's branch into main.
- If the live site has not moved, the move is a fast-forward. The owner gets exactly the bytes they looked at.
- If the live site has moved, Clave refuses, and the agent answers with
one of two calls:
- merge combines the two and builds a page nobody has seen yet;
- catch-up brings the site into the slot, so the owner looks again.
main never takes a conflict marker. A slot's branch can, because there
is no working copy here to hold a half-done merge.
Posts have no branch
A slot is a line of the site's source, and the posts have one line. So:
- a call that names a slot against the posts is refused;
- a
postsdraft records no branch, because approving one would movemainback to the live commit the draft was built on.
A branch outlives its address
Discarding a slot removes the draft's address. It does not touch git. So a slot that holds work needs a confirmation before it is discarded. That is the one destructive act here.
What the owner does on a draft
The owner leaves comments on the draft. That is what drafts are for.