pub async fn check_any_pending(
pool: &Pool,
target_hierarchy: &str,
) -> Result<bool, Error>Expand description
EXISTS-check: are any queue rows in scope for target_hierarchy?
Used by agents spawn’s end-of-pass restart logic to
decide whether to fire another pass. The two-rule predicate
matches read_pending_and_upgrade_tag’s SELECT exactly — direct
hierarchy hit OR BOUND-tag hit.
No upgrade side effect. Tag-group upgrade now happens
exclusively inside read_pending_and_upgrade_tag, fired by the
conduit on every read-message-queue request. By the time the
spawn pass ends, the conduit has already promoted every sibling
tag in the group via its own reads, so this pure EXISTS check
suffices for the restart decision.