Commit Graph

42 Commits

Author SHA1 Message Date
Apple
744c149300 Add automated session logging system
Some checks failed
Build and Deploy Docs / build-and-deploy (push) Has been cancelled
- Created logs/ structure (sessions, operations, incidents)
- Added session-start/log/end scripts
- Installed Git hooks for auto-logging commits/pushes
- Added shell integration for zsh
- Created CHANGELOG.md
- Documented today's session (2026-01-10)
2026-01-10 04:53:17 -08:00
Apple
c968705ec7 docs: Add task for completing branding banners MVP
- Add task to verify upload flow for banners
- Document fallback options for banner_url == null
- Add troubleshooting guide
- Document branding assets guide requirements
2025-12-02 09:13:38 -08:00
Apple
742c238b3b docs: Add manual test plan for assets proxy debugging 2025-12-02 09:00:35 -08:00
Apple
51571b3e61 docs: Add assets proxy fix report with HEAD method support 2025-12-02 08:51:23 -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
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
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
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
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
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
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
f5c58358a0 feat: add 'Додати ноду' button to Node Directory, create /nodes/register page, add node discovery script 2025-12-01 06:47:27 -08:00
Apple
e3accd4df0 feat: DAGI Router v2 - new endpoints, hooks, and UI card 2025-12-01 05:21:43 -08:00
Apple
d4e20ea513 feat: add MicroDAO branding and Agent avatar upload UI 2025-12-01 02:26:02 -08:00
Apple
281c79f916 feat: implement swapper metrics and node cabinet ui 2025-11-30 15:40:41 -08:00
Apple
fd814b2059 feat: implement Swapper metrics collection and UI 2025-11-30 15:12:49 -08:00
Apple
1830109a95 feat: Agent System Prompts MVP (B) - database, backend API, and frontend integration 2025-11-30 14:04:48 -08:00
Apple
bca81dc719 feat: Node Self-Healing, DAGI Audit, Agent Prompts, Infra Invariants
### Backend (city-service)
- Node Registry + Self-Healing API (migration 039)
- Improved get_all_nodes() with robust fallback for node_registry/node_cache
- Agent Prompts Runtime API for DAGI Router integration
- DAGI Router Audit endpoints (phantom/stale detection)
- Node Agents API (Guardian/Steward)
- Node metrics extended (CPU/GPU/RAM/Disk)

### Frontend (apps/web)
- Node Directory with improved error handling
- Node Cabinet with metrics cards
- DAGI Router Card component
- Node Metrics Card component
- useDAGIAudit hook

### Scripts
- check-invariants.py - deploy verification
- node-bootstrap.sh - node self-registration
- node-guardian-loop.py - continuous self-healing
- dagi_agent_audit.py - DAGI audit utility

### Migrations
- 034: Agent prompts seed
- 035: Agent DAGI audit
- 036: Node metrics extended
- 037: Node agents complete
- 038: Agent prompts full coverage
- 039: Node registry self-healing

### Tests
- test_infra_smoke.py
- test_agent_prompts_runtime.py
- test_dagi_router_api.py

### Documentation
- DEPLOY_CHECKLIST_2024_11_30.md
- Multiple TASK_PHASE docs
2025-11-30 13:52:01 -08:00
Apple
a7adddb60d feat: MicroDAO Rooms Integration
Backend:
- GET /city/microdao/{slug}/agents - list agents with roles
- Seed: 6 rooms for DAARION, 3+ rooms for each District

Task doc: TASK_PHASE_MICRODAO_ROOMS_INTEGRATION_v1.md
2025-11-30 11:48:44 -08:00
Apple
0fd05f678a feat: District Portals API (DB-based, no hardcodes)
Backend:
- GET /api/v1/districts - list all districts from DB
- GET /api/v1/districts/{slug} - district detail with lead agent, core team, rooms, nodes

repo_city methods:
- get_districts() - SELECT FROM microdaos WHERE dao_type='district'
- get_district_by_slug()
- get_district_lead_agent() - with fallback to orchestrator
- get_district_core_team()
- get_district_agents()
- get_district_rooms() - by slug prefix
- get_district_nodes()
- get_district_stats()

Task doc: TASK_PHASE_DISTRICT_PORTALS_v1.md
2025-11-30 11:37:56 -08:00
Apple
85fdcdf0be feat: City Rooms routing implementation
Backend:
- GET /api/v1/city/rooms - list all city rooms
- GET /api/v1/city/rooms/{slug} - get room by slug with host agents

Frontend:
- Updated /city/[slug] page with host agents section
- Added breadcrumb navigation
- Updated API client to fetch room by slug
- Added rewrite for /api/city/rooms/:slug

