diff --git a/swarm-wire/src/agent_icon.rs b/swarm-wire/src/agent_icon.rs index d0230b916..a0f645ce6 100644 --- a/swarm-wire/src/agent_icon.rs +++ b/swarm-wire/src/agent_icon.rs @@ -40,8 +40,8 @@ pub const MEDIA_TYPE: &str = "image/svg+xml"; /// The subject `agent`'s entry is written on: `$KV..`, where the /// key is the agent name and nothing else. /// -/// A KV put is a `JetStream` publish to this subject, so a writer that -/// publishes directly has to use the same subject the bucket's `get` reads. +/// A KV put is a `JetStream` publish to this subject, and the bucket's `get` +/// reads the same one. #[must_use] pub fn subject(agent: &str) -> String { format!("$KV.{BUCKET}.{agent}") @@ -51,9 +51,8 @@ pub fn subject(agent: &str) -> String { mod tests { use super::subject; - /// One token after the bucket, the agent name alone. That is what the - /// per-agent grant `$KV.agent-icons.{agent}` expands to, and what a - /// hive-scoped grant (`$KV...*`, two tokens) cannot match. + /// One token after the bucket, the agent name alone: no hive in the key, so + /// a hive-scoped subject (`$KV...*`, two tokens) cannot match. #[test] fn the_published_subject_carries_the_agent_and_no_placement() { assert_eq!(subject("iris"), "$KV.agent-icons.iris");