Commit Graph

486 Commits

Author SHA1 Message Date
Apple
fd710da55d fix: Fix TypeScript errors in assets route and add banner_url to MicrodaoSummary 2025-12-02 09:03:35 -08:00
Apple
cf0b3feee0 fix: Add missing fetchMicrodaoDashboard export 2025-12-02 09:01:10 -08:00
Apple
742c238b3b docs: Add manual test plan for assets proxy debugging 2025-12-02 09:00:35 -08:00
Apple
d659f8fd32 fix: Fix Dockerfile COPY command for correct build context 2025-12-02 08:58:48 -08:00
Apple
bc4338f2c0 fix: Fix Dockerfile build context and ensure normalizeAssetUrl is used everywhere
- Fix Dockerfile to use correct paths (context is already apps/web)
- Ensure normalizeAssetUrl is used when setting preview URLs after upload
- This ensures all asset URLs go through the proxy
2025-12-02 08:58:34 -08:00
Apple
51571b3e61 docs: Add assets proxy fix report with HEAD method support 2025-12-02 08:51:23 -08:00
Apple
f19d5de52b fix: Add HEAD method support and fix proxy URL in Next.js assets route
- Add HEAD method handler in Next.js route
- Fix proxy URL to use correct city-service endpoint
- Handle HEAD requests properly (return headers only)
- This should fix 405 errors when browser checks image availability
2025-12-02 08:50:13 -08:00
Apple
62f03f0dad fix: Use api_route for HEAD method support in assets proxy 2025-12-02 08:48:13 -08:00
Apple
d13115e3b0 fix: Fix Request import for HEAD method support in assets proxy 2025-12-02 08:47:45 -08:00
Apple
192631c2eb fix: Add HEAD method support to assets proxy endpoint
- Add HEAD method handler for browser preflight requests
- Use stat_object for HEAD requests (more efficient)
- Return proper headers for HEAD requests
- This fixes 405 errors when browser checks image availability
2025-12-02 08:47:02 -08:00
Apple
55634eac9b docs: Add assets proxy debug report 2025-12-02 08:37:40 -08:00
Apple
1ca6a4f55a feat: Complete assets proxy implementation with documentation
- Add comprehensive documentation in docs/ASSETS_PROXY.md
- Add contract comments in normalizeAssetUrl and proxy_asset
- Verify all components use normalizeAssetUrl
- Verify ENV variables are correctly set
- Add troubleshooting guide
2025-12-02 08:36:55 -08:00
Apple
b49d7489ea fix: Use /api/city/assets/proxy/ for asset URLs instead of /api/assets/
- Change normalizeAssetUrl to use working city-service proxy endpoint
- This ensures assets work without assets.daarion.space DNS
2025-12-02 07:46:30 -08:00
Apple
517efc6a16 fix: Add API proxy for MinIO assets to work without assets.daarion.space DNS
- Add /api/assets/[...path] proxy route in Next.js
- Add /assets/proxy/{path} endpoint in city-service
- Update normalizeAssetUrl to convert assets.daarion.space URLs to /api/assets/...
- This allows assets to work even if DNS for assets.daarion.space is not configured
2025-12-02 07:43:36 -08:00
Apple
77d7b0b06d fix: Disable test agents (ag_atlas, ag_builder, ag_greeter, ag_oracle) in migration 013
- Comment out INSERT for test agents that keep reappearing
- These are not real agents and should not be created
- Real agents are managed through agents_city_mapping.yaml and sync scripts
2025-12-02 07:14:22 -08:00
Apple
fca48b3eb0 feat(node2): Complete NODE2 setup - guardian, agents, swapper models
- Node-guardian running on MacBook and updating metrics
- NODE2 agents (Atlas, Greeter, Oracle, Builder Bot) assigned to node-2-macbook-m4max
- Swapper models displaying correctly (8 models)
- DAGI Router agents showing with correct status (3 active, 1 stale)
- Router health check using node_cache for remote nodes
2025-12-02 07:07:58 -08:00
Apple
240ceba2e8 debug(node2): Change logging to WARNING level for router_healthy 2025-12-02 07:05:54 -08:00
Apple
50c0ac97dd debug(node2): Add logging for agent status determination 2025-12-02 07:05:16 -08:00
Apple
08cb8c52cc fix(node2): Add detailed logging for router_healthy determination 2025-12-02 07:03:50 -08:00
Apple
90ebf32de3 fix(node2): Fix router_healthy initialization in get_dagi_router_agents
- Initialize router_healthy as None instead of False
- Use bool() to ensure proper boolean conversion
- Add info logging for debugging
- This ensures cached router_healthy=True is properly used
2025-12-02 07:03:01 -08:00
Apple
88188ed693 fix(node2): Use node_cache router_healthy for DAGI Router agents status
- Fix get_dagi_router_agents to use router_healthy from node_cache first
- Fallback to direct API call only if cache is unavailable
- This fixes NODE2 agents showing as 'stale' when router is actually healthy
- Fix CITY_SERVICE_URL in scripts (remove /api/city, use /api)
2025-12-02 07:02:08 -08:00
Apple
80123fd1be feat(node2): Add scripts and docs for NODE2 guardian setup
- Add start-node2-guardian.sh script for easy launch
- Add setup-node2-agents.sh to update node_id for NODE2 agents
- Add NODE2_GUARDIAN_QUICKSTART.md with detailed instructions
- Update agents node_id to node-2-macbook-m4max
2025-12-02 06:59:48 -08:00
Apple
92d8efa5b3 fix(db): Add missing Swapper metrics columns to node_cache 2025-12-02 06:54:37 -08:00
Apple
ace183e136 feat: Add MicroDAO Dashboard with activity feed and statistics
- Add microdao_activity table for news/updates/events
- Add statistics columns to microdaos table
- Implement dashboard API endpoints
- Create UI components (HeaderCard, ActivitySection, TeamSection)
- Add seed data for DAARION DAO
- Update backend models and repositories
- Add frontend types and API client
2025-12-02 06:37:16 -08:00
Apple
95c9a17a7a fix(models): Add MicrodaoActivity and related classes to models_city 2025-12-02 03:21:20 -08:00
Apple
973b58f08f fix(city-service): Fix logger initialization order 2025-12-02 03:15:27 -08:00
Apple
f95810e8a7 fix(nodes): Normalize Router/Swapper endpoints and fix NODE2 display
Major changes:
- Normalize get_node_endpoints to use ENV vars (ROUTER_BASE_URL, SWAPPER_BASE_URL)
- Remove node_id-based URL selection logic
- Add fallback direct API call in get_node_swapper_detail
- Fix Swapper API endpoint (/models instead of /api/v1/models)
- Add router_healthy and router_version to node_heartbeat fallback
- Add ENV vars to docker-compose for Router/Swapper URLs

