Skip to main content

Module consult

Module consult 

Source
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_talk is the only judge of “does this question have a chat to ask”; the web view and both entry points use it. associated_talk resolves the same association for navigation even when the question can no longer be consulted.
  • Not a choice. The hand-over never goes into Question::choices and never touches Question::answer: the question stays Open, 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§

AnswerAuthority
Owner evidence retained with an answer, independent of its consultation destination.
RecommendationManifest
Immutable recommendation-time binding to question choices and targets.

Enums§

Consent
Action consent is separate from consultation routing. This inventory uses execution effects (including structured actions), not only question nodes.
QuestionKind
Authorization policy is selected by the question’s node, never its reply.
Started
What start_turn did.

Functions§

answer_write_roots
The complete standing-turn write grant, also used by sandbox regressions. Consultations and bound owner decisions need question/evidence locks; authorized dismissals additionally need queue claims and the exact run’s ownership/state writes. 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_guard from 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.
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 start descends 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 lease until no draft is owed.
origin_talk
The conversation q may 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_id still 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.
refuse_operator_held
Refuse a chat approval answer whose task the operator held, as ask_settle_cmd does for a deputy: such a hold is lifted by the operator’s button. The task is the one q.run names, 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.