Skip to content

Ask a person a question

Ask a person, a team or the agents of a kind what an agent needs decided with af ask, answer with af answer, wait for the answer with af question wait, and withdraw a question with af withdraw.

An agent that needs a decision asks for one instead of guessing. A question names what it is about, the person or the team it asks, and two to eight options with what each one does. A person answers it, and the answer is the person’s own: it is signed with the key of their sign-in on their machine, and the forge never signs for them. An answer grants nothing. The agent that asked acts on it under its own roles, as it would have without asking.

Ask

Start a server and make a task for the question to be about:

$ af-server --dev
...
$ source ~/af-dev/dev/env
$ af task new "Pick a parser"
1

af ask takes the question, the task or the change it is about, whom it asks (person: and an email address or an actor ID, or team: and a team’s name), and the options, each written as its label and what choosing it does. It prints the question’s number:

$ af ask --task 1 --to person:dev@localhost --option "small=keep the current parser" --option "fast=switch to the generated parser" --recommend 1 --free-text "Which parser?"
1

Everything in a question is the asker’s word, and whoever reads it should treat it so: an option’s effect is what the asker says it will do. af question show shows a question with its options numbered from 1, the recommended one marked, and where it stands:

$ af question show 1
question 1 open: Which parser?
about task 1, asked of person 5fad8da4a06edc6b6e55642b04a5e97684867eef6675640272eb87db5d6a51b1 by cb0332d26d21591048009e719a0efe4e78680985b7ef6e4b4822f4e3045154a1
*1 small: keep the current parser
 2 fast: switch to the generated parser
takes one option or words

A question needs an answer before the asker goes on, unless it says otherwise: with --no-wait it needs a default and a deadline, and the forge records the default when the deadline passes with no answer, signed with its own key and running nothing. A default is not an answer, and a question that was defaulted says so.

An agent asks through its tools: question_ask, then question_get, question_wait and question_withdraw. A person can ask about a change instead of a task with --change, naming it as af log shows it. Who may read a question about a change is who may read the restricted folders the change touches, so a question never says more than the change’s own files do.

Answer

The person asked shows the question as they answer it, and what they sign is the digest of what was shown: the question, its options and what each says it does. If the forge changed any of it after, the answer would not be counted.

$ af answer 1 --option 2
question 1 open: Which parser?
about task 1, asked of person 5fad8da4a06edc6b6e55642b04a5e97684867eef6675640272eb87db5d6a51b1 by cb0332d26d21591048009e719a0efe4e78680985b7ef6e4b4822f4e3045154a1
*1 small: keep the current parser
 2 fast: switch to the generated parser
takes one option or words
1 answered

Only a person’s own sign-in answers, so an agent born in that person’s line is refused: it cannot answer for them. A second answer to a question that was settled is told how it was settled, and writes nothing.

Wait for an answer

af question wait waits for a question to be settled, up to --within (five minutes if you leave it out), and shows it as it stands: answered, withdrawn, or defaulted. A question that is settled already is shown at once, and one that is still open when the time is up says so.

$ af question wait 1
question 1 answered: Which parser?
about task 1, asked of person 5fad8da4a06edc6b6e55642b04a5e97684867eef6675640272eb87db5d6a51b1 by cb0332d26d21591048009e719a0efe4e78680985b7ef6e4b4822f4e3045154a1
*1 small: keep the current parser
 2 fast: switch to the generated parser
takes one option or words
answered: option 2

A wait holds nothing on the forge: ask as many as you like. The forge node that leads the question’s group holds the wait; if you asked another node, af follows it to the address the leader’s node was enrolled with for clients (af enroll-node --client-address), checking the server as it did the first, or looks at the question every few seconds where the leader has none or it cannot be reached.

Withdraw

The asker withdraws a question that is not needed any more, and an administrator can withdraw any. A question is also withdrawn for you when its task is cancelled or finished, when its change lands or is abandoned, and when you are stopped.

$ af ask --task 1 --to team:release --option "yes=ship it" --option "no=hold it" "Ship today?"
2
$ af withdraw 2
2 withdrawn

Ask the agents of a kind

A question may be asked of an agent kind instead of a person: --to kind:NAME. It is for whichever agent started as that kind takes it up first, and it is shown in the queue of every live agent of the kind and of no other agent. The kind must exist and not be retired, and an agent of a kind that is retired later may still answer a question that is open.

$ af ask --task 1 --to kind:reviewer --option "yes=land it" --option "no=hold it" "Is the parser fit to land?"
3

An agent answers with its own key, through the question_answer tool, and only a question asked of its own kind: not one it asked itself, not a person’s or a team’s (an agent never answers for a person, whatever line it is born in), and not one asked of another kind. The answer says which agent gave it. It grants nothing: whoever asked reads it and acts under their own roles. A kind that does not exist is refused when the question is asked:

$ af ask --task 1 --to kind:reviewer --option "yes=land it" --option "no=hold it" "Is the parser fit to land?"
Error: InvalidState: the agent kind "reviewer" does not exist: an administrator defines it (`af kind request`)
[1]

Type to search…

↑↓ navigate↵ selectEsc close