Documentation:
- Add TASK_PHASE_NODE2_ROUTER_SWAPPER_FIX.md with full task description
- Add NODE2_GUARDIAN_SETUP.md with setup instructions

This fixes:
- Swapper models not showing for NODE1 and NODE2
- DAGI Router agents not showing for NODE2
- Router/Swapper showing as Down/Degraded when they're actually up
2025-12-02 03:13:01 -08:00
Apple
5f07a6b3ae fix(nodes): Fix Swapper models and DAGI Router agents display for NODE2
- Fix get_node_endpoints to correctly determine URLs for NODE2 (localhost instead of Docker service names)
- Fix swapper detail endpoint to return fallback data instead of 404 when metrics not found
- This allows UI to show pending state instead of error for NODE2

Fixes:
- Swapper Service models not showing for NODE2
- DAGI Router agents not showing for NODE2
2025-12-02 02:49:02 -08:00
Apple
ceeb0faaf6 fix(nodes): Fix Swapper Service and DAGI Router display in node cabinets
- Move swapper-service from 'up' to 'healthy' list for NODE1
- Add dagi-router to healthy containers for NODE2
- Fix port parsing to handle 'host_port:container_port' format
- Improve service name formatting (swapper-service -> Swapper Service)
- Update statistics to reflect correct container counts
2025-12-02 02:42:13 -08:00
Apple
5061070d57 docs(assets): Add DNS setup and migration instructions 2025-12-02 02:14:07 -08:00
Apple
b79db5b2a4 feat(assets): Add NGINX config and migration scripts for MinIO assets
- Add NGINX reverse proxy config for assets.daarion.space
- Add script to migrate assets from /static/uploads to MinIO
- Add script to update asset URLs in database after migration
2025-12-02 02:11:26 -08:00
Apple
74ce1fcd4e fix(city-service): Use daarion-postgres instead of dagi-postgres 2025-12-02 02:07:29 -08:00
Apple
8c2f864795 feat(city-service): Add MinIO environment variables for asset storage 2025-12-02 02:03:24 -08:00
Apple
2a80c0be84 fix(migration): Use correct table name 'microdaos' instead of 'microdao' 2025-12-02 02:02:04 -08:00
Apple
d24a23ec96 fix(db-hardening): Add lib __init__.py and improve MinIO import error handling 2025-12-02 01:57:27 -08:00
Apple
8e8f95e9ef feat(db-hardening): Add database persistence, backups, and MinIO assets storage
Database Hardening:
- Add docker-compose.db.yml with persistent PostgreSQL volume
- Add automatic DB backups every 12h (7 days, 4 weeks, 6 months retention)
- Add MinIO S3-compatible storage for assets

