Expand description
Handing an open question to the chat conversation its task came from.
A task filed by the standing chat (Source::Agent with
crate::queue::CHAT_NODE, whose run is the conversation’s id) can raise
a question the owner would rather talk through where the task started. The
owner passes it on; the chat agent either answers it with magi answer or
puts the decision points to the owner in the conversation.
Three rules, each with a reason:
- One place decides.
origin_talkis the only judge of “does this question have a chat to ask”; the web view and both entry points use it.associated_talkresolves typed ownership links for navigation, independently of consultation eligibility. - Not a choice. The hand-over never goes into
Question::choicesand never touchesQuestion::answer: the question staysOpen, its validation and the choice actions stay as they were. - No new seat, no new waiter. The text is queued as a draft of the existing talk, so the chat’s own turn machinery (its session, its turn gate) runs it exactly as if the owner had typed it.
Structs§
- Answer
Authority - Owner evidence retained with an answer, independent of its consultation destination.
- Consult
Outcome - A non-answer never wakes a waiter or executes a choice action.
- Recommendation
Manifest - Immutable recommendation-time binding to question choices and targets.
- Recovery
Recommendation - Execution binding published with a single internal recovery recommendation.
Enums§
- Consent
- Action consent is separate from consultation routing. This inventory uses execution effects (including structured actions), not only question nodes.
- Question
Kind - Authorization policy is selected by the question’s node, never its reply.
- Started
- What
start_turndid. - Task
Operation - Closed inventory of additional consultation operations. Every execution argument is bound by the owner’s complete instruction, not just a task id.
Functions§
- active_
consult - Consultation activity is separate from the question’s waiting state.
- answer_
write_ roots - The complete standing-turn write grant, also used by sandbox regressions.
Consultations and bound owner decisions need question/evidence locks;
active consultations additionally need queue storage. Evidenced
doneand dismissal effects need their exact run history/state directories. Never grant the whole home or lift the sandbox. - associated_
talk - The existing conversation associated with a question, regardless of whether the question is still eligible for consultation.
- authorize_
answer - Validate an answer under the question lock. The caller must also retain
Talks::answer_guardfrom before this read until the answer is persisted. Consultation is a delivery route, not the source of authority for an explicit, independently bound owner decision. - authorize_
recovery - Agent-mediated interpretation, bound to a full real owner send and the
immutable recommendation. Call under the same locks as
authorize_answer. This does not execute recovery; the daemon retains all ownership and merge gates. - authorize_
task_ operation - Caller holds the conversation evidence lock until the queue mutation ends.
- authorized_
answers - Whether this turn needs the question-store write grant. Uses the same persisted evidence and effect policy as the CLI; the CLI rechecks on write.
- authorized_
holds - Compatibility name for callers of the earlier hold-only grant.
- begin
- Record the hand-over and queue the question as the chat’s next message.
- chat_
talk_ of - The talk
startdescends from: the id recorded on a task (Task::chat_talk) wins, so deleted ancestors do not matter; tasks written before it existed are resolved by walking the ancestry. - consent
- Classify every offered decision, including generic structured actions.
- destructive_
effect - Execution effects shared with question deputies. The issuer and seat are part of the policy: identical labels can have different consumers.
- drain_
turns - Run the talk’s turns under
leaseuntil no draft is owed. - origin_
talk - The conversation
qmay be handed to, if any. - owner_
title - Replacement title explicitly supplied with its question/content binding. The final posting gate still vets this literal text before publication.
- pending_
consults - Is any question handed to talk
talk_idstill open? - question_
fingerprint - Fingerprint of execution-relevant question facts, independent of answer state.
- recommendation_
manifest - Capture at publication, never reconstruct new authority from old history.
- record_
other - Store an evidenced alternative and end only the consultation. Caller keeps the conversation evidence lock until Questions::update publishes the note.
- refuse_
operator_ held - Refuse a chat approval answer whose task the operator held, as
ask_settle_cmddoes for a deputy: such a hold is lifted by the operator’s button. The task is the oneq.runnames, directly or as one of its runs; none found (an unreadable task is not listed) does not refuse. The caller reads the queue before taking the question lock, so a hold placed in between is missed for that one call. - start_
turn begin, then run the chat’s turn here, under the talk’s own lease.- validate_
answer - Validate guarded decisions answered by a running chat. Terminal answers retain their existing behavior. Merge and posting policies both require evidence from the correct conversation; posting also checks the selected text.