summaryrefslogtreecommitdiff
path: root/makima/src/db/repository.rs
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-29 01:10:43 +0000
committersoryu <soryu@soryu.co>2026-01-29 17:23:03 +0000
commitaef9c46c5608c8e455d49d31d790a4cc483706b9 (patch)
treeaf17139c38e362385b5b02160308817617d5b577 /makima/src/db/repository.rs
parentb07424f87185fd0e4ee3d5c472df70e5f575a259 (diff)
downloadsoryu-aef9c46c5608c8e455d49d31d790a4cc483706b9.tar.gz
soryu-aef9c46c5608c8e455d49d31d790a4cc483706b9.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'makima/src/db/repository.rs')
-rw-r--r--makima/src/db/repository.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/makima/src/db/repository.rs b/makima/src/db/repository.rs
index 1ab4165..9a1bf2d 100644
--- a/makima/src/db/repository.rs
+++ b/makima/src/db/repository.rs
@@ -2517,7 +2517,7 @@ pub async fn list_contracts_for_owner(
r#"
SELECT
c.id, c.name, c.description, c.contract_type, c.phase, c.status,
- c.supervisor_task_id, c.local_only, c.version, c.created_at,
+ c.supervisor_task_id, c.local_only, c.red_team_enabled, c.version, c.created_at,
(SELECT COUNT(*) FROM files WHERE contract_id = c.id) as file_count,
(SELECT COUNT(*) FROM tasks WHERE contract_id = c.id) as task_count,
(SELECT COUNT(*) FROM contract_repositories WHERE contract_id = c.id) as repository_count
@@ -2541,7 +2541,7 @@ pub async fn get_contract_summary_for_owner(
r#"
SELECT
c.id, c.name, c.description, c.contract_type, c.phase, c.status,
- c.supervisor_task_id, c.local_only, c.version, c.created_at,
+ c.supervisor_task_id, c.local_only, c.red_team_enabled, c.version, c.created_at,
(SELECT COUNT(*) FROM files WHERE contract_id = c.id) as file_count,
(SELECT COUNT(*) FROM tasks WHERE contract_id = c.id) as task_count,
(SELECT COUNT(*) FROM contract_repositories WHERE contract_id = c.id) as repository_count