Core, Fields & Paths
Structural DSL errors — malformed YAML, unrecognised rule constructs, undeclared or misused fields, and invalid field paths.
18 error codes in this section.
Core Structure
VERR_RULESET_YAML_INVALID
Causet DSL syntax error. The Causet DSL file could not be parsed due to a syntax violation — tab indentation, unclosed quotes, duplicate keys, or invalid constructs.
Impact: Compilation aborts immediately. No IR is produced.
rules:
create_order:
when: # tab indentation — Causet DSL forbids tabs
intent_type: PlaceOrderrules:
create_order:
when: # use spaces
intent_type: PlaceOrderVERR_RULESET_EMPTY
Empty or whitespace-only Causet DSL file. A required Causet DSL file is empty or contains only whitespace and comments.
Impact: The rule file produces no handlers; intents targeting this stream will silently fail.
# app.causet
---
# TODO: add rules laterrules:
create_order:
when:
intent_type: PlaceOrder
ops:
- op: set
path: /status
value: pendingVERR_MODE_UNKNOWN
Unrecognised execution mode. A rule specifies a mode that is not one of the valid execution modes: sync, async, or preflight.
Impact: Rule cannot be executed. Intents targeting it will fail at runtime.
rules:
place_order:
mode: background # invalid
when:
intent_type: PlaceOrderrules:
place_order:
mode: async
when:
intent_type: PlaceOrderVERR_OP_UNKNOWN
Unrecognised operation type. An op in a rule’s ops list is not one of the supported operations (set, add, sub, push, merge, remove, unset, emit, find, for_each, if, sort).
Impact: Rule execution fails for every event that triggers it.
ops:
- op: write # not valid
path: /status
value: activeops:
- op: set
path: /status
value: activeVERR_MISSING_FIELD
Required field missing from definition. A required key (such as when, path, value, or type) is absent from a rule, event, or intent block.
Impact: The rule cannot execute; the intent or event fails.
ops:
- op: set # 'path' is required but missing
value: activeops:
- op: set
path: /status
value: activeVERR_DUPLICATE
Duplicate rule or field name. A rule, field, or event is defined more than once at the same scope level. The second definition silently overrides the first in most Causet DSL parsers.
Impact: Silent data loss — one of the duplicate definitions is dropped.
rules:
place_order:
when: { intent_type: PlaceOrder }
place_order: # duplicate key
when: { intent_type: PlaceOrder }# Rename one of the rules to a unique key.VERR_IR_OP_UNKNOWN
Unknown operation type in IR compilation. An unknown operation code was encountered during IR compilation, typically caused by a compiler version mismatch or a manually edited IR artifact.
Impact: IR is unusable; runtime refuses to load it.
# Manually edited IR artifact with unsupported op type# Recompile from source using the current compiler version.
# Never hand-edit IR artifacts.Field Correctness
VERR_FIELD_NOT_DECLARED
Writing undeclared field. A rule writes to a field that is not declared in app.causet.
Impact: Runtime rejects the write or stores data in an untyped shadow field.
ops:
- op: set
path: /loyalty_tier # not in app.causet
value: gold# 1. Add to app.causet:
# loyalty_tier: { type: string, owner: order_stream }
# 2. Then use it:
ops:
- op: set
path: /loyalty_tier
value: goldVERR_FIELD_SCOPE_MISMATCH
Writing field from wrong scope. A rule writes to a field of the wrong scope — e.g. a PROJECT-scoped field from an ENTITY rule.
Impact: Write is silently rejected; field retains its old value.
# entity rule
ops:
- op: set
path: /project/global_counter # project scope from entity rule
value: 1# Move the op to a rule with the matching (project) scope.VERR_FIELD_OWNERSHIP_VIOLATION
Writing another stream’s field. A stream writes to a field declared as owned by a different stream.
Impact: Write is rejected; the target stream’s state is not updated.
# orders_stream rule writes email — owned by users_stream
ops:
- op: set
path: /email
value: "new@example.com"# Send a cross-stream intent to ask the owning stream
# to update its own field.VERR_IMMUTABLE_FIELD_WRITE
Writing immutable field. A rule attempts to write to a field marked immutable: true after its initial value was set.
Impact: Throws a runtime error; intent fails.
# app.causet: order_id: { immutable: true }
ops:
- op: set
path: /order_id # cannot be changed after creation
value: "new-id"# Remove the set op. Immutable fields are written once at creation only.VERR_INVALID_DEFAULT_VALUE
Default value type mismatch. A field’s default value does not match its declared type.
Impact: Entity initialisation fails; new entities cannot be created.
fields:
retry_count:
type: integer
default: "none" # string on integer fieldfields:
retry_count:
type: integer
default: 0Path Correctness
VERR_PATH_INVALID
Invalid path format. A field path has an invalid format — missing leading slash, illegal characters, or mixed path styles.
Impact: Rule fails to execute.
ops:
- op: set
path: status # must start with /
value: activeops:
- op: set
path: /status
value: activeVERR_INVALID_JSON_PATH
Invalid JSON path syntax. A JSON path uses dot notation instead of slash notation, or has malformed array access syntax.
Impact: Path fails to resolve; op is silently skipped or throws.
ops:
- op: set
path: /items.0.status # dot notation is invalidops:
- op: set
path: /items[0]/statusVERR_PATH_NOT_RESOLVABLE
Path can never exist. A path traverses through a scalar field as if it were an object.
Impact: Runtime throws a path-not-resolvable error for every event.
# status is a plain string field
ops:
- op: set
path: /status/code # can't traverse into a scalar# Either redesign status as an object, or use a flat path:
ops:
- op: set
path: /status_codeVERR_PATH_SCOPE_MISMATCH
Path scope mismatch. A path references a scope the current rule cannot access (e.g. /project/… from an entity rule).
Impact: Path silently resolves to null or throws.
# entity rule
ops:
- op: set
path: /project/stats/total # project scope in entity rule# Use a project-scoped rule, or store the value in entity scope.VERR_ILLEGAL_ROOT_WRITE
Write to root path /. A rule uses op: set with path: /, attempting to replace the entire entity state at once.
Impact: Runtime rejects the operation; intent fails.
ops:
- op: set
path: / # cannot replace entire state
value: {}# Set individual fields explicitly.
ops:
- op: set
path: /status
value: activeVERR_RESOURCE_REF
Resource reference not found. A rule expression references a $resources.X key that has no corresponding entry in app.causet.
Impact: Expression evaluates to null; field receives incorrect or null value.
ops:
- op: set
path: /config
value: "#{ $resources.payment_config }" # not in app.causet# Add the entry to app.causet:
# payment_config:
# stripe_key: "sk_..."
# Then the reference will resolve correctly.