From 7daeb3135b9a264e71b631b6896339bea7784590 Mon Sep 17 00:00:00 2001 From: Fintan Halpenny Date: Thu, 2 Jul 2026 16:27:06 +0000 Subject: [PATCH] radicle/cob/identity: Add SiblingAccepted error variant Add an `ApplyError` for variant, `SiblingAccepted`, to use to enforce the new invariant: delegates must not accept active, sibling revisions. --- crates/radicle-cli/src/commands/id.rs | 1 + crates/radicle/src/cob/identity.rs | 2 ++ 2 files changed, 3 insertions(+) diff --git a/crates/radicle-cli/src/commands/id.rs b/crates/radicle-cli/src/commands/id.rs index 3fc9df01..27fc3f13 100644 --- a/crates/radicle-cli/src/commands/id.rs +++ b/crates/radicle-cli/src/commands/id.rs @@ -501,6 +501,7 @@ fn on_apply_err(e: &identity::ApplyError, profile: &Profile) -> anyhow::Error { | e @ radicle::cob::identity::ApplyError::MissingParent | e @ radicle::cob::identity::ApplyError::DuplicateVerdict | e @ radicle::cob::identity::ApplyError::UnexpectedState + | e @ radicle::cob::identity::ApplyError::SiblingAccepted | e @ radicle::cob::identity::ApplyError::DocUnchanged | e @ radicle::cob::identity::ApplyError::Git(_) | e @ radicle::cob::identity::ApplyError::Doc(_) diff --git a/crates/radicle/src/cob/identity.rs b/crates/radicle/src/cob/identity.rs index a833bb07..aec69575 100644 --- a/crates/radicle/src/cob/identity.rs +++ b/crates/radicle/src/cob/identity.rs @@ -122,6 +122,8 @@ pub enum ApplyError { DuplicateVerdict, #[error("revision is in an unexpected state")] UnexpectedState, + #[error("delegate already accepted a sibling revision '{revision}'")] + SiblingAccepted { revision: RevisionId }, #[error("document does not contain any changes to current identity")] DocUnchanged, #[error("git: {0}")]