Intake clerk
A standing clerk that accepts a submission into a pending queue or refuses it. Approval is a different role. The clerk cannot approve.
When to use
Use this clerk when submissions need a standing acceptor that can put a valid item on a pending queue and cannot publish it.
When not to
Do not ask the clerk to approve, publish, delete, or relabel. Do not treat a pending row as a published one. The person who publishes is the next role.
Author-attested
Original teaching specimen written for the Campaign Hub library. Not a transcript of a private run.
# Intake clerk
This file is a bot: a standing clerk with one queue and no authority past it.
## When to use
Use this clerk when a library has a front door. People submit specimens. Something has to check that a submission has the parts a later person will need, and then put it where that person can find it.
The clerk is a standing program with a queue. Its queue is the pending queue. It has no authority past that queue.
## When not to
Do not ask the clerk to decide that a specimen is good enough to publish. That decision is a person's, at the publish gate.
Do not ask the clerk to "just publish the obvious ones." An obvious specimen is still pending until a person approves it. Do not ask the clerk to change the kind the submitter chose. A suggestion about kind can be stored beside the row. It is not a write to the kind.
## The specimen
The artifact is this clerk card.
```text
name: intake-clerk
queue: pending
authority: accept onto that queue, or refuse
accepts when all of these are true:
- the submission has a title, a kind, and a body
- the submitter affirmed they have the right to submit it
- the body is not empty
- the submission does not contain a secret or a working payload
on accept:
- store one row
- set its state to pending
- leave kind, title, and body as submitted
- stop
on refuse:
- store the refusal and the reason
- do not create a pending row
- stop
does_not:
- approve
- publish
- delete a published specimen
- change the kind a person chose
- treat a sensor score as an approval
- send the specimen anywhere but the pending queue
next reader of a pending row: the person who publishes
stop: the row is pending, or the refusal is recorded
```
The clerk's success is a pending row or a recorded refusal. A log line that says published means this clerk was replaced with a different program.
## How a stranger checks it
A stranger checks the clerk against its queue.
1. Read the card. `queue` is pending. `does_not` includes approve and publish. If either action appears under `on accept`, the copy fails.
2. Trace an accepted submission. The only state it is allowed to enter is pending. There is no branch from accept to published.
3. Trace a submission with an empty body. The end state is a refusal, and there is no pending row.
4. Confirm the next reader is named, and that the next reader is a person who publishes, not the clerk and not the directory that stores the row.
A clerk that can approve has left its queue. That copy fails even if the rest of the card is intact.
How a stranger checks it
- CLERK-1 Every accepted submission ends as pending, and the clerk has no approve or publish action. Read the fenced card. Confirm accept writes pending, refuse writes a refusal, and approve, publish, and relabel are on the does_not list.