Skip to content

Remedies

A remedy states what happens after a breach. Each breach has a remedy, because the registrar applies a default when you write none.

remedies:
on_bound_breach: { do: halt, inform: issuer }
on_invariant_breach: { do: revert, inform: holder, strikes: 3 }
on_assent_refused: { do: halt, inform: issuer }
Breach Cause Default remedy
on_bound_breach A run reaches a bound. halt
on_invariant_breach An action breaks an invariant. inform, 3 strikes
on_assent_refused A person refuses. halt
Action Result
halt The run stops now.
revert The registrar undoes the action, and the run continues.
inform The registrar tells the model which clause failed, and the run continues.
pause The run stops and waits.
escalate The run stops and asks a person.

The strikes field gives the number of breaches that the run can have before the run stops.

remedies:
on_invariant_breach: { do: inform, strikes: 3 }

With strikes: 3, the registrar informs the model 3 times. At the fourth breach, the run stops.

The strikes field applies to inform and revert, because those two actions let the run continue. The default is 3 strikes for an invariant breach, and 1 for a bound breach.

The inform field names who gets the message.

Value Meaning
holder The model that does the work.
issuer The person who issued the writ.

A message to the holder is useful. The model learns which clause it broke and why, so the model can plan inside its limits instead of trying the same action again.

Start with the defaults. Change a remedy when the record shows a reason.

  • Use halt when a breach means that the writ is wrong.
  • Use inform when the model can correct itself. This is the common case for an invariant.
  • Use revert when the action leaves the repository in a bad state.
  • Use escalate when a person must make the decision.