From 6cd5b20670d7ecd3d48539ff898e021988f2a503 Mon Sep 17 00:00:00 2001 From: soryu Date: Tue, 27 Jan 2026 01:05:25 +0000 Subject: Add Red Team adversarial review system for contract monitoring (#35) Implements a parallel "red team" task that monitors work task outputs in real-time, verifying implementations stick to contract requirements, repository standards, and the execution plan. Key features: - New `red_team_enabled` and `red_team_prompt` contract configuration - Red team tasks auto-spawn when first work task is created - `makima red-team notify` CLI command for alerting supervisors - POST /api/v1/mesh/red-team/notify and /status endpoints - Alert delivery to supervisor via SendMessage daemon command - Notification audit trail via history_events table Database changes: - Add red_team_enabled/red_team_prompt columns to contracts - Add is_red_team flag to tasks with partial index - Create red_team_notifications table for audit logging Co-authored-by: Claude Opus 4.5 --- makima/src/server/handlers/transcript_analysis.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'makima/src/server/handlers/transcript_analysis.rs') diff --git a/makima/src/server/handlers/transcript_analysis.rs b/makima/src/server/handlers/transcript_analysis.rs index 8eb50c7..3c283da 100644 --- a/makima/src/server/handlers/transcript_analysis.rs +++ b/makima/src/server/handlers/transcript_analysis.rs @@ -279,6 +279,8 @@ pub async fn create_contract_from_analysis( autonomous_loop: None, phase_guard: None, local_only: None, + red_team_enabled: None, + red_team_prompt: None, }; let contract = match repository::create_contract_for_owner(pool, auth.owner_id, contract_req).await { @@ -358,6 +360,7 @@ pub async fn create_contract_from_analysis( continue_from_task_id: None, copy_files: None, is_supervisor: false, + is_red_team: false, checkpoint_sha: None, priority: match item.priority.as_deref() { Some("high") => 10, @@ -531,6 +534,7 @@ pub async fn update_contract_from_analysis( continue_from_task_id: None, copy_files: None, is_supervisor: false, + is_red_team: false, checkpoint_sha: None, priority: 0, merge_mode: None, -- cgit v1.2.3