Skip to main content
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.

Per-scope serializability

Committed commands for one scope and machine MUST be equivalent to a total serial order. A command’s input snapshot is the committed snapshot immediately preceding it in that order. S0→c1S1→c2S2⋯→cnSnS_0 \xrightarrow{c_1} S_1 \xrightarrow{c_2} S_2 \cdots \xrightarrow{c_n} S_n Different scopes MAY execute concurrently. This specification imposes no global ordering across scopes.

Conflicts and retries

An implementation MAY use locks, compare-and-swap, optimistic concurrency, or a single-writer service. These mechanisms are not observable semantics. After a conflict, the runtime MAY retry only by reevaluating the entire command against the new committed snapshot, including its requirement, effect expressions, and registered algorithms. It MUST NOT reuse a proposed state computed from a stale snapshot. If a proposal computed from SiS_i loses a commit race to cjc_j, retry is a new evaluation judgment over Si+1S_{i+1}: M⊢⟨Si,cj,Ij,Xj⟩⟶⟨Si+1,Oj⟩conflict⁡(ci,Si)retry⁡(ci)=M⊢⟨Si+1,ci,Ii,Xi⟩  Retry−New−Snapshot\frac{ M \vdash \langle S_i,c_j,I_j,X_j \rangle \longrightarrow \langle S_{i+1},O_j \rangle \qquad \operatorname{conflict}(c_i,S_i) }{ \operatorname{retry}(c_i) = M \vdash \langle S_{i+1},c_i,I_i,X_i \rangle } \;\mathrm{Retry-New-Snapshot} Commands SHOULD carry an idempotency key. Repeating one accepted command event with the same key MUST NOT create a second logical command.

Read operation

An explicit read is: read⁡(q,m,σ,v,x)\operatorname{read}(q,m,\sigma,v,x) where qq is scope, mm machine, σ\sigma snapshot selector, vv view, and xx viewer context. It returns a rendered view plus a read event containing:
  • read ID;
  • scope key;
  • machine name and version;
  • exact snapshot ID;
  • view name or version;
  • permitted viewer-context identity;
  • interview and survey position.
A read does not promise that its snapshot remains current after return. View rendering is captured by: M,Sσ,X⊢V⇓rM,S_{\sigma},X \vdash V \Downarrow r and the read result is: (r,ReadEvent⁡(id,q,m,σ,V,X))(r,\operatorname{ReadEvent}(id,q,m,\sigma,V,X))

Just-in-time reads

Survey state reads SHOULD occur as explicit steps immediately before the questions that need them. Implementations MUST NOT silently move a read earlier than its declared survey position.

Example timeline

Both commands have event IDs. Only the first changes the state.