From 16a615eb0882782dbaadfb7f539a7fdcec146afc Mon Sep 17 00:00:00 2001 From: John Tennant Date: Wed, 2 Sep 2026 14:47:14 -0400 Subject: [PATCH] refactor(projects): remove unreachable command scaffolding Signed-off-by: John Tennant --- .../src/commands/project_related_channels.rs | 1 - crates/buzz-relay/src/handlers/ingest.rs | 7 ------- crates/buzz-sdk/src/project_related_channel.rs | 16 ++-------------- 3 files changed, 2 insertions(+), 22 deletions(-) diff --git a/crates/buzz-cli/src/commands/project_related_channels.rs b/crates/buzz-cli/src/commands/project_related_channels.rs index 00493604e2..eb62fffab3 100644 --- a/crates/buzz-cli/src/commands/project_related_channels.rs +++ b/crates/buzz-cli/src/commands/project_related_channels.rs @@ -28,7 +28,6 @@ async fn submit_related_channel_command( &project_coordinate.coordinate, channel_id, operation, - None, ) .map_err(sdk_error)?; let event = client.sign_event(builder)?; diff --git a/crates/buzz-relay/src/handlers/ingest.rs b/crates/buzz-relay/src/handlers/ingest.rs index c18d2f7ad4..2d968384af 100644 --- a/crates/buzz-relay/src/handlers/ingest.rs +++ b/crates/buzz-relay/src/handlers/ingest.rs @@ -535,9 +535,6 @@ fn required_scope_for_kind(kind: u32, event: &Event) -> Result Ok(Scope::ChannelsWrite), - // Relay-derived read model. Clients are rejected by the relay-only gate; - // this keeps the registered-kind scope map total. - KIND_PROJECT_RELATED_CHANNELS_SNAPSHOT => Ok(Scope::ChannelsWrite), KIND_GIT_PATCH | KIND_GIT_PULL_REQUEST | KIND_GIT_PR_UPDATE @@ -5593,10 +5590,6 @@ mod postgres_tests { ); assert!(is_global_only_kind(KIND_PROJECT_RELATED_CHANNEL)); assert!(!requires_h_channel_scope(KIND_PROJECT_RELATED_CHANNEL)); - assert_eq!( - required_scope_for_kind(KIND_PROJECT_RELATED_CHANNELS_SNAPSHOT, &dummy).unwrap(), - Scope::ChannelsWrite - ); assert!(is_global_only_kind(KIND_PROJECT_RELATED_CHANNELS_SNAPSHOT)); assert!(buzz_core::kind::is_relay_only_kind( KIND_PROJECT_RELATED_CHANNELS_SNAPSHOT diff --git a/crates/buzz-sdk/src/project_related_channel.rs b/crates/buzz-sdk/src/project_related_channel.rs index 18ee67845f..b0c379ff3e 100644 --- a/crates/buzz-sdk/src/project_related_channel.rs +++ b/crates/buzz-sdk/src/project_related_channel.rs @@ -214,7 +214,6 @@ pub fn build_project_related_channel_command( project_coordinate: &str, channel_id: Uuid, operation: ProjectRelatedChannelOperation, - auth: Option, ) -> Result { let _ = ProjectRelatedChannelCoordinate::parse(project_coordinate)?; if channel_id.is_nil() { @@ -222,7 +221,7 @@ pub fn build_project_related_channel_command( "d target must not be the nil UUID".into(), )); } - let mut tags = vec![ + let tags = vec![ Tag::parse(["a", project_coordinate]) .map_err(|error| SdkError::InvalidTag(error.to_string()))?, Tag::parse(["op", operation.as_str()]) @@ -230,16 +229,6 @@ pub fn build_project_related_channel_command( Tag::parse(["d", &channel_id.to_string()]) .map_err(|error| SdkError::InvalidTag(error.to_string()))?, ]; - if let Some(auth) = auth { - let parts = auth.as_slice(); - if parts.len() != 4 || parts.first().map(String::as_str) != Some("auth") { - return Err(SdkError::InvalidInput( - "auth tag must have exactly four elements".into(), - )); - } - tags.push(auth); - } - Ok(EventBuilder::new(Kind::Custom(KIND_PROJECT_RELATED_CHANNEL as u16), "").tags(tags)) } @@ -381,9 +370,9 @@ mod tests { &coordinate(&keys), Uuid::new_v4(), ProjectRelatedChannelOperation::Add, - Some(auth), ) .expect("build command") + .tag(auth) .sign_with_keys(&keys) .expect("sign command"); @@ -399,7 +388,6 @@ mod tests { &coordinate(&keys), channel, ProjectRelatedChannelOperation::Remove, - None, ) .is_ok());