Blue Contracts and the processor
The deterministic execution model for channels, handlers, operations, patches, events, checkpoints, scopes, type soundness, gas, and failure.
What it answers#
Blue Contracts answers: given this exact document state and this eligible event, what is the deterministic next state?
The core processor is deliberately separated from Timeline providers, external ordering, identity authentication, Mandate discovery, storage, and payment systems.
Runtime contract discovery#
The processor discovers supported active contracts below the identity-bearing contracts field. Deterministic discovery and dispatch snapshots prevent host collection order or in-flight rule rewriting from changing behavior.
Unsupported active capabilities fail before mutation.
Effects and application order#
Handlers see immutable context and return normalized effects. The processor owns validation and application of patches, emitted events, checkpoints, lifecycle markers, type soundness, and gas.
Patch order is observable. Triggered events and Document Update cascades follow specified queues and boundaries rather than host callback timing.
Root and embedded scopes#
The Root is the authoritative reality being changed. Marked embedded nodes may process as isolated owned scopes. Their state and reactions commit within the containing Root, while boundary rules prevent escape or arbitrary sibling mutation.
Type soundness#
Every committed state must remain valid under its declared effective type. A tentative patch may be rejected or may require controlled generalization to a valid ancestor according to policy. Security-sensitive subtypes can reject generalization and terminate when protected scope changes.
Gas and failure#
Gas bounds handlers, patches, BEX execution, event cascades, and output. Implementations must distinguish pre-execution failure, invalid tentative effects, fatal runtime failure, graceful termination, and profile-specific atomicity.
The explanatory site describes the mental model. The specification and fixtures define exact result order and edge behavior.