Guard / How Guard works

Where the boundary sits: authority vs. validity, and limits

Two boundaries keep this model sound:

  • Authority never excuses an invalid row, and a valid row never grants access. Guards are alternatives ([G.isAssignee, G.isAdmin]) that change whenever roles change, while invariants hold for everyone, admins included. That is why Laws.check reads only your writes and Entity invariants — never your Guards, not even always — and why refusals stay distinct: Forbidden (not allowed), Unmet (precondition not met), and Invalid (result breaks an invariant).
  • Runtime guards check one request; intervals track one variable at a time. Running a guard guarantees that this request obeyed the rules, not that every future input will. Likewise, Laws.check's interval pass tracks each number independently, so a when comparing two unknowns (such as amount <= balance) reports Undecided instead of guessing, leaving relational rules to runtime checks, multi-step tests, or an external solver.

Where to go next