From b1ceb11261b4edb8ec46ed95f4f3e22011bdef73 Mon Sep 17 00:00:00 2001 From: "@permadeath.com" Date: Fri, 23 Oct 2026 12:43:30 -0400 Subject: [PATCH] refactor(index)!: drop the Rejection variants nothing constructs Ten variants, the vouch-worded ones among them, were left from server discovery and are never built; Rejection is public, so this breaks a match. Co-Authored-By: Claude Opus 5.5 Change-Id: Ie6d368dc504558b22c0dee69cd0f6eb9ca912e50 --- crates/vibescrobble-index/src/report.rs | 127 +----------------------- 1 file changed, 3 insertions(+), 124 deletions(-) diff --git a/crates/vibescrobble-index/src/report.rs b/crates/vibescrobble-index/src/report.rs index 7a7fe37d..0c2afeb1 100644 --- a/crates/vibescrobble-index/src/report.rs +++ b/crates/vibescrobble-index/src/report.rs @@ -2,15 +2,14 @@ //! //! Rejections are values rather than log lines, and they are one type rather //! than one per stage. An operator who pointed the appview at a server and -//! got nothing back needs to be told which link of the chain gave way — a DID -//! would not resolve, the server answered with something else, a repository -//! sat outside the zone — and a count of indexed feeds cannot say any of +//! got nothing back needs to be told which link of the chain gave way — the +//! server did not answer, answered with something else, or held a record +//! that is not a scrobble — and a count of indexed feeds cannot say any of //! that. use serde::de::DeserializeOwned; use crate::http::{preview, HttpGet}; -use crate::resolve::ResolveFailure; /// How much of a server's answer is quoted back in a rejection. const BODY_PREVIEW: usize = 160; @@ -48,67 +47,6 @@ pub enum Rejection { /// What could not be read. reason: String, }, - /// A DID in the chain would not resolve. - #[error("{did}: {reason}")] - Unresolvable { - /// The DID that was being resolved. - did: String, - /// Why it would not resolve, or would not yield a server. - reason: ResolveFailure, - }, - /// The health endpoint answered, but not as a vibescrobble server. - /// - /// Its own zone is the one thing a server must be able to state: what it - /// may speak for is decided against that zone. - #[error("{server}: answered /health without a zone; this is not a vibescrobble server")] - NotVibescrobble { - /// The server that was read. - server: String, - }, - /// The server's zone and the vouched name have nothing to do with each - /// other. - /// - /// One has to contain the other. A server minting under `agents.example` - /// can answer for a vouch naming `agents.example` or one naming a single - /// account inside it, and for nothing else. - #[error("{server}: mints under {zone:?}, which neither contains nor sits under the vouched {authority:?}")] - ZoneOutsideAuthority { - /// The server that was read. - server: String, - /// The zone it reported. - zone: String, - /// The name the vouch bounded it to. - authority: String, - }, - /// An account was listed with a DID this appview cannot parse. - #[error("{server}: listed {did:?}, which is not a usable did:web: {reason}")] - UnusableDid { - /// The server that listed it. - server: String, - /// The DID as listed. - did: String, - /// Why it would not parse. - reason: String, - }, - /// An account was listed that the server has no authority over. - #[error("{server}: listed {did:?}, which is not at or below its zone {zone:?}")] - DidEscapesZone { - /// The server that listed it. - server: String, - /// The DID as listed. - did: String, - /// The zone it had to sit under. - zone: String, - }, - /// A vouch named one account, and the server it pointed at does not host - /// it. - #[error("{server}: does not host the vouched account {did}")] - AccountNotHosted { - /// The server that was read. - server: String, - /// The account the vouch named. - did: String, - }, /// A record in an indexed feed was not a readable scrobble. #[error("{server}: record {uri} is not a readable scrobble: {reason}")] UnreadableRecord { @@ -119,65 +57,6 @@ pub enum Rejection { /// What was wrong with it. reason: String, }, - /// An account was listed with a handle the server has no authority over. - /// - /// Containment read as a rule about handles. A handle resolves through the name - /// itself — `/.well-known/atproto-did` on the handle's own hostname — so a - /// handle outside the server's zone is one the server cannot make resolve - /// and has no business claiming. The account is still indexed: its DID - /// passed containment and is what everything downstream is decided on. - /// The handle is what is dropped, because nothing else can be. - #[error("{server}: listed {did} with the handle {handle:?}, which is not at or below its zone {zone:?}; the handle is dropped")] - HandleEscapesZone { - /// The server that listed it. - server: String, - /// The account it was listed against. - did: String, - /// The handle as listed. - handle: String, - /// The zone it had to sit under. - zone: String, - }, - /// An account was listed with a handle that is not a handle. - #[error("{server}: listed {did} with {handle:?}, which is not a handle: {reason}; the handle is dropped")] - UnusableHandle { - /// The server that listed it. - server: String, - /// The account it was listed against. - did: String, - /// The handle as listed. - handle: String, - /// Why it is not one. - reason: String, - }, - /// Two accounts were listed under one handle. - /// - /// A handle resolves to exactly one DID, so a second claim on a name is - /// one the reverse direction would refuse. Which of the two is the real - /// holder is not knowable from the listing, so neither keeps it: the - /// first is left alone only because dropping both on the arrival of a - /// forgery would let a server erase a name by claiming it twice. - #[error("{server}: listed {did} under the handle {handle:?}, already claimed by {first}; the handle is dropped")] - DuplicateHandle { - /// The server whose copy was dropped. - server: String, - /// The account whose handle was dropped. - did: String, - /// The handle claimed twice. - handle: String, - /// The account that claimed it first. - first: String, - }, - /// Two vouches, or two servers, offered the same account. - #[error("{server}: also offers {did:?}, already indexed from {first}; the copy is ignored")] - DuplicateDid { - /// The server whose copy was dropped. - server: String, - /// The DID offered twice. - did: String, - /// The server that offered it first. - first: String, - }, } /// GETs `url` and parses it, mapping every failure to a [`Rejection`]. -- knotmirror 0.0.1