feat: UI alignment - Agent Console, Citizens, MicroDAO Dashboard (TASK 2)

This commit is contained in:
Apple
2025-11-28 09:09:00 -08:00
parent 37e1c8abbe
commit acc06f41d3
12 changed files with 1063 additions and 463 deletions

View File

@@ -0,0 +1,40 @@
-- Delete Mock Citizens Script
-- This script marks mock/test citizens (agents) as deleted
-- Run with caution in production!
-- Preview: Show agents that would be affected
-- (agents without node_id or without primary_microdao_id, and not already marked as test)
SELECT id, display_name, kind, node_id, primary_microdao_id, is_public
FROM agents
WHERE (
node_id IS NULL
OR primary_microdao_id IS NULL
)
AND COALESCE(is_test, false) = false
AND COALESCE(is_archived, false) = false
AND deleted_at IS NULL;
-- Uncomment to execute soft delete:
-- UPDATE agents
-- SET
-- is_test = true,
-- deleted_at = NOW()
-- WHERE (
-- node_id IS NULL
-- OR primary_microdao_id IS NULL
-- )
-- AND COALESCE(is_test, false) = false
-- AND COALESCE(is_archived, false) = false
-- AND deleted_at IS NULL;
-- Verify: Count remaining active agents
SELECT
COUNT(*) as total_active_agents,
COUNT(*) FILTER (WHERE is_public = true) as public_citizens,
COUNT(*) FILTER (WHERE node_id IS NOT NULL) as agents_with_node,
COUNT(*) FILTER (WHERE primary_microdao_id IS NOT NULL) as agents_with_microdao
FROM agents
WHERE COALESCE(is_test, false) = false
AND COALESCE(is_archived, false) = false
AND deleted_at IS NULL;