This is the Draft 0.1 language specification. Its conformance requirements include targets beyond the current implementation, such as complete static typing and resource bounds. The execution contracts describe the guarantees implemented today.
Command definition
A command contains:Normative execution algorithm
snapshot. Effects are applied in
declaration order to proposed.
Transition judgments
Let evaluate all expressions in effect sequence against immutable snapshot . Let apply the resulting concrete effects in order. A successful changing command is: An unmet requirement leaves state unchanged: A valid command whose concrete effects make no change commits no new state contents, though it still receives a command-event ID: If the proposed state is invalid, the transition fails and commits nothing:Effects
assign(f,v) replaces field f with v.
set_once(f,v) sets f only when its current proposed value is null; otherwise
it is a no-op.
put(f,k,v) assigns f[k] = v.
put(f,k,v,once=true) assigns only when k is absent from the current proposed
map; otherwise it is a no-op.
append(f,v) appends v to sequence field f.
when(p,e) applies effect e only when predicate p, evaluated against the
immutable input snapshot, is true.
A no-op set_once or put-once does not cancel sibling effects. If sibling
effects must occur only when insertion is possible, the shared condition MUST be
stated in the command requirement or on every dependent effect.
Worked example: executing vote
Let the current state be empty:
The command identifier and invocation inputs are:
The command definition says to evaluate the key and value expressions
against and , producing the concrete effect:
Because Amina is absent, the transition is:
Now invoke the same command with different inputs:
The putOnce key already exists, so:
This example also shows why and are separate: vote selects one command
definition, while each invocation supplies a different input map.
Outcomes
Outcome data is advisory. It MAY report processed, changed, no-op, validation, and conflict information. It MUST NOT be represented as proof that the caller holds the latest state. Durable truth is the committed event and snapshot history.Registered effects
A registered effect invokes an allowlisted algorithm capability. It receives only evaluated plain data and a copy of proposed state. Its complete output MUST pass the same type and resource validation before commit. Failure commits nothing.Implemented explicit rejection extension
The current interpreter additionally supports orderedrequire(condition, code=...) and reject(code) effects. An assertion must evaluate to a Boolean.
An explicit rejection discards all proposed effects, stops evaluation, and returns
a fixed public reason code. It is distinct from the legacy unmet-requirement
no-op and from an execution exception. SQLite durably records applied, no-op, and
rejected decisions; execution failures leave no completed event. Guards keep the
same pre-command snapshot semantics as ordinary effects.
This extension is advertised through effect:assert@1 and effect:reject@1,
without changing older command serialization. See
Explicit rejection and outcomes
for current close, acknowledgement, disclosure, and idempotency contracts.