Watch
0
0
Fork
You've already forked hyperhive
0

review classifier: the most classifications a run carries is a setting

The limit was a constant of ten in swarm-wire, so a repo with eleven rules
could not be reviewed and nothing short of a rebuild changed it. It is now
`max_classifications` in the classifier settings, beside
`max_concurrent_reviews`: 1 to 1000, ten until set, and a document stored
before the field decodes with the default. The classifier settings form in
the swarm UI gets a "rules per review" field, and the try-out's add button
stops at the saved limit instead of a hard-coded ten.

The controller checks a try-out, and a requested review's rules file, against
the setting where the run starts. The rules file itself may hold up to the
1000 the setting allows, so raising the limit needs no change to a repo.
A review whose rules exceed the limit posts a no-verdict comment saying so.

A run's reply deadline was a constant that covered ten classifications, a
minute plus three each. It is now computed from the run's own size, so a
bigger run waits as long as it needs and a default-sized one still waits 31
minutes. The classifier's answer window in the queue permissions covers the
biggest run the setting allows.
This commit is contained in:
iris 2026-11-07 10:37:52 +01:00 • committed by mara
commit cffe8895df

View file

@ -239,7 +239,7 @@ impl Policy {
swarm_wire::review_classifier::SUBJECT.to_owned(),
Self::inbox(client_id),
]),
responses: Some(swarm_wire::review_classifier::RUN_DEADLINE),
responses: Some(swarm_wire::review_classifier::max_run_deadline()),
}
}
@ -1669,7 +1669,7 @@ mod tests {
#[test]
fn the_review_classifier_hears_its_subject_and_inbox_only_and_answers_by_reply() {
use swarm_queue_client::{agent_input_subject, client_inbox_prefix};
use swarm_wire::review_classifier::{RUN_DEADLINE, SUBJECT};
use swarm_wire::review_classifier::{SUBJECT, max_run_deadline};
let p = with_classifier()
.permissions(CLASSIFIER)
@ -1694,7 +1694,7 @@ mod tests {
// It publishes nothing but replies: its own inbox keeps the list
// non-empty, and reaches no other client.
assert_eq!(p.publish, vec![format!("{inbox}.>")]);
assert_eq!(p.responses, Some(RUN_DEADLINE));
assert_eq!(p.responses, Some(max_run_deadline()));
}
#[test]