- Added knowledge router import from contexts.knowledge.routers.knowledge
- Included router with /v1 prefix for API versioning consistency
- Added error handling and logging for router initialization
- Positioned before marketplace_offers router in initialization order
- Added /v1 prefix to all business logic routers in coordinator-api (analytics, portfolio, reputation, rewards, staking)
- Updated agent-coordinator to include /v1 prefix for all routers
- Changed agent-management API prefix from /api/v1 to /v1
- Updated api-gateway service prefixes to include /v1 for all proxied services
- Fixed coordinator-api routers to use correct service imports (AgentServiceMarketplace instead
- Changed bid_data provider from .get('wallet', 'unknown') to .get('wallet') or 'unknown'
- Ensures None values from get() are properly handled with fallback to 'unknown'
- Changed monitor.py job endpoints from /jobs to /v1/jobs
- Changed monitor.py miner endpoints from /miners to /v1/miners
- Changed operations.py agent discovery from /agents/discover to /v1/agents/discover
- Changed system.py agent endpoints from /agents/* to /v1/agents/*
- Updated agent status, registration, discovery, and retrieval endpoints
- Aligns CLI with coordinator-api versioning structure for business logic endpoints
- Changed all coordinator service port references from 9001 to 8011 in CI workflows
- Updated PYTHONPATH references from apps/agent-coordinator to apps/coordinator-api
- Renamed log files from agent-coordinator.log to coordinator-api.log
- Updated step names and comments to use "coordinator API" instead of "agent coordinator"
- Added API versioning documentation explaining /v1 prefix structure for business logic endpoints
- Documented CLI compatibility routes (/api/v1) and infrastructure endpoints (no prefix)
- Updated architecture
- Added in-memory state dictionaries (_mock_nodes, _mock_tasks, _mock_agents, _mock_messages, _mock_jobs)
- Updated swarm endpoints to persist and retrieve node/task data from mock state
- Updated hermes endpoints to persist and retrieve agent/message data from mock state
- Updated training endpoints to persist and retrieve job data from mock state
- Added auto-incrementing counters for task, message, and job IDs
- Fixed hermes message
- Added RegisterNodeRequest, ReportTaskRequest, CreateClusterRequest models
- Implemented POST /nodes/register endpoint for compute node registration
- Implemented POST /nodes/{node_id}/heartbeat endpoint for node health checks
- Implemented GET /nodes endpoint with status and capability filters
- Implemented GET /nodes/{node_id} endpoint for node details
- Implemented POST /tasks/submit endpoint for task submission
- Implemented POST
- Added balance tracker initialization in blockchain node startup
- Created CrossChainTransfer and Stake database models
- Implemented GET /accounts/{address} endpoint for account details
- Implemented POST /register-account endpoint for account creation
- Implemented POST /faucet endpoint with rate limiting (10/hour) and auto-account creation
- Implemented bridge endpoints:
- POST /bridge/lock to initiate cross-chain transfers
-
- Added MockFHEProvider class for testing without TenSEAL/Concrete ML
- Changed FHEService initialization to always have mock provider as default fallback
- Updated TenSEALProvider and ConcreteMLProvider to gracefully handle missing dependencies
- Added availability checks to all providers (self.available flag)
- Fixed type hints to use Optional and Dict for Python 3.9+ compatibility
- Fixed TenSEAL API calls (ckks_vector/bfv_vector instead of ckks_tensor/b
- Changed all session.exec(stmt).first() to session.execute(stmt).scalars().first()
- Changed all session.exec(stmt).all() to session.execute(stmt).scalars().all()
- Updated count() queries to use execute().scalar() pattern
- Fixed request.metadata to request.meta_data in AgentIdentityCore
- Removed unused __table_args__ from AgentIdentity model
- Added detailed error traceback to create_agent_identity endpoint
- Fixed ML ZK proof verification response keys (computation_correct, privacy_preserved)
- Fixed DB query issues in bridge_enhanced.py (scalars().first() instead of first())
- Created MultiChainTransaction database model for transaction persistence
- Updated MultiChainTransactionManager to use database persistence:
- Removed in-memory queues (transaction_queues, priority_queues)
- Updated submit_transaction to save to database
- Updated get_transaction_status to query database
- Updated cancel_transaction to update database
- Updated get_transaction_history to query database
- Updated get_transaction_statistics to query database
- Disabled background processing (replaced with database queries)
- Updated helper methods to work with database model
- Fixed import errors and naming conflicts
- Renamed metadata field to meta_data (SQLAlchemy reserved name)
- Updated cross_chain_integration.py imports
Fixed parameter naming conflict in swarm router where 'request' parameter
was shadowed by FastAPI's HTTP Request object. Renamed body parameters to
'body' and Request parameters to 'http_request'.
Also fixed consensus endpoint which was accessing request.consensus_threshold
instead of request_consensus.consensus_threshold.
All swarm endpoints now work: join, coordinate, status, consensus, leave.
Bug: achieve_consensus endpoint was trying to access request.consensus_threshold
but the parameter is named request_data (type ConsensusRequest), causing AttributeError.
Fix: Changed request.consensus_threshold to request_data.consensus_threshold
in apps/coordinator-api/src/app/contexts/agent_coordination/routers/swarm.py
Service restarted: aitbc-coordinator-api
The leave endpoint was returning 503 due to RequestLoggingMiddleware
catching HTTPException. Fixed by adding 'except HTTPException: raise'
before the generic except block in the middleware.
All island operations now work: join, list, get, bridge, leave.
The middleware was catching all exceptions including HTTPException
and returning a generic 503 'Internal server error', masking the real
error details. Added 'except HTTPException: raise' before the generic
except block so HTTPExceptions propagate correctly with their original
status code and detail message.
Also removed debug logging from leave_island handler.
Plugin model:
- Renamed 'metadata' field to 'plugin_metadata'
- 'metadata' is reserved in SQLAlchemy Declarative API
- Updated database column: ALTER TABLE plugin RENAME COLUMN metadata TO plugin_metadata
Fixes marketplace service startup error
Marketplace service:
- Added Plugin model to database schema (id, name, description, author, type, version, ipfs_cid, metadata, status, created_at, updated_at, download_count, rating)
- Added list_plugins() service method with type and status filters
- Added register_plugin() service method
- Updated GET /v1/marketplace/plugins to use database instead of mock data
- Added POST /v1/marketplace/plugins endpoint for plugin registration
- Created plugin table in aitbc_marketplace database
Replaces mock plugin data with real database-backed plugin marketplace
Marketplace service:
- Changed provider field to nullable in MarketplaceOffer model
- Removed default-provider logic since router has no auth context
- Allows offer creation without provider when auth not available
Blockchain node:
- Modified _validate_agent to auto-register agents on first message post
- Fixes INVALID_AGENT error when posting messages without prior registration
- Allows testing/demo workflows to post messages without manual agent setup
- Fix IPFS storage service: handle session=True response format (CID string vs dict)
- Fix metadata cache: use in-memory dict instead of no-op pass
- Fix IPFS router: use singleton pattern for service instance
- Fix IPFS cat: use POST method instead of GET
- Add _metadata_cache initialization to IPFSStorageService
- Coordinator IPFS upload/retrieve now fully functional with integrity verification
Blockchain Node:
- Added asyncio.create_task(island_manager.start()) to start background tasks
- Updated log message to indicate manager is started, not just initialized
Coordinator API:
- Added portfolio_router to main app
- Made IPFS initialization more resilient to version incompatibilities
- Added session=True to ipfshttpclient.connect() call
- Changed IPFS init errors from raise to warnings with graceful degradation
- Added None checks
Coordinator API:
- Added Query() decorator to chain_id parameter
- Fixes validation error: Field required for chain_id
- chain_id is a query parameter, not a path parameter
Coordinator API:
- Changed datetime.now(UTC) to datetime.now(timezone.utc)
- Fixes NameError: name 'UTC' is not defined
- File already imports timezone, just needed to use it correctly
Coordinator API:
- Changed ipfshttpclient and web3 imports to optional
- Service now starts without IPFS/Web3 dependencies
- Logs warning instead of raising ImportError
- IPFS features disabled when dependencies not available
Coordinator API:
- Created secure_pickle.py module with safe_loads function
- Implements safe deserialization with size limits
- Added compute_integrity_hash for data verification
- Fixes ModuleNotFoundError: No module named 'app.services.secure_pickle'
The secure_pickle module was missing but imported by:
- ipfs_storage_service.py
- translation_cache.py
Coordinator API:
- Fixed import path in ipfs.py from ...services to ....services
- File is in contexts/ipfs/routers/, needs 4 dots to reach services/
- Corrected both services and config imports
This fixes ModuleNotFoundError: No module named 'app.contexts.services'
Coordinator API:
- Changed FHEService from module-level instantiation to lazy loading
- Added get_fhe_service() function to instantiate on first use
- Updated fhe_ml_inference endpoint to use lazy-loaded service
- Prevents import-time Concrete ML errors on Python 3.13
Concrete ML requires Python <3.13, but current version is 3.13.5.
The FHEService gracefully handles the ImportError, but the module-level
instantiation was causing the error during app startup. Lazy loading
defers the instantiation until the endpoint is actually called.
Edge API:
- Implemented metrics service to record and retrieve edge metrics
- Implemented metrics router endpoints (record, list, get, delete)
- Fixed datetime timezone issues for PostgreSQL compatibility
- Updated EdgeMetrics schema to match service implementation
- Dropped and recreated edge_metrics table to fix schema mismatch
Working endpoints:
- POST /v1/metrics/ - Record metrics
- GET /v1/metrics/ - List metrics
- GET /v1/metrics/{metric_id} - Get metric details
- DELETE /v1/metrics/{metric_id} - Delete metric
All Edge API phases (1-6) now complete
Edge API:
- Implemented serve service to manage compute requests
- Implemented serve router endpoints (submit, list, get, cancel, result)
- Fixed datetime timezone issues for PostgreSQL compatibility
- Updated ComputeRequest schema to match service implementation
- Dropped and recreated compute_requests table to fix schema mismatch
Working endpoints:
- POST /v1/serve/requests - Submit compute request
- GET /v1/serve/requests - List compute requests
- GET /v1/serve/requests/{request_id} - Get request details
- POST /v1/serve/requests/{request_id}/cancel - Cancel request
- GET /v1/serve/requests/{request_id}/result - Get result
Edge API:
- Implemented GPU service client to call existing GPU service endpoints
- Implemented GPU service to store GPU listings in database
- Implemented GPU router endpoints (list, get, remove, scan, metrics)
- GPU service already has necessary endpoints (profiles, scan, metrics)
Testing:
- Edge API GPU endpoints working on port 8103
- List GPUs returns empty list (expected - no GPUs registered)
Blockchain Node RPC:
- Added island management endpoints (join, leave, list, get, bridge)
- Initialized island manager in RPC service lifespan
- Fixed create_backend call signature
Edge API:
- Implemented blockchain RPC client with island operations
- Implemented island service to call RPC and store in database
- Implemented island router endpoints with proper request models
Testing:
- Blockchain RPC island endpoints working on port 8006
- Edge API island endpoints working on port 8103
- Both services successfully return island data
- Implement full DatabaseService with init, get, delete, sync, and list operations
- Add database CRUD operations with SQLAlchemy queries and proper error handling
- Add UUID-based database_id generation and status tracking (initialized, syncing, idle, error)
- Add capacity management (capacity_gb, used_gb) and sync metadata (last_sync_at, records_synced)
- Update database router with Query parameters and HTTPException error handling
- Support filtering by island_id or database_id in get_edge_database endpoint
- Add list_all_databases method
- Created edge-api service structure with FastAPI application
- Implemented all schema files (island, gpu, database, serve, metrics)
- Created router stub files for all modules
- Created service stub files for all modules
- Created client stub files (blockchain RPC, GPU service)
- Configured PostgreSQL database (aitbc_edge) with proper permissions
- Fixed SQLAlchemy reserved name conflict (metadata -> extra_data)
- Changed port to 8103 to avoid conflicts
- Service runs successfully on port 8103
- Health endpoint tested and working
- Created systemd service file
- Created README.md with documentation
- Make seed_profiles async to match AsyncSession and await session operations
- Disable aitbc-gpu.service to resolve port 8101 conflict with gpu-service
- GPU service now runs successfully without coroutine warnings