Skip to content

Remedies

A remedy states what happens after a breach. An omitted remedy is not an authored clause. An adapter can apply an operational response when a breach has no authored remedy.

remedies:
on_bound_breach: { do: halt, inform: issuer }
on_invariant_breach: { do: inform, inform: holder, strikes: 3 }
on_assent_refused: { do: halt, inform: issuer }
Breach Cause Managed operational response
on_bound_breach A run reaches a bound. halt
on_invariant_breach An action breaks an invariant. inform; halt on strike 3
on_assent_refused A person refuses. halt
Action Result
halt The run stops now.
revert The registrar uses a tool result receipt to undo one completed action. 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 strike number that stops the run. The registrar counts each normalized action separately.

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

With strikes: 3, the registrar applies the remedy each time that the same action causes a breach. The first and second occurrences can continue. The third occurrence applies the remedy and then halts the run. A different action starts its own strike count.

The strikes field applies to inform and revert, because those two actions can let the run continue before the strike limit. The managed response halts on strike 3 for an invariant breach and on strike 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.

Write a remedy when its response is part of the task contract. Use writ plan to check whether the selected adapter can enforce it.

  • 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 every breach in the category follows one completed action with a reversible receipt.
  • Use escalate when a person must make the decision.

Use revert only when every reachable breach has a completed tool result with a reversible receipt. The remedy applies to all breaches in its category.

An on_invariant_breach revert can support an each_edit judgment. It cannot support these checkpoints:

  • at_satisfaction
  • each_n_iterations
  • A letter edit invariant that can block a direct edit or write request.

An on_bound_breach revert cannot support iteration, cost, wall-clock, or max_files breaches. Managed mode adds iteration, cost, and wall-clock defaults. This makes a global bound revert unsupported even when the writ omits those bounds.

A max_changed_lines breach follows a tool result and can use its receipt. The global bound remedy is still unsupported when another reachable bound has no receipt.

An on_assent_refused revert is unsupported. An assent refusal has no tool result receipt.

Run writ plan after you select a remedy. An unsupported remedy row names the checkpoint that has no receipt.