Commit Graph

64 Commits

Author SHA1 Message Date
oib
15427c96c0 chore: update file permissions to executable across repository
- Change file mode from 644 to 755 for all project files
- Add chain_id parameter to get_balance RPC endpoint with default "ait-devnet"
- Rename Miner.extra_meta_data to extra_metadata for consistency
2026-03-06 22:17:54 +01:00
oib
c8ee2a3e6e feat: implement role-based configuration system for CLI with automatic API key management
- Add role detection to command groups (admin, client, miner, blockchain)
- Load role-specific config files (~/.aitbc/{role}-config.yaml)
- Add role field to Config class with environment variable support
- Implement automatic role detection from invoked subcommand
- Add development mode API key bypass for testing (APP_ENV=dev)
- Update CLI checklist with role-based configuration documentation
- Add configuration override priority and
2026-03-05 14:02:51 +01:00
oib
83b5152b40 fix: add debug logging to admin API key validation and re-enable all routers
- Add debug print statements to _validate_api_key and require_admin_key for troubleshooting
- Add /admin/debug-settings and /admin/test-key endpoints for API key validation testing
- Bypass require_admin_key dependency in /admin/stats endpoint for direct validation
- Fix database warmup to properly handle session generator lifecycle
- Re-enable all previously disabled routers in main.py
- Add custom OpenAPI security scheme
2026-03-05 13:44:37 +01:00
oib
0c090c96fa fix: temporarily disable routers to isolate Pydantic validation issue and add agent endpoints to working routers
- Comment out most routers in main.py to isolate Pydantic issue
- Keep only blockchain router enabled for testing
- Fix database warmup to use get_session() instead of SessionDep()
- Add blockchain router to __init__.py exports
- Add test endpoint to agent_router for verification
- Duplicate agent network and execution receipt endpoints in client and exchange routers as temporary workaround
2026-03-05 12:57:40 +01:00
oib
40cf275985 fix: add missing API endpoints for CLI compatibility
- Add /v1/admin/status endpoint for system status
- Add /v1/blockchain/status endpoint for blockchain status
- Add /v1/blockchain/sync-status endpoint for sync status
- Add /v1/monitor/dashboard endpoint for monitoring dashboard
- Fix router imports and missing dependencies
- Handle optional dependencies gracefully (torch, tenseal)
- Update admin router with comprehensive system status endpoint
- Fix blockchain router endpoint paths
- Improve error handling in monitoring dashboard

These endpoints resolve CLI 404/405 errors reported in testing.
2026-03-05 12:42:01 +01:00
oib
efd85060db fix: change miner authentication to use separate X-Miner-ID header instead of API key for miner identification
- Add get_miner_id() dependency to extract miner ID from X-Miner-ID header
- Update miner register and heartbeat endpoints to require both X-Miner-ID and X-Api-Key headers
- Remove miner_id from query parameters in favor of header-based extraction
- Fix miner heartbeat CLI to send proper JSON payload with inflight, status, and metadata fields
- Fix typo in MinerService: extra_metadata → extra_meta_data
2026-03-05 12:28:17 +01:00
oib
80b9ea4b25 feat: add miner management endpoints and standardize all API paths to /api/v1 prefix
- Add POST /api/v1/miners/{miner_id}/jobs endpoint for listing miner-assigned jobs with filtering
- Add POST /api/v1/miners/{miner_id}/earnings endpoint for miner earnings tracking (mock implementation)
- Add PUT /api/v1/miners/{miner_id}/capabilities endpoint for updating miner capabilities
- Add DELETE /api/v1/miners/{miner_id} endpoint for miner deregistration (sets OFFLINE status)
- Add JobService.fail_job()
2026-03-05 11:12:57 +01:00
oib
c2d4f39a36 feat: add blockchain info endpoints and client job filtering capabilities
- Add /rpc/info endpoint to blockchain node for comprehensive chain information
- Add /rpc/supply endpoint for token supply metrics with genesis parameters
- Add /rpc/validators endpoint to list PoA validators and consensus info
- Add /api/v1/agents/networks endpoint for creating collaborative agent networks
- Add /api/v1/agents/executions/{id}/receipt endpoint for verifiable execution receipts
- Add /api/v1/jobs and /api/v1/jobs/
2026-03-05 10:55:19 +01:00
oib
1f16a1c406 fix: resolve SQLModel migrations for .exec() -> .execute().scalars() and API schema issues 2026-03-05 08:28:40 +01:00
oib
4be6f8d5d9 Fix Concrete ML compatibility issue and improve FHE service logging
- Update requirements.txt to make concrete-ml optional with clear comment
- Enhance FHE service warning message to include Python version info
- Remove concrete-ml from mandatory dependencies due to Python 3.13 incompatibility
- Maintain full functionality with TenSEAL provider as default

