From c5b86afcb0cff1c6ff3a8c6632f177bae92eb976 Mon Sep 17 00:00:00 2001 From: atlas Date: Wed, 2 Sep 2026 21:30:15 +0200 Subject: [PATCH] swarm-controller, hive-c0re: the module docs still describe one shared bucket MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Both were prose about the model this branch replaces, caught in review. `swarm-controller/src/wanted.rs` was the worse of the two: its header called the lifecycle "deliberately identical" to `status` and the handle "resolved on first use and cached", while `store`'s own doc seventy lines below says "resolved per call rather than cached". One file, two contradictory claims, and the `OnceCell` that would have settled it is gone. Rewritten to say where the mirror stops rather than to patch the stale clause, since the divergence is the point of the change. `hive-c0re/src/workers/wanted.rs` named a `hive-wanted` bucket that no longer exists. Swept by content rather than fixing only the two that were named: the sweep surfaced a third candidate, `swarm-nats-auth/src/policy.rs`'s "one key per hive", and reading it cleared it — that sentence is about the hive-status bucket, whose shape is unchanged. Left alone deliberately. --- hive-c0re/src/workers/wanted.rs | 2 +- swarm-controller/src/wanted.rs | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/hive-c0re/src/workers/wanted.rs b/hive-c0re/src/workers/wanted.rs index 68ec3e17..4ade198a 100644 --- a/hive-c0re/src/workers/wanted.rs +++ b/hive-c0re/src/workers/wanted.rs @@ -1,6 +1,6 @@ //! Converging this hive onto the agent set the swarm controller declares. //! -//! The controller writes one key per hive into the `hive-wanted` bucket (see +//! The controller gives each hive its own `hive-wanted-` bucket (see //! [`swarm_queue_client::wanted`]); this reads its own and acts on it. It is //! the **repair** path, not the fast one: a deploy event //! ([`crate::swarm_status`]) is core NATS, so a hive that was down never hears diff --git a/swarm-controller/src/wanted.rs b/swarm-controller/src/wanted.rs index 7c6314f5..4e25d80a 100644 --- a/swarm-controller/src/wanted.rs +++ b/swarm-controller/src/wanted.rs @@ -2,9 +2,12 @@ //! //! The mirror of [`crate::status`]: that module reads what hives report, //! this one writes what they are told, and both address the same queue. -//! The lifecycle is deliberately identical — a NATS client rather than a -//! bucket handle, resolved on first use and cached, so a controller that -//! starts before the bucket exists picks it up without a restart. +//! Both hold a NATS client rather than a bucket handle, so a controller +//! that starts before a bucket exists picks it up without a restart. +//! +//! Where the mirror stops is the handle itself: `status` resolves one on +//! first use and caches it, while there is one wanted-state bucket **per +//! hive**, so no single handle serves them and `store` resolves per call. //! //! The bucket is the record. Nothing here keeps a second copy of the //! declaration to reconcile against, because the current value can be read