Skip to main content

Module state

Module state 

Source
Expand description

State layer (SPEC-019 R.1–R.3): the (state …) clause, fixed kernel selections and reductions (including protocol-position maximum), the fold, and the canonical JSON rendering.

Every function here is a pure set function of a thread’s accepted acts: permuting or duplicating the input leaves the output unchanged (R7). No clock, no randomness, no other thread.

Structs§

Act
An accepted message as the fold sees it (SPEC-019 Reference, “act”).
StateBounds
(:state-bounds …) (SPEC-019 R.1, ADR-1911). Defaults apply when absent.
StateClause
The parsed (state …) clause (SPEC-019 R.1).

Enums§

Condition
Closed authored threshold expressions (SPEC-038 CON-3805).
Entry
One entry of the state clause.
FreezePolicy
Rule
One author-facing rule (SPEC-019 R.1). Defined by desugaring to the kernel (R.2); see fold.
ScalarType
Scalar types of state-bearing fields.
StateType
The type of a state field, derived from its rule and the shapes.
Value
A state value (SPEC-019 R.3).

Constants§

RESERVED_REPLACES
The reserved bookkeeping keyword (SPEC-019 ADR-1901). Inserted into the shapes of every writer, delete, and remove verb by the compiler; never declared by an author; never read as data by any rule.
ROUTING_KEYWORDS
Routing keywords that a closed shape admits beside the declared fields.

Functions§

field_type
The declared type of (verb, key) from the dialect’s shapes.
fold
The fold (SPEC-019 R.2): every field of the clause over the accepted acts, in clause order. Total on any finite slice; a set function of it.
frontier
The frontier: addresses no accepted act names in :caused-by, sorted.
keyword_fields
The keyword parameters of a simple message as a map, routing keywords excluded.
opener
The accepted opener, if present: the act of the protocol’s opener verb. Role-free, its predecessor is begin; under R6 it names the thread’s cast-bearing root ([[SPEC-014]] REQ-623), which is not an act of the dialect. Several openers in one thread cannot verify, so the least address is a deterministic tie-break, never a semantic one.
opener_verb
The opener of a protocol: the one performative whose only predecessor is begin, when exactly one exists.
render_json
Render a whole state (R.3): an object in clause order.
render_schema
JSON rendering of a schema.
root
The thread’s R6 root: the act whose message carries the with-roles wrapper (the cast) and no predecessor. None for a role-free thread.
state_schema
state_schema (R.7): each field’s type from its rule and the shapes.
wire_address
The content address of an act as a canonical multibase SHA2-256 multihash. The same symbol-safe spelling is used for native and state references. Act construction selects its identity subtree under SPEC-038 ADR-3807.