This resolves the 'Concrete ML not installed' warning by providing clear
information about the version compatibility issue while preserving all
FHE functionality through the TenSEAL provider.
2026-03-05 08:13:45 +01:00
oib
51c1993410 fix: disable SQLModel Relationship() in domain models to prevent init errors 2026-03-05 07:16:48 +01:00
oib
5a09348ded fix: resolve sync and db query errors in Coordinator API jobs and db layers 2026-03-05 06:30:55 +01:00
oib
87591edfa0 fix: integrate missing routes and update CLI commands 2026-03-05 06:23:46 +01:00
oib
a200a50085 chore(config): simplify dependabot configuration and disable enhanced services for CPU-only deployment
- Simplify .github/dependabot.yml from 70 to 49 lines
  - Remove beta ecosystems, custom registries, and detailed ignore rules
  - Reduce open PR limits (npm: 10→5, github-actions: 5→3)
  - Remove custom labels and dependency-specific ignore rules
  - Consolidate npm configs from 2 directories to single root directory
  - Remove docker ecosystem configuration

- Add /health endpoint to coordinator
2026-03-04 16:43:37 +01:00
oib
5534226895 refactor(ports): standardize service ports to 8000-8017 range and update CORS configurations across all services
- Update CORS allow_origins in blockchain-node app.py and gossip relay.py to use new port logic (8000-8016)
- Update coordinator-api config.py and config_pg.py with standardized port ranges and service labels
- Update coordinator-api health check script from port 18000 to 8000
- Update geo_load_balancer.py to use configurable host/port (default 0.0.0.0:8017)
- Update agent_security.py sandbox
2026-03-04 15:43:17 +01:00
oib
50954a4b31 chore(systemd): remove obsolete systemd service files and update infrastructure documentation
- Remove 8 unused systemd service files from coordinator-api/systemd/
  - aitbc-adaptive-learning.service (port 8005)
  - aitbc-advanced-ai.service
  - aitbc-enterprise-api.service
  - aitbc-gpu-multimodal.service (port 8003)
  - aitbc-marketplace-enhanced.service (port 8006)
  - aitbc-modality-optimization.service (port 8004)
  - aitbc-multimodal.service (port 8002)
  - aitbc-openclaw-enhanced.service (port 8007
2026-03-04 12:16:50 +01:00
oib
14d0ed3b44 fix(async): convert PoA proposer methods to async and update coordinator dependencies
- Convert _propose_block, _ensure_genesis_block to async methods in PoAProposer
- Add await to gossip_broker.publish calls in block broadcasting
- Add await to _ensure_genesis_block and _propose_block method calls
- Update coordinator-api Python version constraint to >=3.13,<3.15
- Add torch ^2.10.0 dependency to coordinator-api
- Add make_asgi_app import to prometheus_client in main.py
- Export new routers: global
2026-03-03 15:32:05 +01:00
oib
cabbd2d9b7 refactor(domain): standardize metadata field naming to meta_data across all models
- Rename metadata fields to meta_data for consistency across domain models
- Update agent_identity, agent_performance, agent_portfolio, amm, analytics, bounty, certification, community, cross_chain_bridge, cross_chain_reputation, decentralized_memory, miner, pricing_models, trading, and wallet models
- Rename chain_metadata to chain_meta_data in CrossChainMapping
- Rename verification_metadata to verification_meta_data
2026-03-03 15:01:48 +01:00
oib
f353e00172 chore(security): enhance environment configuration, CI workflows, and wallet daemon with security improvements
- Restructure .env.example with security-focused documentation, service-specific environment file references, and AWS Secrets Manager integration
- Update CLI tests workflow to single Python 3.13 version, add pytest-mock dependency, and consolidate test execution with coverage
- Add comprehensive security validation to package publishing workflow with manual approval gates, secret scanning, and release
2026-03-03 10:33:46 +01:00
oib
c97e101727 docs(plan): update milestone planning to mark phase 6 complete and transition to Q4 2026 global expansion phase
- Update Q3 2026 from "CURRENT PHASE" to "COMPLETED PHASE" with all weeks 13-24 marked complete
- Mark Q4 2026 as "NEXT PHASE" with weeks 25-28 Global Expansion APIs as 🔄 NEXT
- Update priority focus areas from "Next Phase" to "Current Phase" with global expansion emphasis
- Mark Enterprise Integration APIs and Scalability Optimization as  COMPLETE
- Update Phase 4-6 success metrics to  ACHIEVED
2026-03-01 00:34:12 +01:00
oib
7e9ba75f6c feat(coordinator-api): enhance reinforcement learning service with PyTorch-based PPO, SAC, and Rainbow DQN implementations
- Add PyTorch neural network implementations for PPO, SAC, and Rainbow DQN agents with GPU acceleration
- Implement PPOAgent with actor-critic architecture, clip ratio, and entropy regularization
- Implement SACAgent with separate actor and dual Q-function networks for continuous action spaces
- Implement RainbowDQNAgent with dueling architecture and distributional RL (51 atoms
2026-03-01 00:18:14 +01:00
oib
768a0cf8fd feat(coordinator-api,docs): integrate developer platform and governance routers, complete phase 3 documentation
- Add developer_platform and governance_enhanced router imports to coordinator-api main.py
- Include developer_platform and governance_enhanced routers with /v1 prefix
- Refactor governance_service.py delegation logic to use delegatee_id directly and add logging
- Remove redundant session.add() calls, rely on session.refresh() after commit
- Update governance service docstring to reflect multi
2026-02-28 23:32:38 +01:00
oib
d8a432ce33 feat: complete phase 3 developer ecosystem and dao governance 2026-02-28 23:24:26 +01:00
oib
5bc18d684c feat: add phase 2 decentralized memory python services and tests 2026-02-28 23:19:02 +01:00
oib
c63259ef2c feat: finish phase 2 decentralized memory and storage tasks 2026-02-28 23:18:56 +01:00
oib
bf95cd0d9b feat: complete remaining phase 1 tasks - multi-chain wallet, atomic swaps, and multi-region deployment 2026-02-28 23:11:55 +01:00
oib
0e6c9eda72 feat(coordinator-api): integrate dynamic pricing engine with GPU marketplace and add agent identity router
- Add DynamicPricingEngine and MarketDataCollector dependencies to GPU marketplace endpoints
- Implement dynamic pricing calculation for GPU registration with market_balance strategy
- Calculate real-time dynamic prices at booking time with confidence scores and pricing factors
- Enhance /marketplace/pricing/{model} endpoint with comprehensive dynamic pricing analysis
  - Add static vs dynamic price
2026-02-28 22:57:10 +01:00
oib
2d97783fb1 refactor(coordinator-api,blockchain-explorer): add response caching and fix timestamp handling
- Add cached decorator to admin stats, job status, payment status, and marketplace stats endpoints
- Configure cache TTLs using get_cache_config for different endpoint types (1min job_list, 30s user_balance, marketplace_stats)
- Import cache_management router and include it in main app with /v1 prefix
- Fix blockchain-explorer formatTimestamp to handle both ISO string and Unix numeric timestamps with type
2026-02-28 21:50:25 +01:00
oib
93ffaf53de feat(coordinator-api): add database connection pooling configuration and comprehensive payment validation
- Add configurable database connection pool settings (pool_size, max_overflow, pool_recycle, pool_pre_ping, echo)
- Replace hardcoded pool settings with environment-configurable values from settings
- Add QueuePool explicitly to both sync and async database engines
- Implement comprehensive Pydantic validators for payment schemas (JobPaymentCreate, PaymentRequest, ExchangePaymentRequest)
- Add regex
2026-02-28 21:35:58 +01:00
oib
57b12a882a refactor(coordinator-api): enhance startup/shutdown logging and add rate limit metrics endpoint
- Add database connection warmup during startup with connectivity test
- Expand startup logging with comprehensive configuration summary including all rate limits
- Implement graceful shutdown sequence with in-flight request handling and resource cleanup
- Add Prometheus metrics for rate limiting (hits counter and response time histogram)
- Create dedicated /rate-limit-metrics endpoint for rate limit monitoring
- Record
2026-02-28 21:29:08 +01:00
oib
2ec1ceb600 refactor(coordinator-api): make rate limits configurable via environment variables
- Add configurable rate limit settings for all endpoints (jobs, miner, admin, marketplace, exchange)
- Replace hardcoded rate limit decorators with lambda functions reading from settings
- Add rate limit configuration logging during startup
- Implement custom RateLimitExceeded exception handler with structured error responses
- Add enhanced shutdown logging for database cleanup and resource management
- Set default rate
2026-02-28 21:25:46 +01:00
oib
f05195749c feat(coordinator-api): add global exception handler and rate limiting to marketplace and exchange endpoints
- Add general exception handler to catch all unhandled exceptions with structured error responses
- Add structured logging to validation error handler with request context
- Implement slowapi rate limiting on marketplace endpoints (100/min list, 50/min stats, 30/min bid)
- Implement slowapi rate limiting on exchange payment creation (20/min)
- Add Request parameter to rate-limited endpoints for slow
2026-02-28 21:22:37 +01:00
oib
7cb0b30dae refactor: migrate all remaining modules to use shared aitbc.logging from aitbc-core package
- Replace `import logging` with `from aitbc.logging import get_logger` across blockchain-node scripts and coordinator-api modules
- Update logger initialization from `logging.getLogger(__name__)` to `get_logger(__name__)` in 30+ files
- Add production configuration validators for API keys, HMAC secret, and JWT secret in coordinator config
- Enhance coordinator startup with comprehensive initialization logging
2026-02-28 21:17:53 +01:00
oib
f6ee77f497 refactor: consolidate logging to shared aitbc-core package and upgrade database dependencies
- Upgrade SQLAlchemy to 2.0.47 with asyncio extras in blockchain-node and coordinator-api
- Add asyncpg >=0.29.0 for PostgreSQL async support
- Remove uvloop as optional dependency, make it required >=0.22.0
- Delete duplicate logger.py from blockchain-node (117 lines)
- Refactor coordinator-api logging to use shared aitbc.logging from aitbc-core package
- Add aitbc-core package dependency to coordinator
2026-02-28 21:09:14 +01:00
oib
864ef4343e refactor(contracts): remove deprecated AIPowerRental contract in favor of bounty system
- Delete AIPowerRental.sol (566 lines) - replaced by AgentBounty.sol
- Remove rental agreement system with provider/consumer model
- Remove performance metrics and SLA tracking
- Remove dispute resolution mechanism
- Remove ZK-proof verification for performance
- Remove provider/consumer authorization system
- Bounty system provides superior developer incentive structure
2026-02-27 21:46:54 +01:00
oib
a477681c4b feat(developer-ecosystem): implement bounty and staking system with ZK-proof integration
Phase 1 Implementation Complete:
- AgentBounty.sol: Automated bounty board with ZK-proof verification
- AgentStaking.sol: Reputation-based yield farming with dynamic APY
- BountyIntegration.sol: Cross-contract event handling and auto-verification
- Database models: Complete bounty, staking, and ecosystem metrics schemas
- REST APIs: Full bounty and staking management endpoints
- Services: Business logic for bounty creation, verification, and staking operations
- Ecosystem dashboard: Analytics and metrics tracking system

Key Features:
- Multi-tier bounty system (Bronze, Silver, Gold, Platinum)
- Performance-based APY calculation with reputation multipliers
- ZK-proof integration with PerformanceVerifier.sol
- Automatic bounty completion detection
- Comprehensive analytics dashboard
- Risk assessment and leaderboards
- Real-time metrics and predictions

Security Features:
- Reentrancy protection on all contracts
- Role-based access control
- Dispute resolution mechanism
- Early unbonding penalties
- Platform fee collection

Economic Model:
- Creation fees: 0.5%
- Success fees: 2%
- Platform fees: 1%
- Staking APY: 5-20% based on performance
- Dispute fees: 0.1%
2026-02-27 17:51:23 +01:00
oib
27e836bf3f refactor(coordinator): standardize database path to follow blockchain-node pattern
- Change coordinator database from /opt/data/coordinator.db to ./data/coordinator.db
- Update config.py to use relative path consistent with blockchain-node
- Update deployment scripts to use /opt/coordinator-api/data/coordinator.db
- Add data directory creation in init_db() for consistency
- Update .env.example files to reflect new standard
- Maintain backward compatibility for production deployment
2026-02-27 17:32:00 +01:00
oib
7bb2905cca Update database paths and fix foreign key references across coordinator API
- Change SQLite database path from `/home/oib/windsurf/aitbc/data/` to `/opt/data/`
- Fix foreign key references to use correct table names (users, wallets, gpu_registry)
- Replace governance router with new governance and community routers
- Add multi-modal RL router to main application
- Simplify DEPLOYMENT_READINESS_REPORT.md to focus on production deployment status
- Update governance router with decentralized DAO voting
2026-02-26 19:32:06 +01:00
oib
825f157749 Update Python version requirements and fix compatibility issues
- Bump minimum Python version from 3.11 to 3.13 across all apps
- Add Python 3.11-3.13 test matrix to CLI workflow
- Document Python 3.11+ requirement in .env.example
- Fix Starlette Broadcast removal with in-process fallback implementation
- Add _InProcessBroadcast class for tests when Starlette Broadcast is unavailable
- Refactor API key validators to read live settings instead of cached values
- Update database models with explicit
2026-02-24 18:41:08 +01:00
oib
6901e0084f docs/config/packages: add v0.1 release prep, security status, and SDK enhancements
- Add Stage 23 roadmap for v0.1 release preparation with PyPI/npm publishing, deployment automation, and security audit milestones
- Document competitive differentiators: zkML/FHE integration, hybrid TEE/ZK verification, on-chain model marketplace, and geo-low-latency matching
- Update security documentation with smart contract audit results (0 vulnerabilities, 35 OpenZeppelin warnings)
- Add security-first setup
2026-02-19 21:47:28 +01:00
oib
421191ccaf feat: add transaction hash search to blockchain explorer and cleanup settlement storage
Blockchain Explorer:
- Add transaction hash search support (64-char hex pattern validation)
- Fetch and display transaction details in modal (hash, type, from/to, amount, fee, block)
- Fix regex escape sequence in block height validation
- Update search placeholder text to mention both search types
- Add blank lines between function definitions for PEP 8 compliance

Settlement Storage:
- Add timedelta import for future
2026-02-17 14:34:12 +01:00
oib
31d3d70836 feat: add blockchain RPC blocks-range endpoint and marketplace bid listing
Blockchain Node:
- Replace /blocks (pagination) with /blocks-range (height range query)
- Add start/end height parameters with 1000-block max range validation
- Return blocks in ascending height order instead of descending
- Update metrics names (rpc_get_blocks_range_*)
- Remove total count from response (return start/end/count instead)

Coordinator API:
- Add effective_url property to DatabaseConfig (SQLite/PostgreSQL defaults
2026-02-16 22:54:08 +01:00
oib
7062b2cc78 feat: add dark mode, navigation, and Web Vitals tracking to marketplace
Backend:
- Simplify DatabaseConfig: remove effective_url property and project root finder
- Update to Pydantic v2 model_config (replace nested Config class)
- Add web_vitals router to main.py and __init__.py
- Fix ExplorerService datetime handling (ensure timezone-naive comparisons)
- Fix status_label extraction to handle both enum and string job states

Frontend (Marketplace):
- Add dark mode toggle with system preference detection
2026-02-15 19:02:51 +01:00
oib
72e21fd07f feat: show Ollama plugin badge and available LLM models on marketplace cards
Backend:
- Add attributes field to MarketplaceOfferView schema
- Include attributes in _to_offer_view() response

Frontend:
- Add attributes type with Ollama fields to OfferRecord
- Show purple 'Ollama' plugin badge on cards with models
- Display available LLM model tags (gemma3, deepseek-r1, etc.)
- Add plugin-badge and model-tag CSS styles
2026-02-14 16:57:15 +01:00
oib
ba638c3905 feat: switch marketplace to production mode with real GPU offer
Coordinator API:
- Fix MarketplaceService.list_offers() to query DB instead of mock data
- Remove duplicate mock /marketplace/offers endpoint from marketplace_offers.py
- Handle status as string or enum in _to_offer_view()
- Deploy updated domain model with GPU columns to container
- Add GPU columns to marketplaceoffer table in production DB
- Register RTX 4060 Ti 16GB (at1-localhost) as marketplace offer

Marketplace Web:
- Create .env.production (VITE_MARKETPLACE_DATA_MODE=live, API=/api)
- Create vite.config.ts with base: '/marketplace/'
- Rebuild and deploy to server
2026-02-14 16:46:48 +01:00
oib
06e48ef34b chore: standardize configuration, logging, and error handling across blockchain node and coordinator API
- Add infrastructure.md and workflow files to .gitignore to prevent sensitive info leaks
- Change blockchain node mempool backend default from memory to database for persistence
- Refactor blockchain node logger with StructuredLogFormatter and AuditLogger (consistent with coordinator)
- Add structured logging fields: service, module, function, line number
- Unify coordinator config with Database
2026-02-13 22:39:43 +01:00
oib
de5b0f2696 refactor: replace requests with httpx in Bitcoin wallet and blockchain services
- Replace requests.Session with httpx.Client in BitcoinWallet class
- Add graceful fallback when httpx is not available with HTTP_CLIENT_AVAILABLE flag
- Add session null check in _rpc_call to prevent errors when httpx unavailable
- Update get_balance in blockchain service to use httpx.Client context manager
- Add warning log when httpx import fails to disable wallet functions
2026-02-13 16:10:57 +01:00
oib
c984a1e052 chore: enhance security configuration across applications
- Add root-level *.json to .gitignore to prevent wallet backup leaks
- Replace wildcard CORS origins with explicit localhost URLs across all apps
- Add OPTIONS method to CORS allowed methods for preflight requests
- Update coordinator database to use absolute path in data/ directory to prevent duplicates
- Add JWT secret validation in coordinator config (must be set via environment)
- Replace deprecated get_session dependency with Session
2026-02-13 16:07:03 +01:00
oib
65b63de56f docs: update README with comprehensive test results, CLI documentation, and enhanced feature descriptions
- Update key capabilities to include GPU marketplace, payments, billing, and governance
- Expand CLI section from basic examples to 12 command groups with 90+ subcommands
- Add detailed test results table showing 208 passing tests across 6 test suites
- Update documentation links to reference new CLI reference and coordinator API docs
- Revise test commands to reflect actual test structure (
2026-02-12 20:58:21 +01:00
oib
5120861e17 feat: add GPU-specific fields to marketplace offers and create dedicated GPU marketplace router
- Add GPU fields (model, memory, count, CUDA version, price, region) to MarketplaceOffer model
- Create new marketplace_gpu router for GPU-specific operations
- Update offer sync to populate GPU fields from miner capabilities
- Move GPU attributes from generic attributes dict to dedicated fields
- Update MarketplaceOfferView schema with GPU fields
- Expand CLI README with comprehensive documentation and
2026-02-12 19:08:17 +01:00