# How a turn runs — the full specification
The detailed version of [How a turn runs](./how-a-turn-runs.md), for developers and reviewers: one turn step by step,
the reply modes and their codes, every platform tool and what it produces, proposals, the sealed reads, the ledger and
the room operations.
---
## One turn, step by step
One turn
A member posts, with proof of the room key
->
The turn checks admission, opens the room, runs the assistant and its tools, seals the room, drops the key
1. **A member posts** — `{ op: 'turn', room, mk, message }`.
2. **Proof of the key.** The server checks the key against the room's stored commitment — proof that the sender is a
member, and that the reply will be sealed to the room's key.
3. **Who wrote it.** In a room that requires sign-in, the message is signed by the member's device and carries their
sign-in; the turn checks both against the room's sealed allow-list and records only the verified author.
4. **The room opens.** The sealed ledger is opened, and the new message appended.
5. **The assistant runs** with the room's persona, model and tools — up to 32 rounds of tool calls and about 13
minutes; near either limit it stops calling tools and answers with what it has.
6. **The result lands** — the reply, any widgets and files it made, any proposals waiting for approval.
7. **The room is sealed again**, and the key is dropped. Nothing about the turn is kept outside the sealed room.
**Where it runs.** In a **standard** room the turn runs on Witbitz's server, which holds the key for the length of the
turn. In a **confidential** room the same turn runs inside a measured enclave the device verified first, and the key is
sealed to that enclave alone ([privacy tiers](./privacy-tiers.md), [the confidential tier](./the-attested-tier.md)).
## When the assistant answers
Every message lands in the room. Whether the assistant *replies* is a per-room setting:
| Mode | Behaviour |
|---|---|
| `always` | Reply to every message. |
| `auto` | Reply when the room is just you and the assistant, or the message is addressed to it. In a group, a small model decides whether a message not aimed at it wants help. Only an SDK app sets it. |
| `ondemand` | Reply only when addressed by name or `@`-mention. |
A room nobody set a mode for uses the Spaces app's default, whoever sent the message: `ondemand` in a verified room with
more than one person (or one whose people cannot be counted, such as a domain), `always` otherwise. A private lane
always replies.
A turn with no reply returns `silent: true`, with a `silentReason` code (`not_addressed`, `group_gate`,
`agent_muted`) and a sentence saying why, so the page can drop its "thinking" indicator at once. A room made only to
observe (`agentReplies: false`) never replies. If the small model in `auto` cannot be reached, the assistant answers:
an outage must not silently mute a group.
## Tools, and what they produce
A room's own tools are named in its sealed config — the server cannot read the persona, the tool list or the admission
policy. On top of them every room gets Witbitz's **platform tools**, unless its `platformTools` setting names fewer or
none ([choosing the platform tools](./sdk-assistant.md#platform-tools)); a tool the room's tier cannot run is left out
rather than offered. Your page can add its own tools to a turn ([your page's tools](./sdk-assistant.md#page-tools)).
| Tool | What it does | Produces |
|---|---|---|
| `web_search` | search the web for current information | findings with their sources, shown to the room |
| `fetch_url` | read a link: a web page, a PDF, Word or Excel document, or an image; a link the assistant composes itself is fetched only if it carries nothing private | text (an image is attached to the reply) |
| `look_at_image` | ask about a picture shared in the room — also for a model that cannot see images | text |
| `search_places` · `show_places` · `add_place` | find places, then put the chosen ones on the shared map | a `places` map |
| `show_chart` · `show_diagram` | draw data, or a relationship graph | a `chart` / `diagram` |
| `show_photo` | an image in the reply | a sealed image |
| `read_file` | read a shared PDF, Word, Excel, CSV or text file — by its id, by who shared it, or by name | text |
| `write_pdf` | make a PDF from Markdown | a file on the reply |
| `write_document` | make a Word (.docx) or Markdown (.md) file | a file on the reply |
| `write_spreadsheet` | make an Excel (.xlsx) or CSV (.csv) file | a file on the reply |
| `schedule_task` · `list_schedules` · `cancel_schedule` | in a verified Space (not a private lane): something to do on a repeating schedule — it runs only on a cloud device that keeps the Space always on, and is refused where none does | the Space's schedules |
| `set_itinerary` · `add_to_itinerary` · `read_itinerary` · `edit_itinerary` | the day-by-day plan, in a room that declares these tools | an `itinerary` |
| `data_query` · `data_put` · `data_delete` | in a room with a [store](./sdk-store.md#the-room-as-a-store): read its rows with SQL; add, change or delete a row — the writes are proposed | rows |
| `cross_to_shared` | in a private lane: a message into its shared room, after the member approves | a message in the shared room |
| `connection_call` | call an API-key or OAuth connection granted to the room; the secret is added inside the Sentinel, and the call is always proposed ([connections](./connections.md)) | the service's answer |
| `