Assets Migration:
- Add MinIO client (lib/assets_client.py) for upload/delete
- Update upload endpoint to use MinIO (with local fallback)
- Add migration 043_asset_urls_to_text.sql for full HTTPS URLs
- Simplify normalizeAssetUrl for S3 URLs

Recovery:
- Add seed_full_city_reset.py for emergency city recovery
- Add DB_RESTORE.md with backup restore instructions
- Add SEED_RECOVERY.md with recovery procedures
- Add INFRA_ASSETS_MINIO.md with MinIO setup guide

Task: TASK_PHASE_DATABASE_HARDENING_AND_ASSETS_MIGRATION_v1
2025-12-02 01:56:39 -08:00
Apple
0e743e5629 fix: restore microdao/agent logos and banner asset urls
- Enhanced normalizeAssetUrl to handle all edge cases
- Added normalizeAssetUrl to all avatar/logo/banner usages:
  - agents/page.tsx
  - agents/[agentId]/page.tsx
  - citizens/page.tsx
  - citizens/[slug]/page.tsx
  - MicrodaoAgentsSection.tsx
  - MicrodaoBrandingCard.tsx
  - AgentSummaryCard.tsx
  - AgentChatWidget.tsx

Task: TASK_PHASE_ASSET_BRANDING_HOTFIX_v1
2025-12-01 11:40:03 -08:00
Apple
dddf51affe feat(microdao-rooms): Add MicroDAO rooms creation/deletion and agent chat
Backend:
- POST /city/microdao/{slug}/rooms - create new room for MicroDAO
- DELETE /city/microdao/{slug}/rooms/{room_id} - soft-delete room
- POST /city/agents/{agent_id}/ensure-room - create personal agent room

Frontend:
- MicrodaoRoomsSection: Added create room modal with name, description, type
- MicrodaoRoomsSection: Added delete room functionality for managers
- Agent page: Added 'Поговорити' button to open chat in City Room

Models:
- Added CreateMicrodaoRoomRequest model

Task: TASK_PHASE_MICRODAO_ROOMS_AND_PUBLIC_CHAT_v3
2025-12-01 10:09:28 -08:00
Apple
2d730198d9 fix(citizens): Fix PublicCitizenSummary slug validation error
- Made slug optional in PublicCitizenSummary model
- Added fallback to agent id if public_slug is None
2025-12-01 09:37:48 -08:00
Apple
cc1704b70c fix(agents): Wrap NewAgentPage in Suspense for useSearchParams 2025-12-01 09:32:16 -08:00
Apple
6cd8148872 feat(agents): Add Create/Delete Agent functionality
Backend:
- Added POST /city/agents endpoint for creating agents
- Added DELETE /city/agents/{id} endpoint for soft-deleting agents
- Added CreateAgentRequest, CreateAgentResponse, DeleteAgentResponse models

Frontend:
- Added '+ Новий агент' button on /agents page
- Created /agents/new page with full agent creation form
- Added 'Видалити агента' button in agent Identity tab (Danger Zone)

Features:
- Auto-generate slug from display_name
- Support for all agent fields: kind, role, model, node, district, microdao
- Color picker for agent color
- Visibility toggles (is_public, is_orchestrator)
- Soft delete with confirmation dialog
2025-12-01 09:29:42 -08:00
Apple
649d07ee29 feat(rooms): Fix NaN online stats + Add DAARWIZZ CTA on homepage
- Fixed NaN in online stats by using nullish coalescing (?? 0)
- Added members_online, zone, room_type to /api/v1/city/rooms response
- Added DAARWIZZ chat CTA section on homepage with link to city-lobby
- Created task files for next phases:
  - TASK_PHASE_CITY_ROOMS_FINISH_v2.md
  - TASK_PHASE_AGENT_MANAGEMENT_v1.md
  - TASK_PHASE_CITIZENS_DIRECTORY_v1.md
