Operations Reference
A rule runs operations from a then block: - op: name. Preflight runs before any write. Core updates entity state. Side effects run after the ledger commit.
lookup is included. It is a real read operation, alongside find.
State
Write fields on the current entity.
| Operation | What it does |
|---|---|
set | Set a field to a value |
add | Add to a number |
sub | Subtract from a number |
unset | Remove a field |
merge | Merge fields into an object |
Collections
Read or reshape a list or a nested value.
| Operation | What it does |
|---|---|
push | Append to a list |
remove | Remove matching items |
filter | Keep matching items |
find | Read one matching item |
lookup | Read a field from another entity |
map | Transform each item |
sort | Order a list |
clone | Copy a value |
Control flow
| Operation | What it does |
|---|---|
if | Run a branch when a condition holds |
for_each | Run a block for each item |
stop | Stop the current loop or rule path |
continue | Skip to the next item |
reject | Fail the intent and write nothing |
Events and workflows
| Operation | What it does |
|---|---|
emit | Append one event |
emit_each | Append an event per item |
submit | Submit another intent |
schedule | Submit an intent later |
Relationships and concurrency
| Operation | What it does |
|---|---|
relationship_create | Create an edge |
relationship_remove | Remove an edge |
lock | Hold a named lock |
unlock | Release a named lock |
AI
| Operation | What it does |
|---|---|
decision | Record a model decision on the timeline |
decision belongs in side effects. It does not replace emit, submit, or schedule.
Phase rules and parameters for each operation are on the operation page. The language around those operations is the DSL reference.