hive-sh4re + docs: extract Ask/Answer routing prose (#717 batch 2)

This commit is contained in:
iris 2026-05-31 15:53:25 +02:00
commit a12c097044
2 changed files with 45 additions and 34 deletions

View file

@ -337,15 +337,8 @@ pub enum AgentRequest {
/// per-agent web UI uses this to render its own inbox section.
Recent { limit: u64 },
/// Surface a question to either the operator or another agent.
/// `to = None` (or `Some("operator")`) routes the question to the
/// dashboard's operator-question queue (legacy `AskOperator`
/// behaviour). `to = Some(<agent>)` routes it to that agent's
/// inbox as a `HelperEvent::QuestionAsked` so the recipient can
/// answer back via `AgentRequest::Answer` (or
/// `ManagerRequest::Answer`); the answer threads back to the asker
/// as a `HelperEvent::QuestionAnswered` event. Either way the
/// response shape is `QuestionQueued { id }` — the asker uses the
/// id to correlate the asynchronous answer event.
/// Routing + shape: see
/// `docs/conventions.md::Question routing (Ask / Answer)`.
Ask {
question: String,
#[serde(default)]
@ -354,17 +347,13 @@ pub enum AgentRequest {
multi: bool,
#[serde(default)]
ttl_seconds: Option<u64>,
/// Recipient of the question. `None` or `Some("operator")` =
/// the human operator (dashboard); `Some(<agent_name>)` = a
/// peer agent (their inbox).
#[serde(default)]
to: Option<String>,
},
/// Answer a question previously routed to this agent via
/// `HelperEvent::QuestionAsked`. The caller is implicitly the
/// answerer; only the question's `target` agent (or the operator,
/// via the dashboard) is authorised. Wires through to
/// `HelperEvent::QuestionAnswered` in the asker's inbox.
/// `HelperEvent::QuestionAsked`. Authorised callers + threading
/// back via `HelperEvent::QuestionAnswered`: see
/// `docs/conventions.md::Question routing (Ask / Answer)`.
Answer { id: i64, answer: String },
/// Schedule a reminder message to be delivered to this agent at a
/// future time. The reminder lands in the agent's inbox as an auto-sent
@ -723,22 +712,8 @@ pub enum ManagerRequest {
description: Option<String>,
},
/// Surface a question to either the operator or another agent.
/// Mirrors `AgentRequest::Ask` exactly — see that doc for the
/// routing semantics (operator = dashboard queue; agent = the
/// peer's inbox via `HelperEvent::QuestionAsked`).
///
/// - `options` is advisory: empty = free-text only; non-empty = the
/// dashboard renders the choices alongside a free-text fallback
/// ("Other…") so the operator is never trapped.
/// - `multi=true` lets the operator pick multiple options (rendered
/// as checkboxes). The answer is returned as a single string with
/// selections joined by ", ".
/// - `ttl_seconds`: optional auto-cancel after that many seconds. On
/// expiry the question is resolved with answer `[expired]` and the
/// asker gets the usual `QuestionAnswered` event. None = wait
/// forever for an answer (or manual cancel).
/// - `to`: recipient (None / `Some("operator")` = operator;
/// `Some(<agent>)` = peer agent).
/// Manager-flavour mirror of `AgentRequest::Ask` — routing + shape
/// docs in `docs/conventions.md::Question routing (Ask / Answer)`.
Ask {
question: String,
#[serde(default)]
@ -751,8 +726,8 @@ pub enum ManagerRequest {
to: Option<String>,
},
/// Answer a question previously routed to the manager via
/// `HelperEvent::QuestionAsked` (i.e. an agent asked the manager
/// for input). Mirror of `AgentRequest::Answer`.
/// `HelperEvent::QuestionAsked`. Mirror of `AgentRequest::Answer`;
/// see `docs/conventions.md::Question routing (Ask / Answer)`.
Answer { id: i64, answer: String },
/// Fetch recent journal lines for a sub-agent container. `agent`
/// is the logical agent name; hive-c0re resolves it to the