A decision is how Xema asks a person, or a group of people, for an answer: an approval, consent, a review, a choice between proposals, or an open question. There is one store for pending answers. A biome that needs a human choice opens a decision. It does not build its own approval table.
Agent sessions use decisions for questions and permission asks, and the hook plane uses a decision requirement when a hook defers an operation.
Asking for a decision
A service that needs an answer:
- Registers the subject. The thing being decided on is a registered resource. Its visibility governs who may answer.
- Opens the decision through the platform's decision SDK, and keeps its own record of what to do when the answer arrives.
- Names the recipients. A recipient is a human, an identity group, an agent, an endpoint or a workflow. Groups are expanded when the decision opens.
- Declares five things:
- the effect of each option;
- the commit threshold of each option;
- the reply policy:
SINGLE,M_OF_N,ALL_OForANY_OF; - the settlement: who closes the decision, with the producer allowed to settle;
- what happens at the deadline:
HIDE(stays answerable),CLOSE(final) orESCALATE.
- Resumes when the decision is settled.
Receiving the answer
The decision service records the answer and emits events. It never carries out
the chosen option. The asker does that, by running the capability the option
names, and only after the decision is settled.
The events are decision.decision.opened, committed, closed,
commit.retracted and announced. They carry no more content than their
audience may see.
First answer wins
When more than one person may answer, the first answer committed wins and later answers are refused. The reply policy decides how many answers settle the decision.
Who may answer
A person may answer only if the platform's access check allows it on the
subject, and the decision's own narrowings can only refuse further: addressed
recipients only, a minimum org role, and whether the asker may answer their own
decision. A decision past its deadline can still be answered when the deadline
effect is HIDE. Nothing sweeps decisions on a schedule. Whether a decision is
open, lapsed or expired is read from its state when it is asked about.
Related
- Hook plane: a
deferverdict returns a decision requirement. - Permissions: how access is granted.