From ac7d6d1c4433d9e22195fe370facf25e0117cbac Mon Sep 17 00:00:00 2001 From: argus Date: Mon, 30 Nov 2026 21:55:32 +0100 Subject: [PATCH] review-classifier: a rule against a hand-rolled retry or backoff A retry or backoff policy written out by hand (a capped doubling wait, a jitter from the clock, a try count with a sleep) goes against the workspace's own dependency on backon. The rule flags a diff that adds one; the controller test lists the rule name. --- .hyperhive/review-classifier.yml | 14 ++++++++++++++ swarm-controller/src/review/review_classifier.rs | 1 + 2 files changed, 15 insertions(+) diff --git a/.hyperhive/review-classifier.yml b/.hyperhive/review-classifier.yml index 2171b1c32..f3fa95dbb 100644 --- a/.hyperhive/review-classifier.yml +++ b/.hyperhive/review-classifier.yml @@ -163,3 +163,17 @@ classifications: makes the question not applicable. polarity: negative threshold: 70 + - name: no-hand-rolled-backoff + description: >- + The diff adds its own retry or backoff policy in Rust: a wait that is + doubled, multiplied or stepped up after each failure and capped, a + jitter drawn from the clock or a random number, or a retry count with + a sleep between tries, written out by hand. The workspace already + depends on `backon` (`ExponentialBuilder`, `ConstantBuilder` and + `Retryable`), so such a policy is built from it. A fixed pause in a + poll loop, a timeout, a deadline or a per-key not-before time that is + stored as data, and a test that only fakes the clock, are not a retry + policy. A diff that adds no retry or backoff makes the question not + applicable. + polarity: negative + threshold: 70 diff --git a/swarm-controller/src/review/review_classifier.rs b/swarm-controller/src/review/review_classifier.rs index 5b0c2fe02..9ef782ecb 100644 --- a/swarm-controller/src/review/review_classifier.rs +++ b/swarm-controller/src/review/review_classifier.rs @@ -1452,6 +1452,7 @@ classifications: "option-in-the-wrong-namespace", "docs-describe-current-state", "closes-only-finished-issues", + "no-hand-rolled-backoff", ] ); }