Compiler ErrorsDeterminism & Compatibility

Determinism & Compatibility

Expressions that would make replay non-deterministic, plus binary/schema compatibility checks between compiler versions.

9 error codes in this section.

Expressions & Determinism

VERR_EXPRESSION

SpEL expression parse or evaluation error. A SpEL expression inside #{ … } failed to parse — unclosed brackets, unknown method, or invalid syntax.

Impact: Rule fails at runtime for every event.

✗ Won't compile
value: "#{ entity.count + }"    # incomplete expression
✓ Fixed
value: "#{ entity.count + 1 }"

VERR_SPEL_FORBIDDEN_FUNCTION

Forbidden function in expression. An expression uses now(), System., Runtime., getClass(), T(…), or any reflection/system API.

Impact: Non-deterministic output; replay produces different events than the original write.

✗ Won't compile
value: "#{ T(java.lang.System).currentTimeMillis() }"
✓ Fixed
value: "#{ event.ts }"    # use event timestamp instead

VERR_NON_DETERMINISTIC_EXPRESSION

Non-deterministic expression. An expression uses now() or random() directly instead of deriving values from the event envelope.

Impact: Event replay produces different values from the original write, breaking auditability.

✗ Won't compile
value: "#{ now() }"
✓ Fixed
value: "#{ event.ts }"

VERR_EXTERNAL_STATE_READ

External state read in expression. An expression reads from a source outside the allowed scope (HTTP, system properties, etc.).

Impact: Different values on replay; intent processing is not idempotent.

✗ Won't compile
# Expression reads from external HTTP / env var
value: "#{ System.getenv('RATE_LIMIT') }"
✓ Fixed
# All inputs must come from event payload, intent payload,
# or previously computed entity/project state.

VERR_UNSTABLE_RESOURCE_REFERENCE

Unstable resource reference. A resource referenced in a rule can change at runtime without versioning, breaking replay determinism.

Impact: Replayed events may produce different computed values from the original.

✗ Won't compile
# Resource changes without a version bump referenced in rule
✓ Fixed
# Use versioned, immutable resource bundles.
# Bump the resource version when content changes.

VERR_MUTABLE_EVENT_DERIVATION

Event derived from mutable state. An emitted event’s payload fields reference entity state that could differ between the original write and a replay.

Impact: Event payload is different on replay; downstream projections receive wrong data.

✗ Won't compile
ops:
  - op: emit
    event_type: OrderConfirmed
    payload:
      current_price: "#{ entity.price }"  # entity state may change
✓ Fixed
# Derive event payloads exclusively from intent payload fields.
ops:
  - op: emit
    event_type: OrderConfirmed
    payload:
      offered_price: "#{ intent.payload.price }"

Binary Compatibility

VERR_BINARY_VERSION_MISMATCH

IR version incompatible with runtime. The runtime cannot execute the compiled ruleset because of an incompatible IR binary format version.

Impact: Deployment fails; the old ruleset remains active.

✗ Won't compile
# Compiler v2 output deployed to runtime v1
✓ Fixed
# Update the runtime service to support the compiler's output version
# before deploying the new ruleset.

VERR_UNSERIALIZABLE_EXPRESSION

Expression cannot be serialised to binary IR. A SpEL expression uses language constructs the IR binary encoder does not support.

Impact: Compilation fails; no IR is produced.

✗ Won't compile
# Complex SpEL with unsupported constructs
value: "#{ T(java.util.UUID).randomUUID().toString() }"
✓ Fixed
# Simplify to use only IR-encodable constructs.
# Check compiler release notes for unsupported SpEL features.

VERR_UNSUPPORTED_OP_IN_BINARY

Op not supported in binary format by runtime. A newer DSL operation is not supported by the older runtime’s binary format.

Impact: Deployment fails; the old ruleset remains active.

✗ Won't compile
# Using a new op type not yet supported by current runtime version
✓ Fixed
# Update the runtime or use an alternative op supported by both versions.