State, events, and failures
Understand what commits on success and what is discarded on failure.
A transactional state overlay
Execution starts with a copy of the provided state. Reads observe that overlay, including earlier writes from the same run. The interpreter records read keys and final values for written keys. A successful simulation returns the resulting state; the owning service determines whether and how that result is admitted into a wider lifecycle.
For handled execution errors or exhausted execution units, the interpreter returns the initial state, clears pending state writes, and discards emitted events. The receipt retains failure information and metering. A business result such as {"accepted":false} is still normal successful execution if the function returns it: writes made before that return are not automatically rolled back.
Context is supplied data
The first entrypoint argument is a context dictionary. Treat any context field according to the caller’s documented contract; this manual does not define universal clock, block-height, wallet, or account fields. A context value is not a built-in permission or live network query.
Separate validation from execution failure
| Outcome | Meaning |
|---|---|
| VALIDATION_ERROR | Source or request constraints prevent valid execution. Diagnostics may include code, message, line, and column. |
| EXECUTION_LIMIT_EXCEEDED | The interpreter cannot charge the next operation within the budget. Pending effects are discarded. |
| EXECUTION_ERROR | A handled runtime failure; inspect error_code, including STATE_LIMIT_EXCEEDED or EVENT_LIMIT_EXCEEDED. |
| Node admission / worker failure | May occur outside the interpreter; inspect the API or node response rather than assuming a language receipt exists. |
Useful diagnostic families
| Code | Check |
|---|---|
| HS001–HS005 | Source size, parse errors, AST/function limits, or missing entrypoint. |
| HS006 | Duplicate function or requested entrypoint not declared; read the message. |
| HS007 | Executable top-level code is not supported. |
| HS100–HS104 | Unsupported syntax, literals, prohibited names, or reserved bindings. |
| HS110–HS113 | Import registry, symbol, alias, or name collision. |
| HS120–HS125 | Function naming, arguments, or entrypoint decorator. |
| HS130–HS143 | Attributes, host-call targets, or keyword arguments. |