Watch
0
0
Fork
You've already forked hyperhive
0

review classifier: queued review requests survive a restart and are never refused

This commit is contained in:
atlas 2026-10-21 22:21:24 +02:00
commit d6aa83146a
7 changed files with 1021 additions and 454 deletions

View file

@ -69,8 +69,9 @@ The swarm's control plane. The swarm UI and `swarmctl` are its clients.
the harness to write when no file exists →
[`docs/swarm/README.md`](../docs/swarm/README.md#an-agents-agentsmd).
- **Review classifier** — try-outs from the swarm UI and reviews on review
requests, and the newest 100 finished runs, one document in the
`review-classifier-runs` KV bucket, which this daemon alone writes
requests, the requested reviews not yet finished, in the `review-requests`
work-queue stream, and the newest 100 finished runs, one document in the
`review-classifier-runs` KV bucket, both of which this daemon alone writes
(`POST /api/review-classifier/try-out`, `GET /api/review-classifier/try-out/{id}`,
`GET /api/review-classifier/rules`, `GET /api/review-classifier/runs`), and
the try-out page's branch for a PR, pushed as the classifier's forge account

View file

@ -235,7 +235,12 @@ async fn main() -> Result<()> {
reviews: Arc::default(),
alerts: alerts::from_env(),
};
serve(listener, state).await
}
/// Start taking the queued review requests, then serve `state` on `listener`.
async fn serve(listener: tokio::net::UnixListener, state: AppState) -> Result<()> {
review_classifier::review::spawn_queue(&state);
axum::serve(listener, build_app(state))
.await
.context("serving swarm-controller")

File diff suppressed because it is too large Load diff

View file

@ -60,12 +60,14 @@ pub(crate) enum RunOutcome {
Approved,
/// A review requested changes.
ChangesRequested,
/// A comment was posted: the rules did not load, the PR was unreadable,
/// the run failed, the classifier sent a different number of answers
/// than it was sent classifications, or any classification got none.
/// A comment was posted: the request could not be queued, the rules did
/// not load, the PR was unreadable, the run failed, the classifier sent a
/// different number of answers than it was sent classifications, or any
/// classification got none.
NoVerdict,
/// No run started, as every run and wait place was taken; a comment
/// saying so was posted.
/// saying so was posted. This build records none; it is here so that a
/// stored record of it still reads.
QueueFull,
/// The review could not be posted.
PostFailed,