02 · Deterministic execution
BEX Rules & Processing Gas
Compare a direct update with a conditional workflow. See which document and request values BEX reads, which changes and events it returns, and how much deterministic processing gas the resulting revision consumes.
The execution boundary
Logic is Blue-compatible data, not hidden application code.
BEX evaluates a bounded expression object against the current document and delivered event. It cannot mutate the Root directly. Instead it returns explicit patch operations and emitted events, which the processor commits together.
The same program and input consume the same processing gas during replay. Network latency and server speed are separate measurements.
current Root + delivered request
│
▼
BEX expression object
├─ read $document
├─ read $event
├─ evaluate $if / arithmetic
├─ $appendChange
└─ $appendEvent
│
▼
changes + events + result + gasRun it
Compare cost with meaning.
Gas becomes educational when each number stays next to the exact workflow, request, and resulting revision that produced it.
What to inspect
Four different kinds of evidence.
Keeping these measures separate prevents a fast server from being confused with a cheap program—or Coordination routing work from being mistaken for BEX gas.
One Counter, Two Hosts applies the same processing loop inside an embedded document graph.