From 44c86b927874da8341cc66109f3acb02342197c3 Mon Sep 17 00:00:00 2001 From: damocles Date: Wed, 20 May 2026 11:54:14 +0200 Subject: [PATCH] docs: correct stale recv_blocking + vacuum references --- CLAUDE.md | 4 ++-- docs/turn-loop.md | 4 ++-- hive-c0re/src/dashboard_events.rs | 2 +- hive-c0re/src/main.rs | 9 +++++---- 4 files changed, 10 insertions(+), 9 deletions(-) diff --git a/CLAUDE.md b/CLAUDE.md index 2172b05..a4d76b1 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -22,9 +22,9 @@ hive-c0re/ host daemon + CLI (one binary, subcommand-dispatched) src/manager_server.rs manager-privileged socket (ManagerRequest) src/agent_server.rs per-sub-agent socket listener (long-poll Recv) src/broker.rs sqlite Message store + intra-process broadcast - channel (`MessageEvent`) for `recv_blocking` + + channel (`MessageEvent`) for `recv_blocking_batch` + the dashboard forwarder; hourly vacuum of - delivered>30d + acked>30d src/dashboard_events.rs unified wire-facing event channel feeding `/dashboard/stream`. Carries broker `Sent` / `Delivered` (mirrored by the forwarder task diff --git a/docs/turn-loop.md b/docs/turn-loop.md index f5900ca..5d5c3b2 100644 --- a/docs/turn-loop.md +++ b/docs/turn-loop.md @@ -8,8 +8,8 @@ claude has access to in return. Each agent harness (`hive-ag3nt serve` or `hive-m1nd serve`) runs: 1. Long-poll `Recv` on its socket. The host-side broker - (`broker.rs::recv_blocking`) returns immediately if there's a - pending message, otherwise waits up to 30 s for a broker `Sent` + (`broker.rs::recv_blocking_batch`) returns immediately if there's + a pending message, otherwise waits up to 30 s for a broker `Sent` event for this recipient. 2. Pop one message. Peek the remaining inbox depth with `Status`. 3. Emit `LiveEvent::TurnStart { from, body, unread }` onto the SSE diff --git a/hive-c0re/src/dashboard_events.rs b/hive-c0re/src/dashboard_events.rs index 4d5346e..943032f 100644 --- a/hive-c0re/src/dashboard_events.rs +++ b/hive-c0re/src/dashboard_events.rs @@ -16,7 +16,7 @@ //! and re-emits each `MessageEvent` as a `DashboardEvent::Sent` / //! `DashboardEvent::Delivered` with a freshly-stamped seq. Keeping the //! broker's intra-process channel separate avoids coupling the broker -//! (used by `recv_blocking` inside the harness loop) to dashboard +//! (used by `recv_blocking_batch` inside the harness loop) to dashboard //! presentation concerns. //! //! New mutation kinds (approval added/resolved, question added/answered, diff --git a/hive-c0re/src/main.rs b/hive-c0re/src/main.rs index edd6e05..028a7d5 100644 --- a/hive-c0re/src/main.rs +++ b/hive-c0re/src/main.rs @@ -148,9 +148,10 @@ async fn main() -> Result<()> { tokio::spawn(async move { forge::ensure_all().await; }); - // Periodic broker vacuum: drop delivered messages older than - // 30 days. Undelivered messages are always kept (still in - // flight). Runs hourly; first sweep happens immediately. + // Periodic broker vacuum: drop fully-acked messages older + // than 30 days. Delivered-but-unacked rows (recoverable via + // requeue_inflight) and undelivered rows are always kept. + // Runs hourly; first sweep happens immediately. let vacuum_coord = coord.clone(); tokio::spawn(async move { let interval_secs = 3600u64; @@ -178,7 +179,7 @@ async fn main() -> Result<()> { // channel with a freshly-stamped seq, so the dashboard SSE // sees broker messages + future mutation events on one // stream with one monotonic seq. The broker's intra-process - // channel (used by `recv_blocking`) stays untouched. + // channel (used by `recv_blocking_batch`) stays untouched. spawn_broker_to_dashboard_forwarder(coord.clone()); let dash_coord = coord.clone(); tokio::spawn(async move {