Skip to main content

Module agent_answers

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§

AnswerScope
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) answer for actions of kind at scope in workspace, set by granted_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 agent answer for actions of kind at scope in workspace, set by granted_by.
grant_id
held_to_contract
The answer a delegate’s decision gives 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 grant is an answer: given an agent, or the work on an issue.
set
The changes setting agent’s answer for kind at scope in a workspace holding held: the earlier answer is revoked, so the new one replaces it. None clears the answer, returning the scope to what the agent’s admission and broader answers say.