Module agent_answers
Expand description
What a person has told one of their agents, or the work on an issue, it may do: allowed, asks first, or not allowed, for each kind of action, scoped to an application, one kind of resource in it, or one action.
These are ordinary grants on the workspace, named so that setting an answer
again replaces it instead of adding a second one. Without one, a run a
person started takes the agent delegation’s answer
(crate::roles::agent_turn), which is default_answer, the
default a person sees before choosing; an agent acting inside a turn is
decided the same way, bounded by the cap its record narrows.
An action whose contract asks for confirmation (it sends, publishes or
deletes for good) keeps asking an agent’s person even where an
application- or kind-wide answer allows its kind: only an answer given for
that very action (AnswerScope::Action, what “Always allow this” gives)
lifts it. Allowing “changes” in Mail therefore never quietly lets an agent
empty the Trash.
Enums§
- Answer
Scope - Where an answer applies, below the workspace.
Constants§
- PREFIX
- The id prefix of every answer grant.
Functions§
- answer_
grant - The grant giving
delegate(an agent, or the work on an issue,Subject::Task)answerfor actions ofkindatscopeinworkspace, set bygranted_by. Given for one action, it is what “Allow for this issue” records, and lifts that action’s confirmation as an agent’s answer does. - default_
answer - The answer an agent starts with for an action of
kind, before anyone chose: reading and undoable changes are allowed, reaching outside the document asks first, and an action whose contract asks for confirmation (consequential: it deletes for good, publishes, crosses a security boundary) asks first whatever its kind. - grant
- The grant giving
agentanswerfor actions ofkindatscopeinworkspace, set bygranted_by. - grant_
id - held_
to_ contract - The answer a delegate’s
decisiongives an action, held to the action’s contract: an action that asks for confirmation (consequential) asks first where the decision allows it, unless the decision is an answer given for that one action. - is_
answer - Whether
grantis an answer: given an agent, or the work on an issue. - set
- The changes setting
agent’s answer forkindatscopein a workspace holdingheld: the earlier answer is revoked, so the new one replaces it.Noneclears the answer, returning the scope to what the agent’s admission and broader answers say.