diff --git a/hive-c0re/src/loose_ends.rs b/hive-c0re/src/loose_ends.rs index 94f9be99..24eb34c2 100644 --- a/hive-c0re/src/loose_ends.rs +++ b/hive-c0re/src/loose_ends.rs @@ -21,6 +21,8 @@ use hive_sh4re::{LooseEnd, MANAGER_AGENT}; use crate::coordinator::Coordinator; /// Open threads pending against `agent`: +/// - undelivered inbox messages this agent still owes itself a `recv` +/// for (only when the count is non-zero); /// - pending approvals where this agent is the submitter (a parent /// agent with the `approvals` group submits for its children; the /// root submits for top-level agents). Legacy rows with no recorded @@ -29,9 +31,15 @@ use crate::coordinator::Coordinator; /// someone) OR the target (owes a reply); /// - pending reminders this agent scheduled (`owner == self`). /// -/// Ordered approvals → questions → reminders within the returned -/// vector. Within each kind, source-of-truth ordering (sqlite's -/// `pending()` queries return newest-first within their indexes). +/// Ordered `pending_messages` (when non-zero) → approvals → questions → +/// reminders within the returned vector. Within each kind, +/// source-of-truth ordering (sqlite's `pending()` queries return +/// newest-first within their indexes). +/// +/// # Errors +/// +/// Propagates errors from `count_pending` and the pending-approval / +/// question / reminder sqlite queries. pub fn for_agent(coord: &Coordinator, agent: &str) -> Result> { let now = now_unix(); let mut out = Vec::new();