feat: TASK 037A/B - MicroDAO Multi-Room Cleanup & UI Polish
TASK 037A: Backend Consistency - Added db/sql/037_microdao_agent_audit.sql - Added services/city-service/tools/fix_microdao_agent_consistency.py - Updated repo_city.get_public_citizens with stricter filtering (node_id, microdao_membership) - Updated PublicCitizenSummary model to include home_microdao and primary_city_room - Updated NodeProfile model and get_node_by_id to include microdaos list TASK 037B: UI Polish - Updated MicrodaoRoomsSection with role-based colors/icons and mini-map - Updated /microdao/[slug] with new Hero Block (badges, stats, orchestrator) - Updated /citizens/[slug] with MicroDAO cross-link in DAIS profile - Updated /nodes/[nodeId] with MicroDAO Presence section
This commit is contained in:
40
db/sql/037_microdao_agent_audit.sql
Normal file
40
db/sql/037_microdao_agent_audit.sql
Normal file
@@ -0,0 +1,40 @@
|
||||
-- Публічні агенти без microDAO
|
||||
SELECT id, display_name, node_id, is_public, public_slug
|
||||
FROM agents
|
||||
WHERE is_public = true
|
||||
AND (id NOT IN (
|
||||
SELECT agent_id FROM microdao_agents
|
||||
));
|
||||
|
||||
-- Публічні агенти без node_id
|
||||
SELECT id, display_name, is_public, public_slug
|
||||
FROM agents
|
||||
WHERE is_public = true
|
||||
AND (node_id IS NULL OR node_id = '');
|
||||
|
||||
-- Публічні агенти без public_slug
|
||||
SELECT id, display_name, is_public
|
||||
FROM agents
|
||||
WHERE is_public = true
|
||||
AND (public_slug IS NULL OR public_slug = '');
|
||||
|
||||
-- Кімнати без microDAO, але з matrix_room_id (кандидати на привʼязку)
|
||||
SELECT id, slug, name, matrix_room_id
|
||||
FROM city_rooms
|
||||
WHERE microdao_id IS NULL
|
||||
AND matrix_room_id IS NOT NULL;
|
||||
|
||||
-- MicroDAO без жодної кімнати
|
||||
SELECT m.id, m.slug, m.name
|
||||
FROM microdaos m
|
||||
LEFT JOIN city_rooms r ON r.microdao_id = m.id
|
||||
GROUP BY m.id, m.slug, m.name
|
||||
HAVING COUNT(r.id) = 0;
|
||||
|
||||
-- MicroDAO з кількома primary-кімнатами
|
||||
SELECT m.slug, COUNT(*)
|
||||
FROM city_rooms r
|
||||
JOIN microdaos m ON m.id = r.microdao_id
|
||||
WHERE r.room_role = 'primary'
|
||||
GROUP BY m.slug
|
||||
HAVING COUNT(*) > 1;
|
||||
Reference in New Issue
Block a user