Watch
0
0
Fork
You've already forked hyperhive
0

swarm-wire: take agent_status's wire types

This commit is contained in:
atlas 2026-10-18 12:17:46 +02:00 • committed by mara
commit 9222a051f5
10 changed files with 180 additions and 181 deletions

View file

@ -1,7 +1,7 @@
//! Offering each locally-hosted agent's status upward to the swarm.
//!
//! Sibling task to [`crate::swarm_status`], not a field folded into it — see
//! `swarm_queue_client::agent_status`'s module doc for why hive status and
//! `swarm_wire::agent_status`'s module doc for why hive status and
//! agent status live in separate buckets. Same direction, though: a hive
//! **offers** what it already knows about its own agents (via
//! [`crate::container_view::read_agent_status_bounded`], the bounded form of
@ -9,7 +9,7 @@
//! controller never reaches down to collect it.
//!
//! **One publish per agent, not one document for the hive.** Each agent
//! gets its own key (`swarm_queue_client::agent_status::key`), so one
//! gets its own key (`swarm_wire::agent_status::key`), so one
//! agent's status changing does not touch any other agent's key, and a
//! consumer watching one agent reads exactly its own revision history.
@ -127,7 +127,7 @@ async fn publish_all(client: &async_nats::Client, hive: &str) -> Result<usize> {
tracing::warn!(agent = %spec.name, "agent status: unit state unreadable, skipping");
continue;
};
let payload = swarm_queue_client::agent_status::AgentStatus {
let payload = swarm_wire::agent_status::AgentStatus {
status_text,
status_set_at,
running,
@ -139,7 +139,7 @@ async fn publish_all(client: &async_nats::Client, hive: &str) -> Result<usize> {
continue;
}
};
let key = swarm_queue_client::agent_status::key(hive, &spec.name);
let key = swarm_wire::agent_status::key(hive, &spec.name);
if let Err(e) = store.put(key, bytes.into()).await {
tracing::warn!(agent = %spec.name, error = %e, "agent status: publish failed, skipping");
continue;