Compiler ErrorsScope & Execution Plan

Scope & Execution Plan

Cross-stream field ownership and scope boundaries, plus errors from the compiled execution plan.

12 error codes in this section.

Scope & Cross-Stream Safety

VERR_OWNERSHIP

Field ownership violation. A stream attempts to write a field owned by another stream.

Impact: Write is rejected; the field retains its original value.

✗ Won't compile
# orders_stream writing 'email' owned by users_stream
✓ Fixed
# Only write fields your stream owns.

VERR_SCOPE

Field scope boundary violation. A path expression crosses a scope boundary it is not permitted to access.

Impact: Path resolves to null; write is silently rejected.

✗ Won't compile
# entity rule accessing /project/... path
✓ Fixed
# Match the rule scope to the path scope.

VERR_GLOBAL_WRITE_VIOLATION

Writing GLOBAL field from non-global context. A rule writes to a field declared with scope: global from a non-global rule context.

Impact: Write is rejected; global field is not updated.

✗ Won't compile
# stream rule writing to scope: global field
✓ Fixed
# Only write global fields from rules with matching global scope.

VERR_CROSS_PLATFORM_ACCESS

Cross-platform state access. A rule references entities from a different platform’s tenant isolation boundary.

Impact: Access denied; tenant isolation is strictly enforced.

✗ Won't compile
# Expression reads entity from different platform ID
✓ Fixed
# Each platform is fully isolated. Use a dedicated integration endpoint
# to exchange data across platforms.

VERR_SCOPE_ISOLATION_VIOLATION

Scope isolation violation. A general scope boundary violation — a rule crosses a scope boundary it is not permitted to access.

Impact: Rule fails; data is not modified.

✗ Won't compile
# Rule crosses an isolation scope boundary
✓ Fixed
# Review the rule scope and the target field's scope. Ensure they match.

VERR_ILLEGAL_CROSS_STREAM_WRITE

Illegal cross-stream write. A rule directly writes to another stream’s state without using the approved cross-stream intent mechanism.

Impact: Write is rejected; the target stream’s entity is not updated.

✗ Won't compile
# direct write to other_stream entity fields
✓ Fixed
# Send a cross-stream intent rather than directly mutating another stream's state.

VERR_MISSING_LOCK_FOR_CROSS_STREAM

Missing lock for cross-stream operation. A cross-stream operation is performed without first acquiring the entity lock for the target entity.

Impact: Race condition — concurrent writes may corrupt the target entity’s state.

✗ Won't compile
# Cross-stream op without lock step
✓ Fixed
# Add a lock step before the cross-stream op to prevent race conditions.

VERR_FORK_VIOLATION

Rule is not fork-safe. A rule performs side effects that cannot be safely replayed in a forked environment.

Impact: Forks produce divergent state; data integrity is compromised.

✗ Won't compile
# Rule reads external / non-deterministic state in a fork-unsafe way
✓ Fixed
# Rules must be purely deterministic. Remove fork-unsafe side effects.

Execution Plan

VERR_EXECUTION_PLAN_INTENT_STREAM

Intent cannot be mapped to exactly one stream. An intent is handled by multiple streams without disambiguation, or is not claimed by any stream.

Impact: Intent routing fails; clients receive an error.

✗ Won't compile
# PlaceOrder handled by both orders_stream and billing_stream
# with no discriminating guard
✓ Fixed
# Each intent must route to exactly one stream.
# Use intent routing config or stream-specific intent declarations.

VERR_EXECUTION_PLAN_EMITS_MALFORMED

intent.emits block is malformed. The intent.emits list contains a null entry or incorrect structure.

Impact: Intent compilation fails; no rules are loaded for this intent.

✗ Won't compile
intents:
  PlaceOrder:
    emits:
      - null        # null entry
✓ Fixed
intents:
  PlaceOrder:
    emits:
      - OrderPlaced

VERR_EXECUTION_PLAN_TARGET_STREAM_UNKNOWN

Emitted event targets unknown stream. An emit declaration targets a stream name that has no corresponding stream definition.

Impact: Emit is dropped; the unknown stream never receives the event.

✗ Won't compile
# emit targets 'ghost_stream' which doesn't exist
✓ Fixed
# Ensure all target stream names match defined stream names.

VERR_EXECUTION_PLAN_NON_DETERMINISTIC

Non-deterministic execution plan. The combination of rules and events could result in different execution orderings across replays.

Impact: Replays produce different state; data integrity cannot be guaranteed.

✗ Won't compile
# Multiple rules with overlapping triggers and no ordering guarantee
✓ Fixed
# Ensure a single deterministic routing path for each intent/event combination.