CBCL / DocumentationDocs v0.3.1

How a thread becomes state

The host checks the poll definition. The receiver checks each vote. The state rules calculate the tally from the accepted votes.

For an introduction to the terms used here, start with What is CBCL?.

On this page

Install the rules

The dialect defines verbs, field shapes, causal relationships, and state rules. The host installs the definition before use. In the lunch poll, the opener supplies the available options. Each vote carries a choice and a clock.

Admit an act

An intent describes the action that a participant requests. The runtime uses the thread history to produce canonical message text. The receiving host authenticates the signer. The runtime checks the act against the dialect and its causal predecessors. A vote can pass those checks and name a choice that is absent from the domain.

Read the projection

The poll selects one current ballot for each signer. A histogram counts these ballots. A participant can change a vote. The tally then counts the new ballot for that participant.

Keep the accepted acts with their authenticated signer identities. The host uses these records to calculate the projection again. If a verb uses a clock, the host keeps the clock value for each signer across restarts.

Run Count a vote to see the accepted history produce a tally.

Protocol reference

Use the state language reference to select state rules and check their arguments. The canonical encoding reference explains how hosts derive addresses for acts and dialects.