From aef9c46c5608c8e455d49d31d790a4cc483706b9 Mon Sep 17 00:00:00 2001 From: soryu Date: Thu, 29 Jan 2026 01:10:43 +0000 Subject: Fix Red Team UI visibility by adding red_team_enabled to ContractSummary The Red Team toggle was implemented in the frontend but not visible because the backend API's ContractSummary response struct was missing the red_team_enabled field. The frontend relies on this field to: 1. Show the red team badge in the contract list view 2. Show the red team badge and tab in the contract detail view Changes: - Add red_team_enabled field to ContractSummary struct in models.rs - Update list_contracts_for_owner SQL query to include red_team_enabled - Update get_contract_summary_for_owner SQL query to include red_team_enabled - Update all fallback ContractSummary constructions in contracts.rs handler Co-Authored-By: Claude Opus 4.5 --- makima/src/server/handlers/contracts.rs | 4 ++++ 1 file changed, 4 insertions(+) (limited to 'makima/src/server/handlers/contracts.rs') diff --git a/makima/src/server/handlers/contracts.rs b/makima/src/server/handlers/contracts.rs index 7ed84e3..9979c1f 100644 --- a/makima/src/server/handlers/contracts.rs +++ b/makima/src/server/handlers/contracts.rs @@ -369,6 +369,7 @@ pub async fn create_contract( status: contract.status, supervisor_task_id: contract.supervisor_task_id, local_only: contract.local_only, + red_team_enabled: contract.red_team_enabled, file_count: 0, task_count: 0, repository_count: 0, @@ -391,6 +392,7 @@ pub async fn create_contract( status: contract.status, supervisor_task_id: contract.supervisor_task_id, local_only: contract.local_only, + red_team_enabled: contract.red_team_enabled, file_count: 0, task_count: 0, repository_count: 0, @@ -520,6 +522,7 @@ pub async fn update_contract( status: contract.status, supervisor_task_id: contract.supervisor_task_id, local_only: contract.local_only, + red_team_enabled: contract.red_team_enabled, file_count: 0, task_count: 0, repository_count: 0, @@ -1405,6 +1408,7 @@ pub async fn change_phase( status: updated_contract.status, supervisor_task_id: updated_contract.supervisor_task_id, local_only: updated_contract.local_only, + red_team_enabled: updated_contract.red_team_enabled, file_count: 0, task_count: 0, repository_count: 0, -- cgit v1.2.3