Watch
0
0
Fork
You've already forked hyperhive
0

move the review classifier, agent login and inference types into swarm-wire

This commit is contained in:
atlas 2026-10-18 08:58:13 +02:00 • committed by mara
commit 6ea13c02e3
44 changed files with 344 additions and 332 deletions

View file

@ -266,10 +266,10 @@ impl Policy {
Permissions {
publish: vec![Self::inbox(client_id)],
subscribe: Some(vec![
swarm_queue_client::review_classifier::SUBJECT.to_owned(),
swarm_wire::review_classifier::SUBJECT.to_owned(),
Self::inbox(client_id),
]),
responses: Some(swarm_queue_client::review_classifier::RUN_DEADLINE),
responses: Some(swarm_wire::review_classifier::RUN_DEADLINE),
}
}
@ -659,7 +659,7 @@ impl Policy {
swarm_queue_client::AGENT_CONTROL_SUBJECT_WILDCARD.to_owned(),
// A review classifier try-out, sent as a request: the reply comes
// back on this client's inbox, which it already subscribes to.
swarm_queue_client::review_classifier::SUBJECT.to_owned(),
swarm_wire::review_classifier::SUBJECT.to_owned(),
// A build of an agent config, sent as a request the same way.
swarm_wire::builder::SUBJECT.to_owned(),
// An archetype evaluation, sent as a request the same way.
@ -880,7 +880,7 @@ mod tests {
}
// The read reaches only this bucket.
for other in [
swarm_queue_client::agent_inference::direct_get_subject("atlas"),
swarm_wire::agent_inference::direct_get_subject("atlas"),
swarm_queue_client::agent_schedules::direct_get_subject("atlas"),
"$JS.API.DIRECT.GET.KV_hive-wanted-beta.$KV.hive-wanted-beta.beta".to_owned(),
] {
@ -1462,8 +1462,8 @@ mod tests {
#[test]
fn the_review_classifier_hears_its_subject_and_inbox_only_and_answers_by_reply() {
use swarm_queue_client::review_classifier::{RUN_DEADLINE, SUBJECT};
use swarm_queue_client::{agent_input_subject, client_inbox_prefix};
use swarm_wire::review_classifier::{RUN_DEADLINE, SUBJECT};
let p = with_classifier()
.permissions(CLASSIFIER)
@ -1502,7 +1502,7 @@ mod tests {
#[test]
fn only_the_reader_may_send_a_try_out() {
use swarm_queue_client::review_classifier::SUBJECT;
use swarm_wire::review_classifier::SUBJECT;
let p = with_classifier()
.with_agent_token_subjects(vec!["$SWARM.term.{agent}".to_owned()])
@ -1546,7 +1546,7 @@ mod tests {
for refused in [
">".to_owned(),
"$SWARM.>".to_owned(),
swarm_queue_client::review_classifier::SUBJECT.to_owned(),
swarm_wire::review_classifier::SUBJECT.to_owned(),
reply(&client_inbox_prefix("swarm-controller")),
] {
assert!(
@ -2060,7 +2060,7 @@ mod tests {
/// agent's own, and nothing that writes, watches or opens the bucket.
#[test]
fn an_agent_may_read_only_its_own_inference_key() {
use swarm_queue_client::agent_inference::{STREAM, direct_get_subject, key_subject};
use swarm_wire::agent_inference::{STREAM, direct_get_subject, key_subject};
let p = policy()
.with_agent_token_subjects(vec![