summaryrefslogtreecommitdiff
path: root/makima/migrations/20260126010001_add_red_team_to_tasks.sql
diff options
context:
space:
mode:
authorsoryu <soryu@soryu.co>2026-01-27 01:05:25 +0000
committerGitHub <noreply@github.com>2026-01-27 01:05:25 +0000
commit6cd5b20670d7ecd3d48539ff898e021988f2a503 (patch)
tree0232ecd8411b01db07230f8ea2003cbbcdc070a6 /makima/migrations/20260126010001_add_red_team_to_tasks.sql
parent64cc98783d067625d633eea1142d114e324f76bb (diff)
downloadsoryu-6cd5b20670d7ecd3d48539ff898e021988f2a503.tar.gz
soryu-6cd5b20670d7ecd3d48539ff898e021988f2a503.zip
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 <noreply@anthropic.com>
Diffstat (limited to 'makima/migrations/20260126010001_add_red_team_to_tasks.sql')
-rw-r--r--makima/migrations/20260126010001_add_red_team_to_tasks.sql9
1 files changed, 9 insertions, 0 deletions
diff --git a/makima/migrations/20260126010001_add_red_team_to_tasks.sql b/makima/migrations/20260126010001_add_red_team_to_tasks.sql
new file mode 100644
index 0000000..cb21405
--- /dev/null
+++ b/makima/migrations/20260126010001_add_red_team_to_tasks.sql
@@ -0,0 +1,9 @@
+-- Add red team flag to tasks
+ALTER TABLE tasks
+ADD COLUMN is_red_team BOOLEAN NOT NULL DEFAULT FALSE;
+
+-- Index for efficient red team task lookup per contract
+CREATE INDEX idx_tasks_contract_red_team ON tasks(contract_id, is_red_team)
+WHERE is_red_team = TRUE;
+
+COMMENT ON COLUMN tasks.is_red_team IS 'Whether this is a red team monitoring task';