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

@ -412,7 +412,7 @@ impl Policy {
/// Same shape and same reason as [`Self::wanted_stream`]: derived from
/// the crate constant rather than a third configurable bucket name.
fn agent_status_stream() -> String {
format!("KV_{}", swarm_queue_client::agent_status::BUCKET)
format!("KV_{}", swarm_wire::agent_status::BUCKET)
}
/// What *any* `JetStream` client must be able to ask before it can do
@ -563,7 +563,7 @@ impl Policy {
subjects.extend([
format!("$JS.API.STREAM.INFO.{agent_status}"),
format!("$JS.API.STREAM.CREATE.{agent_status}"),
format!("$KV.{}.{hive}.*", swarm_queue_client::agent_status::BUCKET),
format!("$KV.{}.{hive}.*", swarm_wire::agent_status::BUCKET),
]);
// Reading the caps the swarm sets for the agents this hive runs
// (`swarm_queue_client::agent_limits`): a direct get, so read-only, and
@ -782,7 +782,7 @@ mod tests {
// A hive publishes its *own* agents' status under
// `$KV.agent-status.<hive>.*` and must reach no further. This is the
// arm of the old reader-side guard that still holds.
let bucket = swarm_queue_client::agent_status::BUCKET;
let bucket = swarm_wire::agent_status::BUCKET;
let subjects = policy().hive_subjects("alpha");
for forbidden in [
format!("$KV.{bucket}.>"),
@ -814,7 +814,7 @@ mod tests {
#[test]
fn a_hive_may_write_only_its_own_agents_status_keys() {
let bucket = swarm_queue_client::agent_status::BUCKET;
let bucket = swarm_wire::agent_status::BUCKET;
let subjects = policy().hive_subjects("alpha");
let s = Policy::agent_status_stream();
for want in [