Task doc: TASK_PHASE_CITY_ROOMS_ROUTING_v1.md
2025-11-30 10:54:39 -08:00
Apple
3bfbd359fd feat: Presence Layer API implementation
Matrix Gateway:
- GET /internal/matrix/presence/{matrix_user_id} - get single user presence
- GET /internal/matrix/presence/bulk - get multiple users presence

City Service:
- GET /api/v1/agents/{agent_id}/presence - get agent presence via gateway
- get_matrix_presence_for_user() helper function

Task doc: TASK_PHASE_PRESENCE_LAYER_v1.md
2025-11-30 10:42:29 -08:00
Apple
ec57f7a596 feat: Add Chat API endpoints for Matrix integration
City Service:
- GET /api/v1/chat/rooms/{room_id}/messages - get message history
- POST /api/v1/chat/rooms/{room_id}/messages - send message
- Add get_room_by_id to repo_city

Synapse:
- Increase rate limits for room creation
- Add rc_joins, rc_invites configuration

All 27 rooms now have matrix_room_id
2025-11-30 10:34:27 -08:00
Apple
7108985b55 feat: Matrix Gateway integration for Rooms Layer
Matrix Gateway:
- Add POST /internal/matrix/room/join endpoint
- Add POST /internal/matrix/message/send endpoint
- Add GET /internal/matrix/rooms/{room_id}/messages endpoint

City Service:
- Add POST /rooms/sync/matrix endpoint for bulk sync
- Update get_agent_chat_room to auto-create Matrix rooms
- Update get_node_chat_room to auto-create Matrix rooms
- Update get_microdao_chat_room to auto-create Matrix rooms
- Add join_user_to_room, send_message_to_room, get_room_messages to matrix_client
- Add ensure_room_has_matrix helper function

This enables:
- Automatic Matrix room creation for all entity types
- chat_available = true when Matrix room exists
- Real-time messaging via Matrix
2025-11-30 10:12:27 -08:00
Apple
d264e7efc5 docs: add critical TASK_PHASE_ROOMS_LAYER_RESTORE_AND_MATRIX_INTEGRATION.md
Comprehensive task to fix Rooms Layer issues:
- City Rooms not loading in list view
- MicroDAO Rooms = 0
- Agent/Node Chat Rooms missing
- Citizens Layer = 0 citizens

Includes SQL seeds, API fixes, Matrix integration steps.
2025-11-30 09:43:10 -08:00
Apple
111d62a62a docs: add TASK_PHASE_AGENT_PRESENCE_INDICATORS_MVP.md
Task for implementing real-time presence indicators for all agents.
Shows Matrix presence (online/unavailable/offline) and DAGI router health.
Integrates into agent lists, cabinets, node dashboards, microdao dashboards.
2025-11-30 09:22:29 -08:00
Apple
fb4a33f016 docs: add TASK_PHASE_AGENT_CHAT_WIDGET_MVP.md
Task for implementing floating chat widget on agent/node/microdao pages.
Follows ontology rule: 'No page without agents means ability to talk to them directly.'

Scope:
- Backend: /chat-room API endpoints
- Frontend: AgentChatWidget.tsx component
- Integration: /agents/:agentId, /nodes/:nodeId, /microdao/:slug
2025-11-30 09:04:04 -08:00
Apple
644edd3f30 feat(mvp): DAGI Integration Fix - gov_level, DAIS, nodes table
TASK_PHASE_MVP_DAGI_INTEGRATION_FIX_20251201

A) Agents Layer:
- A1: Added gov_level to API and UI (list + profile)
- A2: Added dais_identity_id to API and UI
- A3: Added home_microdao_id/name/slug for ownership display

B) MicroDAO Layer:
- B1/B2: Already implemented (agents, rooms, citizens, district badge)

C) Nodes Layer:
- C1: Node Dashboard already implemented
- C2: Created nodes table migration with owner_microdao_id
- C3: INSERT NODE1/NODE2 with dao_daarion ownership

D) Backend Fixes:
- D1: Extended /api/agents/* with DAIS/governance fields
- D2/D3: Already implemented

Files changed:
- services/city-service/repo_city.py
- services/city-service/models_city.py
- services/city-service/routes_city.py
- services/city-service/migrations.py
- apps/web/src/lib/types/agents.ts
- apps/web/src/lib/agent-dashboard.ts
- apps/web/src/app/agents/page.tsx
- apps/web/src/components/agent-dashboard/AgentSummaryCard.tsx

Reports:
- docs/debug/mvp_dagi_integration_fix_report_20251201.md
- docs/tasks/TASK_PHASE_MVP_DAGI_INTEGRATION_FIX_20251201.md
2025-11-30 08:45:07 -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
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
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
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
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