Commit Graph

153 Commits

Author SHA1 Message Date
Apple
85a785bd86 fix(compose): use external postgres volume + city-service ENV
- docker-compose.yml: postgres uses microdao-daarion_postgres_data (external)
- docker-compose.yml: city-service connects to dagi-postgres:5432/daarion + NATS_URL
- docker-compose.city-space.yml: added dagi-postgres, dagi-nats as services
- docs/DEPLOY_ON_SERVER.md: added restart instructions without data loss

Closes TASK_PHASE_DOCKER_COMPOSE_CITY_SERVICE_POSTGRES
2025-11-30 06:58:02 -08:00
Apple
9d6428c6ee docs: add compose + node dashboard tasks 2025-11-30 06:51:46 -08:00
Apple
3e778e0f81 docs: MVP seed completed + orphan audit
- TASK_PHASE_MVP_SEED_REAL_ENTITIES: marked as completed
- TASK_PHASE_MVP_VERIFY_NO_ORPHANS: orphan verification task
- orphans_20251130.md: audit report with fixes applied

Fixes applied on NODE1:
- 13 governance agents now have DAIS identity
- 4 test agents now have home_microdao_id
- All 18 agents, 9 microDAOs, 23 rooms verified
2025-11-30 06:05:03 -08:00
Apple
4ccdb30159 feat: MVP seed real entities (RECOVERY)
- DAIS identities for all core agents
- City governance: DAARWIZZ, DARIO, DARIA
- District leads: SOUL, Helion, GREENFOOD
- District teams: Spirit, Logic, Energia
- Core agents: CLAN, DRUID, EONARCH, YAROMIR
- MicroDAOs: daarion (root), energyunion, greenfood, soul-retreat
- Agent assignments & permissions
- District rooms for SOUL, ENERGYUNION, GREENFOOD
2025-11-30 05:13:30 -08:00
Apple
aa7d831734 docs: add SOUL District Protocol v1 (Wellness/Retreat)
- SOUL as District Lead Agent
- Spirit (Guidance) + Logic (Information) AI agents
- Events, Masters, Locations, Guidance modules
- Node model for retreat centers
- 10 District Rooms
- XR/VR ready architecture
2025-11-30 04:59:17 -08:00
Apple
6864e1ce22 docs: add ENERGYUNION District Protocol + Nodes Interface Architecture UPDATE
- ENERGYUNION: DePIN/Energy/Compute District with Helion & Energia agents
- Nodes UPDATE: Unified node model (physical object + local brain + DAIS agent)
- No auto-created nodes - all nodes registered dynamically
2025-11-30 04:27:45 -08:00
Apple
39a01cf474 docs: add GREENFOOD District Protocol v1 (IndustryOps/Supply-Chain) 2025-11-30 02:46:58 -08:00
Apple
e078a24540 feat(city-service): add Governance, Audit, Incidents API endpoints
- Added repo_governance.py with database operations
- Added routes_governance.py (/api/v1/governance/*)
- Added routes_audit.py (/api/v1/audit/*)
- Added routes_incidents.py (/api/v1/incidents/*)
- Updated main.py to include new routers
2025-11-29 17:01:58 -08:00
Apple
ec9ff3e633 feat(governance): Migrate Governance Engine to Next.js (apps/web)
BREAKING: Replace old MicroDAO voting with Agent Governance Engine

## New Files
- apps/web/src/lib/types/governance.ts
- apps/web/src/lib/api/governance.ts
- apps/web/src/lib/api/audit.ts
- apps/web/src/lib/api/incidents.ts
- apps/web/src/components/governance/GovernanceLevelBadge.tsx
- apps/web/src/components/governance/ReportButton.tsx
- apps/web/src/components/governance/CityGovernancePanel.tsx
- apps/web/src/components/governance/AuditDashboard.tsx
- apps/web/src/components/governance/IncidentsList.tsx
- apps/web/src/app/audit/page.tsx
- apps/web/src/app/incidents/page.tsx

## Updated Files
- apps/web/src/app/governance/page.tsx - New City Governance UI
- apps/web/src/components/Navigation.tsx - Shield icon for Governance

## Task
docs/tasks/TASK_PHASE_GOVERNANCE_MIGRATION_NEXTJS.md
2025-11-29 16:41:28 -08:00
Apple
57749ac10c docs: Update TASK_PHASE_GOVERNANCE_ENGINE checklist 2025-11-29 16:06:45 -08:00
Apple
e233d32ae7 feat(governance): Governance Engine MVP implementation
- Backend:
  - Migration 032: agent_gov_level, status, incidents, permissions tables
  - Domain types for governance layer
  - Permission Engine with all governance checks
  - Governance Service (promote/demote/roles)
  - Revocation Service (revoke/suspend/reinstate)
  - Audit Service (events filtering and stats)
  - Incidents Service (create/assign/escalate/resolve)
  - REST API routes for governance, audit, incidents

- Frontend:
  - TypeScript types for governance
  - API clients for governance, audit, incidents
  - GovernanceLevelBadge component
  - CityGovernancePanel component
  - AuditDashboard component
  - IncidentsList component with detail modal

Based on: Agent_Governance_Protocol_v1.md
2025-11-29 16:02:06 -08:00
Apple
2627205663 feat(governance): Agent Governance Protocol v1 - Constitution of DAARION.city 2025-11-29 15:44:05 -08:00
Apple
93a736c8fc feat(dais): DAIS Layer Architecture v1
## DAIS = DAARION Agent Identity System

- Complete architecture document for agent identity
- DAIS Identity = паспорт + сім-карта + soulbound-token
- Trust Levels: guest → agent → verified → orchestrator → operator
- Keys: ed25519, x25519, secp256k1 (future: PQC)
- Wallet: Polygon, TON, Ethereum
- Lifecycle: Creation → Issuance → Keys → Wallet → Assignment → Execution → Promotion → Revocation

## Key concepts:
- Every agent = digital personality with DAIS
- DAIS connects all layers: City, District, MicroDAO, Nodes, Rooms
- Foundation for Governance and Permissions
- Web3/SIWE ready

Doc #14 in foundation series
2025-11-29 15:40:30 -08:00
Apple
0eec1c5171 feat(district): District Interface Architecture v1
## Documentation
- District_Interface_Architecture_v1.md - повна архітектура District Layer
- District Space, Campus Map, Sub-DAOs, Portals
- Золотий трикутник: City → District → MicroDAO

## Database
- Migration 028: District rooms for Energyunion & GREENFOOD
- Portal rooms on City Square

## Frontend
- src/api/districts.ts - Districts API client
- DistrictDashboard.tsx - District Dashboard UI component

## Key concepts:
- District = MicroDAO type='district'
- District Lead Agent (Helion, ERP-Agent)
- Campus Map (2D)
- Sub-DAOs management
- District-to-City portals
2025-11-29 15:36:48 -08:00
Apple
7b91c8e83c feat(foundation): FOUNDATION_UPDATE implementation
## Documentation (20 files)
- DAARION Ontology Core v1 (Agent → MicroDAO → Node → District)
- User Onboarding & Identity Layer (DAIS)
- Data Model UPDATE, Event Catalog, Governance & Permissions
- Rooms Layer, City/MicroDAO/Agents/Nodes Interface Architecture
- Helper files: ontology-summary, lifecycles, event-schemas

## Database Migration (027)
- DAIS tables: dais_identities, dais_emails, dais_wallets, dais_keys
- agent_assignments table for Assignment Layer
- rooms table for Rooms Layer
- event_outbox for NATS event delivery
- New enums: agent_role, microdao_type, node_kind, node_status, etc.
- Updated agents, microdaos, nodes tables with ontology fields

## Backend
- DAIS service & routes (/api/v1/dais/*)
- Assignment service & routes (/api/v1/assignments/*)
- Domain types for DAIS and Ontology

## Frontend
- Ontology types (Agent, MicroDAO, Node, DAIS, Assignments)
- API clients for DAIS and Assignments
- UI components: DaisProfileCard, AssignmentsPanel, OntologyBadge

Non-breaking update - all existing functionality preserved.
2025-11-29 15:24:38 -08:00
Apple
a6e531a098 fix: NODE1_REPAIR - healthchecks, dependencies, SSR env, telegram gateway
TASK_PHASE_NODE1_REPAIR:
- Fix daarion-web SSR: use CITY_API_BASE_URL instead of 127.0.0.1
- Fix auth API routes: use AUTH_API_URL env var
- Add wget to Dockerfiles for healthchecks (stt, ocr, web-search, swapper, vector-db, rag)
- Update healthchecks to use wget instead of curl
- Fix vector-db-service: update torch==2.4.0, sentence-transformers==2.6.1
- Fix rag-service: correct haystack imports for v2.x
- Fix telegram-gateway: remove msg.ack() for non-JetStream NATS
- Add /health endpoint to nginx mvp-routes.conf
- Add room_role, is_public, sort_order columns to city_rooms migration
- Add TASK_PHASE_NODE1_REPAIR.md and DEPLOY_NODE1_REPAIR.md docs

Previous tasks included:
- TASK 039-044: Orchestrator rooms, Matrix chat cleanup, CrewAI integration
2025-11-29 05:17:08 -08:00
Apple
0bab4bba08 feat: TASK 038 - Node Guardian & Steward Integration
- Backend: Added dynamic discovery of node agents in repo_city.py
- Backend: Created seed SQL for agent types
- Frontend: Added NodeGuardianCard component
- Frontend: Integrated NodeGuardianCard into Node Dashboard / Profile
2025-11-29 01:46:38 -08:00
Apple
3ccc0e2d43 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
2025-11-29 01:35:54 -08:00
Apple
3f41d0e0a2 feat: TASK 034-036 - MicroDAO Multi-Room Support
TASK 034: MicroDAO Multi-Room Backend
- Added migration 031_microdao_multi_room.sql
- Extended city_rooms with microdao_id, room_role, is_public, sort_order
- Added CityRoomSummary, MicrodaoRoomsList, MicrodaoRoomUpdate models
- Added get_microdao_rooms, get_microdao_rooms_by_slug functions
- Added attach_room_to_microdao, update_microdao_room functions
- Added API endpoints: GET/POST/PATCH /city/microdao/{slug}/rooms

TASK 035: MicroDAO Multi-Room UI
- Added proxy routes for rooms API
- Extended CityRoomSummary type with multi-room fields
- Added useMicrodaoRooms hook
- Created MicrodaoRoomsSection component with role labels/icons

TASK 036: MicroDAO Room Orchestrator Panel
- Created MicrodaoRoomsAdminPanel component
- Role selector, visibility toggle, set primary button
- Attach existing room form
- Integrated into /microdao/[slug] page
2025-11-29 01:07:15 -08:00
Apple
773a955ecc feat: TASK 031-033 - Node Guardian/Steward + Agent & MicroDAO Chat Widgets
TASK 031: Node Agents Discovery
- Documented existing Monitor agents (NODE1, NODE2)
- Created NODE_AGENTS_INVENTORY.md

TASK 032: Node Guardian/Steward Formalize
- Added migration 030_node_guardian_steward.sql
- Added is_node_guardian, is_node_steward to agents
- Added guardian_agent_id, steward_agent_id to node_cache
- Updated repo_city.py for guardian/steward in node queries
- Added NodeAgentsPanel component for Node Dashboard

TASK 033: Agent & MicroDAO Chat Widgets
- Added CityRoomSummary model
- Added primary_city_room to AgentDashboard API
- Added primary_city_room to MicrodaoDetail API
- Added get_microdao_primary_room() function
- Updated Agent Console with Matrix chat section
- Updated MicroDAO page with public chat section
- Reused existing CityChatWidget component
2025-11-28 13:51:51 -08:00
Apple
3426604209 fix: update proxy routes to use correct internal API URL 2025-11-28 10:48:11 -08:00
Apple
69cc76fe00 feat: implement Task 029 (Agent Orchestrator & Visibility Flow) 2025-11-28 10:19:13 -08:00
Apple
37e1c8abbe feat: align agent/microdao model - add is_orchestrator, is_platform, hierarchy 2025-11-28 08:34:14 -08:00
Apple
66d2c019ff docs: add data cleanup report 2025-11-28 08:18:23 -08:00
Apple
6f4270aa64 docs: update cleanup plan with final results - DAARION DAO has 51 agents 2025-11-28 05:50:54 -08:00
Apple
2a465b04c2 feat: add orphan agent finder script, update alignment doc with MicroDAO rule 2025-11-28 05:39:59 -08:00
Apple
9ad8f65636 feat: add is_archived flag, assign all agents to MicroDAOs, filter archived in API 2025-11-28 05:36:28 -08:00
Apple
04b1174641 docs: add DAARION_DAGI_ALIGNMENT.md - source of truth spec 2025-11-28 05:20:21 -08:00
Apple
41b23537c9 docs: add missing migrations and documentation (NODE2, DAIS, infra) 2025-11-28 05:18:45 -08:00
Apple
06d0cba7d4 feat: Citizens Layer + Citizen Interact Layer + CityChatWidget 2025-11-28 03:10:47 -08:00
Apple
2a6112fc42 Add Infra Automation Pack v1: docs infrastructure, logging stack, sync scripts 2025-11-27 09:29:42 -08:00
Apple
6bd769ef40 feat(city-map): Add 2D City Map with coordinates and agent presence
- Add migration 013_city_map_coordinates.sql with map coordinates, zones, and agents table
- Add /city/map API endpoint in city-service
- Add /city/agents and /city/agents/online endpoints
- Extend presence aggregator to include agents[] in snapshot
- Add AgentsSource for fetching agent data from DB
- Create CityMap component with interactive room tiles
- Add useCityMap hook for fetching map data
- Update useGlobalPresence to include agents
- Add map/list view toggle on /city page
- Add agent badges to room cards and map tiles
2025-11-27 07:00:47 -08:00
Apple
3de3c8cb36 feat: Add presence heartbeat for Matrix online status
- matrix-gateway: POST /internal/matrix/presence/online endpoint
- usePresenceHeartbeat hook with activity tracking
- Auto away after 5 min inactivity
- Offline on page close/visibility change
- Integrated in MatrixChatRoom component
2025-11-27 00:19:40 -08:00
Apple
78849cc108 feat: Add Global Presence Aggregator system
- GLOBAL_PRESENCE_AGGREGATOR_SPEC.md documentation
- matrix-presence-aggregator service (Python/FastAPI)
  - Matrix sync loop for presence/typing
  - NATS publishing for room presence
- city-service: presence_gateway for WS broadcast
- Frontend: real-time online count in room list
  - useGlobalPresence hook
  - Live typing indicators
  - Active room highlighting
2025-11-26 14:22:34 -08:00
Apple
a3e632b9e7 feat: Add PWA support
- PWA_MOBILE_SPEC.md documentation
- manifest.json with app metadata
- Service Worker with caching strategies
- Offline page
- PWA registration in layout
- App icons (placeholder)
2025-11-26 13:56:22 -08:00
Apple
573afec40f feat: Implement Matrix Presence & Typing indicators
- MATRIX_PRESENCE_TYPING_SPEC.md documentation
- MatrixRestClient: sync-loop with presence+typing events
- MatrixChatRoom: onlineUsers and typingUsers state
- UI: Show N online in header
- UI: Typing indicator with animation
- ChatInput: onTyping callback support
2025-11-26 13:32:51 -08:00
Apple
e9c04f6bcd feat: Implement Matrix Chat Client 2025-11-26 13:15:01 -08:00
Apple
984f67c26e feat: Implement Matrix Rooms Bridge
- MATRIX_ROOMS_BRIDGE_SPEC.md documentation
- Migration 012: Add matrix_room_id/alias to city_rooms
- Matrix Gateway service (port 7025)
- City-service: auto-create Matrix rooms on room creation
- Backfill endpoint for existing rooms
- API returns matrix_room_id/alias in room responses
2025-11-26 12:33:54 -08:00
Apple
5aaf6cbf21 feat: Add Auth Service with JWT authentication 2025-11-26 11:47:00 -08:00
Apple
0ca44dd799 docs: оновлено infrastructure_quick_ref.ipynb - Swapper Service замість Vision Encoder 2025-11-21 00:52:35 -08:00
Apple
e018b9ab68 feat: додано Node Registry, GreenFood, Monitoring та Utils 2025-11-21 00:35:41 -08:00
Apple
31f3602047 feat: оновлення інфраструктури з Node #2 та нові сервіси 2025-11-21 00:35:03 -08:00
Apple
4601c6fca8 feat: add Vision Encoder service + Vision RAG implementation
- Vision Encoder Service (OpenCLIP ViT-L/14, GPU-accelerated)
  - FastAPI app with text/image embedding endpoints (768-dim)
  - Docker support with NVIDIA GPU runtime
  - Port 8001, health checks, model info API

- Qdrant Vector Database integration
  - Port 6333/6334 (HTTP/gRPC)
  - Image embeddings storage (768-dim, Cosine distance)
  - Auto collection creation

- Vision RAG implementation
  - VisionEncoderClient (Python client for API)
  - Image Search module (text-to-image, image-to-image)
  - Vision RAG routing in DAGI Router (mode: image_search)
  - VisionEncoderProvider integration

- Documentation (5000+ lines)
  - SYSTEM-INVENTORY.md - Complete system inventory
  - VISION-ENCODER-STATUS.md - Service status
  - VISION-RAG-IMPLEMENTATION.md - Implementation details
  - vision_encoder_deployment_task.md - Deployment checklist
  - services/vision-encoder/README.md - Deployment guide
  - Updated WARP.md, INFRASTRUCTURE.md, Jupyter Notebook

- Testing
  - test-vision-encoder.sh - Smoke tests (6 tests)
  - Unit tests for client, image search, routing

- Services: 17 total (added Vision Encoder + Qdrant)
- AI Models: 3 (qwen3:8b, OpenCLIP ViT-L/14, BAAI/bge-m3)
- GPU Services: 2 (Vision Encoder, Ollama)
- VRAM Usage: ~10 GB (concurrent)

Status: Production Ready 
2025-11-17 05:24:36 -08:00
Apple
66f19cf499 feat: Add Helion AI agent for Energy Union
- Add Helion system prompt with 9 user modes
- Add /helion/telegram/webhook endpoint
- Add Helion configuration to docker-compose.yml
- Add HELION-QUICKSTART.md documentation
- Update .env.example with Helion variables

Helion provides technical support for EcoMiner/BioMiner, tokenomics (ENERGY, 1T, kWt), and DAO governance with RAG verification and 4-level compliance.
2025-11-16 09:30:09 -08:00
Apple
1ed1181105 feat: add RAG quality metrics, optimized prompts, and evaluation tools
Optimized Prompts:
- Create utils/rag_prompt_builder.py with citation-optimized prompts
- Specialized for DAO tokenomics and technical documentation
- Proper citation format [1], [2] with doc_id, page, section
- Memory context integration (facts, events, summaries)
- Token count estimation

RAG Service Metrics:
- Add comprehensive logging in query_pipeline.py
- Log: question, doc_ids, scores, retrieval method, timing
- Track: retrieval_time, total_query_time, documents_found, citations_count
- Add metrics in ingest_pipeline.py: pages_processed, blocks_processed, pipeline_time

Router Improvements:
- Use optimized prompt builder in _handle_rag_query()
- Add graceful fallback: if RAG unavailable, use Memory only
- Log prompt token count, RAG usage, Memory usage
- Return detailed metadata (rag_used, memory_used, citations_count, metrics)

Evaluation Tools:
- Create tests/rag_eval.py for systematic quality testing
- Test fixed questions with expected doc_ids
- Save results to JSON and CSV
- Compare RAG Service vs Router results
- Track: citations, expected docs found, query times

Documentation:
- Create docs/RAG_METRICS_PLAN.md
- Plan for Prometheus metrics collection
- Grafana dashboard panels and alerts
- Implementation guide for metrics
2025-11-16 05:12:19 -08:00
Apple
2fc1894b26 docs: add PARSER agent documentation and implementation plan
- Add formal PARSER agent description (dots.ocr-based)
- Add detailed TODO-PARSER-RAG.md with implementation tasks
- Update agents README to include PARSER
- PARSER = Document Ingestion & Structuring Agent for RAG
2025-11-15 13:09:58 -08:00
Ivan Tytar
36770c5c92 feat: DAARWIZZ v3 - production persona with full profile and system prompt
- Updated gateway-bot/daarwizz_prompt.txt with v3 system prompt
- Created docs/daarwizz/PROFILE.md with complete agent profile
- Defines DAARWIZZ as digital mayor and MoE coordinator
- Specifies communication style, roles, security policies
- Integration with full DAGI Stack (Router, DevTools, CrewAI, RBAC)
- Knowledge base references to official DAARION.city docs
2025-11-15 17:02:38 +01:00
Ivan Tytar
8b523977c7 docs: Add comprehensive DAARWIZZ documentation
Complete guide for DAARWIZZ AI agent:
- Personality and behavior guidelines
- Technical implementation details
- Message flow diagrams
- Example interactions (Ukrainian)
- Testing instructions
- Customization guide
- Future enhancements roadmap

Includes curl examples, Docker config, and monitoring metrics.
2025-11-15 15:33:04 +01:00
Ivan Tytar
244c6171a8 docs: Add repository index and workflow guide
- Complete repository structure overview
- Cursor + GitHub + Warp.dev workflow documentation
- Development cycle diagram
- Quick actions reference
- Key files listing

Helps developers navigate the codebase and understand the sync flow.
2025-11-15 14:47:46 +01:00
Ivan Tytar
7bacae6a89 Merge: Integrate DAGI Stack v0.2.0 with existing repository (secrets fixed) 2025-11-15 14:35:40 +01:00