From c618174e60e4632d36d7352d83399508c72b2f42 Mon Sep 17 00:00:00 2001 From: soryu Date: Tue, 27 Jan 2026 11:04:20 +0000 Subject: Add Red Team CLI command and frontend UI (#39) * Add Red Team CLI command and frontend UI Backend additions: - Add `makima red-team notify` CLI command for red team tasks - Add RedTeamCommand enum with Notify subcommand - Add red_team API client module for notify endpoint - Add RedTeamNotifyArgs with severity, task, file, context options Frontend additions: - Add ContractCreateModal with red team toggle and prompt input - Update ContractDetail with red-team tab for notifications - Update ContractList with red team enabled badge - Add TypeScript types for RedTeamNotification and related interfaces Co-Authored-By: Claude Opus 4.5 * Add CSS styles for Red Team frontend components Add comprehensive styling for: - Contract list and detail containers - Red team badge styling with gradient backgrounds - Tab navigation with red team specific styling - Red team notifications panel with severity indicators - Contract creation modal form elements - Task badges for supervisor and red team roles Co-Authored-By: Claude Opus 4.5 * Fix missing local_only field in TUI CreateContractRequest Add the missing local_only field to the CreateContractRequest struct initialization in the TUI contract creation handler. Co-Authored-By: Claude Opus 4.5 * [WIP] Heartbeat checkpoint - 2026-01-27 03:07:28 UTC --------- Co-authored-by: Claude Opus 4.5 --- makima/src/daemon/api/red_team.rs | 39 +++++++++++++++++++++++++++++++++++++++ 1 file changed, 39 insertions(+) create mode 100644 makima/src/daemon/api/red_team.rs (limited to 'makima/src/daemon/api/red_team.rs') diff --git a/makima/src/daemon/api/red_team.rs b/makima/src/daemon/api/red_team.rs new file mode 100644 index 0000000..6d3c969 --- /dev/null +++ b/makima/src/daemon/api/red_team.rs @@ -0,0 +1,39 @@ +//! Red team API methods. + +use serde::Serialize; +use uuid::Uuid; + +use super::client::{ApiClient, ApiError}; +use super::supervisor::JsonValue; + +/// Request body for red team notify endpoint. +#[derive(Serialize)] +#[serde(rename_all = "camelCase")] +pub struct RedTeamNotifyRequest { + /// The issue message + pub message: String, + + /// Severity level: low, medium, high, critical + pub severity: String, + + /// The specific task this relates to (optional) + #[serde(skip_serializing_if = "Option::is_none")] + pub related_task_id: Option, + + /// The file path where the issue was detected (optional) + #[serde(skip_serializing_if = "Option::is_none")] + pub file_path: Option, + + /// Additional context about the issue (optional) + #[serde(skip_serializing_if = "Option::is_none")] + pub context: Option, +} + +impl ApiClient { + /// Send a red team notification about an issue found during adversarial review. + /// + /// POST /api/v1/mesh/red-team/notify + pub async fn red_team_notify(&self, req: RedTeamNotifyRequest) -> Result { + self.post("/api/v1/mesh/red-team/notify", &req).await + } +} -- cgit v1.2.3