From 96d74ea9ba9fd7c2db095f822eeea6c987e27cc6 Mon Sep 17 00:00:00 2001 From: Lorenz Leutgeb Date: Thu, 13 Aug 2026 17:02:45 +0200 Subject: [PATCH] radicle/cob/identity: Tighten initial revision Make `Identity::new` private, to have more control over the initial revision of the COB. Also assert that the author of the revision is the solve delegate of the initial revision, i.e., the "founder". --- crates/radicle/src/cob/identity.rs | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/crates/radicle/src/cob/identity.rs b/crates/radicle/src/cob/identity.rs index 691064cff..eba177224 100644 --- a/crates/radicle/src/cob/identity.rs +++ b/crates/radicle/src/cob/identity.rs @@ -198,8 +198,14 @@ impl std::ops::Deref for Identity { } impl Identity { - pub fn new(root: Revision) -> Self { + fn new(root: Revision) -> Self { let root_id = root.id; + let founder = *root.author.id(); + + debug_assert_eq!( + *root.doc.delegates(), + crate::identity::doc::Delegates::from(founder) + ); Self { root: root_id,