Engine

3.8. Deploying🔗

A deploy sends the schema and all rules of an app at once. The engine checks them and, if they pass, starts using them for the events that follow; stored events are never changed. A deploy is rejected when the schema change is not allowed (Events), a rule does not type-check, or a new invariant is already broken by the stored events.

🔗structure

A deployed rule. It checks the events at positions fromPos to toPos (both included); toPos = none while it is active.

Spec.Deployed.mk
entity : String

the entity of the rule's file

rule : Rule

the rule

fromPos : Nat

the first position it checks: the one after its deploy

toPos : Option Nat

the store's length when a deploy removed it; none while active

Each rule lives from the deploy that introduced it to the deploy that removed it; a rule that is unchanged keeps its lifetime.

3.8.1. Deploy checks🔗

An invariant that the stored events already break can't be deployed: with two stored users who share an email, the unique-email invariant is broken. A rule that does not type-check is rejected too, for example an invariant that reads the incoming event (always: $gross_minor > 0), which only preconditions may do.

Deploy

Answer

Claim

the unique-email invariant over two users with the same email

rejected: one violation

Two stored users with the same email break the email invariant.

always: $gross_minor > 0

rejected: not well typed

An invariant that reads the incoming event is not well typed.

a folio file with a field named at

rejected

A field named at is rejected on deploy.