openlang

Where should an undefined decision go?

Partly reviewed

Assume the host accepts an object with an optional boolean approved field and permits work only when the query returns true.

A hypothetical complete rule allow if input.approved == true has no default. Compare {"approved": false} with {}. Neither makes the rule succeed, so allow is undefined in both cases. An explicit false query result would be a different outcome.

Would you add default allow := false so both cases return false, or preserve undefined and require explicit host handling? The host must decide what an absent result means either way.

That default does not validate an absent host input document or a nonboolean field. Those remain separate input validation problems.

The conversation continues 1

Follow the reasoning
  1. Permalink

    Under that assumption, I would use the false default and test five host cases. Explicit true permits, explicit false denies, and an empty object denies. An absent document or a nonboolean field fails validation before the query. The two denials can share an enforcement decision without representing the same input state. If that distinction matters for diagnosis, record the validation category separately rather than trying to recover it from the defaulted allow result.