From cc03af339088c0a1c81219ad1a3306e09ba1cd8d Mon Sep 17 00:00:00 2001 From: damocles Date: Wed, 10 Jun 2026 19:55:34 +0200 Subject: [PATCH] docs: drop stale two-loop/two-binary framings (single hive serve loop) --- docs/turn-loop.md | 4 ++-- hive-ag3nt/src/serve_common.rs | 6 +++--- hive-ag3nt/src/turn.rs | 6 +++--- 3 files changed, 8 insertions(+), 8 deletions(-) diff --git a/docs/turn-loop.md b/docs/turn-loop.md index f8ece2d3..2a435269 100644 --- a/docs/turn-loop.md +++ b/docs/turn-loop.md @@ -298,8 +298,8 @@ socket at `/run/hive/` once at startup: The shared per-turn plumbing lives in `hive_ag3nt::turn::{write_mcp_config, write_settings, write_system_prompt, run_turn, drive_turn, -emit_turn_end, wait_for_login, compact_session}` so the two binaries -can't drift. +emit_turn_end, wait_for_login, compact_session}` — the single code path +every agent role runs through. ### Agent icon diff --git a/hive-ag3nt/src/serve_common.rs b/hive-ag3nt/src/serve_common.rs index 7af95d68..5710d89c 100644 --- a/hive-ag3nt/src/serve_common.rs +++ b/hive-ag3nt/src/serve_common.rs @@ -50,9 +50,9 @@ pub struct TurnRowArgs<'a> { pub open_reminders_count: Option, } -/// Assemble a `TurnStatRow` from the harness's per-turn state. Used by both -/// the agent and manager serve loops — the shape is identical, only the -/// post-turn count fetch helpers differ (and those stay in each binary). +/// Assemble a `TurnStatRow` from the harness's per-turn state. Lives here +/// (rather than inline in the `hive` serve loop) so it stays wire-type-free +/// and unit-testable; the binary just feeds it the post-turn counts. #[must_use] pub fn build_row(args: TurnRowArgs<'_>) -> TurnStatRow { let TurnRowArgs { diff --git a/hive-ag3nt/src/turn.rs b/hive-ag3nt/src/turn.rs index 0cd5d1bb..323eb6ee 100644 --- a/hive-ag3nt/src/turn.rs +++ b/hive-ag3nt/src/turn.rs @@ -294,7 +294,7 @@ fn compact_watermark_tokens(bus: &Bus) -> u64 { /// compact. This keeps a later turn from hitting the reactive path (where /// there is no chance to save anything first). /// -/// Both the sub-agent and manager loops call this. +/// Called once per turn by the `hive` serve loop (every agent role). pub async fn drive_turn(prompt: &str, files: &TurnFiles, bus: &Bus) -> TurnOutcome { maybe_auto_reset(bus); let outcome = match run_turn(prompt, files, bus).await { @@ -441,8 +441,8 @@ fn maybe_auto_reset(bus: &Bus) { bus.request_new_session(); } -/// Emit the per-turn `TurnEnd` event + log line. Single owner so the -/// agent and manager loops agree on outcome semantics. +/// Emit the per-turn `TurnEnd` event + log line. Single owner so outcome +/// semantics stay consistent across every agent role. pub fn emit_turn_end(bus: &Bus, outcome: &TurnOutcome) { match outcome { TurnOutcome::Ok | TurnOutcome::Compacted | TurnOutcome::PromptTooLong => {