2025-12-01 09:19:07 -08:00
Apple
a563ec86a0 fix(rooms): Use rewrite for /api/city/rooms instead of API route
- Removed API route that was conflicting with rewrite
- Added explicit rewrite for /api/city/rooms -> /api/v1/city/rooms
- Rewrite order matters: specific routes before wildcard
2025-12-01 08:52:59 -08:00
Apple
0039be5dc0 feat(rooms): Add city-lobby with DAARWIZZ + fix API proxy
- Created city-lobby room as main public chat with DAARWIZZ
- Fixed /api/city/rooms proxy to use correct backend path (/api/v1/city/rooms)
- Updated district rooms with zone keys (leadership, system, engineering, etc.)
- Set MicroDAO lobbies as primary rooms
- Created seed_city_rooms.py script
- Created TASK_PHASE_CITY_ROOMS_AND_PUBLIC_CHAT_v1.md

Total: 35 rooms, 31 public, 10 districts
2025-12-01 08:47:37 -08:00
Apple
2f8e471e03 feat(node2): Full DAGI integration - 50 agents synced
- Created sync-node2-dagi-agents.py script to sync agents from agents_city_mapping.yaml
- Synced 50 DAGI agents across 10 districts:
  - Leadership Hall (4): Solarius, Sofia, PrimeSynth, Nexor
  - System Control (6): Monitor, Strategic Sentinels, Vindex, Helix, Aurora, Arbitron
  - Engineering Lab (5): ByteForge, Vector, ChainWeaver, Cypher, Canvas
  - Marketing Hub (6): Roxy, Mira, Tempo, Harmony, Faye, Storytelling
  - Finance Office (4): Financial Analyst, Accountant, Budget Planner, Tax Advisor
  - Web3 District (5): Smart Contract Dev, DeFi Analyst, Tokenomics Expert, NFT Specialist, DAO Governance
  - Security Bunker (7): Shadelock, Exor, Penetration Tester, Security Monitor, Incident Responder, Shadelock Forensics, Exor Forensics
  - Vision Studio (4): Iris, Lumen, Spectra, Video Analyzer
  - R&D Lab (6): ProtoMind, LabForge, TestPilot, ModelScout, BreakPoint, GrowCell
  - Memory Vault (3): Somnia, Memory Manager, Knowledge Indexer
- Fixed Swapper config to use swapper_config_node2.yaml with 8 models
- Created TASK_PHASE_NODE2_FULL_DAGI_INTEGRATION_v1.md

NODE2 now shows:
- 50 agents in DAGI Router Card
- 8 models in Swapper Service (gpt-oss, phi3, starcoder2, mistral-nemo, gemma2, deepseek-coder, qwen2.5-coder, deepseek-r1)
- Full isolation from NODE1
2025-12-01 08:31:25 -08:00
Apple
a818f2ac2f feat: add router health metrics to node_cache and node-guardian
- Add migration 042_node_cache_router_metrics.sql
- Node guardian now collects router health and sends in heartbeat
- City-service uses cached router_healthy from node_cache
- This allows NODE2 router status to be displayed correctly
2025-12-01 08:03:46 -08:00
Apple
9b9a72ffbd feat: full node isolation - use node-specific swapper_url and router_url from DB
- Add migration 041_node_local_endpoints.sql
- Add get_node_endpoints() to repo_city.py
- Update routes_city.py to use DB endpoints instead of hardcoded URLs
- Update node-guardian-loop.py to use NODE_SWAPPER_URL/NODE_ROUTER_URL env vars
- Update launchd plist for NODE2 with router URL
2025-12-01 08:01:53 -08:00
Apple
b25e002db6 feat: add logging for node isolation debugging in node-guardian 2025-12-01 07:35:37 -08:00
Apple
31c4da2b54 fix: add is_pinned and pinned_weight to MicrodaoSummary model and API 2025-12-01 07:28:02 -08:00
Apple
ce973b2b38 feat: add MicroDAO pinning - 4 platform districts always on top 2025-12-01 07:26:35 -08:00