# 2026-03-13 ## Session Start - First session: Identity bootstrap completed. - Assigned identity: **aitbc1** (AI code reviewer/developer agent) - Vibe: Analytical, precise, straightforward, efficient - Emoji: 🔍 - User: Andreas Michael Fleckl (Andreas) - Project: AITBC — AI Agent Compute Network ## Initial Exploration - Located project at `/opt/aitbc`. - Reviewed README.md: Decentralized GPU marketplace for AI agents. - Installed CLI in virtualenv: `pip install -e ./cli`. - Discovered immediate import errors due to hardcoded paths. ## Bugs Found ### 1. CLI fails to launch — hardcoded absolute paths Multiple command modules in `cli/aitbc_cli/commands/` contain: ```python sys.path.append('/home/oib/windsurf/aitbc/apps/coordinator-api/src/app/services') ``` This path does not exist on this system and is non-portable. The modules are: - `surveillance.py` (imports `trading_surveillance`) - `ai_trading.py` - `ai_surveillance.py` - `advanced_analytics.py` - `regulatory.py` Impact: Entire CLI crashes on import with `ModuleNotFoundError`. The CLI is unusable out of the box. Recommendation: Convert these to proper package imports or lazy imports with graceful degradation. Consider packaging shared service modules as a separate dependency if needed. ### 2. Missing dependency specification CLI's `pyproject.toml` does not include `aiohttp` (required by `kyc_aml_providers.py`). We installed it manually to proceed. Also missing any dependency on coordinator-api services. Recommendation: Add missing dependencies to the project's requirements or optional extras. ### 3. Agent SDK package broken `packages/py/aitbc-agent-sdk` lacks `README.md`, causing poetry build to fail with `FileNotFoundError`. This blocks installation of that package. Fix: Add an empty or proper README.md. ### 4. Test scripts use absolute paths `run_all_tests.sh` references `/home/oib/windsurf/aitbc/test_scenario_*.sh` and `/home/oib/windsurf/aitbc/test_multi_site.py`. These are user-specific and won't work on other machines. Recommendation: Replace with paths relative to project root, e.g., `$(dirname "$0")/test_scenario_a.sh`. ### 5. Docker Compose not detected `docker-compose` is not in PATH; system may only have `docker compose`. The project instructions assume `docker-compose`. Could be robustified. ## Tests Executed - Installed and ran tests for `aitbc-crypto`: 2 passed. - Installed and ran tests for `aitbc-sdk`: 12 passed. - `aitbc-core` has no tests. - `aitbc-agent-sdk` could not be installed due to missing README. ## Feature Suggestions 1. **Optional command plugins**: Use entry points to load commands only when their dependencies are available, preventing CLI crash. 2. **Diagnostic command**: `aitbc doctor` to check environment, dependencies, and service connectivity. 3. **Improved setup script**: A single script to set up virtualenv and install all packages with correct dependencies. 4. **Documentation**: Quick start guide for developers new to the repo. 5. **Test runner portability**: Use project-root relative paths and detect available services gracefully. ## Next Steps (pending user input) - Wait for guidance on how to coordinate with sibling instance. - Await hints on which bugs to fix next. - Possibly set up proper services to test runtime behavior. ## Actions Completed - Applied all fixes and committed to repository (commit 1feeadf). - CLI now loads successfully: `aitbc --help` works out of the box. - Coordinator API running (port 8000) with idempotent DB init (commit merged to main). - Switched to standard RPC port 8006; node P2P port 8005. - Pinned Starlette to >=0.37.2,<0.38 to retain Broadcast module (required for P2P gossip). - Added redis dependency; configured broadcast backend. - Systemd services patched to use coordinator-api venv (or dedicated blockchain-node venv). - Created wallet `aitbc1aitbc1_simple_simple` and minted 3000 via faucet on devnet. - Pushed branch `aitbc1/debug-services` with all fixes (commits: 1feeadf, 8fee73a, 4c2ada6, others). - Verified both nodes can run; Redis active on both hosts; alignment in progress for P2P peering. - Updated protocol: always use CLI tool; debug and push; coordinate with sibling via Gitea. - Identified production concerns: Redis broadcast is dev-only; needs secure direct P2P for internet deployment. ## P2P & Gift Progress - Both nodes configured for `ait-devnet`. - Gossip backend: `broadcast` with Redis URL. - My node RPC: `http://10.1.223.40:8006` (running). - Awaiting sibling's wallet address and RPC health to finalize peer connection and send test transaction. - Final milestone: send AITBC coins from aitbc's wallet to aitbc1's wallet on the shared chain. ## Important Technical Notes - Starlette Broadcast removed in 0.38 → must pin <0.38. - Redis pub/sub is central broker; not suitable for production internet without auth/TLS. - Wallet address pattern: `_simple` for simple wallet type. - Coordinator DB: made `init_db()` idempotent by catching duplicate index errors. - CLI command path: `/opt/aitbc/cli/cli_venv/bin/aitbc`. ## AI Provider & Marketplace Coordination (later 2026-03-13) - Implemented AI provider daemon commands: - `aitbc ai serve` starts FastAPI server on port 8008, Ollama model `qwen3:8b` - `aitbc ai request` sends prompt, pays provider on-chain, verifies balance delta - Payment flow: buyer CLI runs `blockchain send` first, then POSTs to provider's `/job` - Balance verification: provider balance before/after printed, delta shown - Provider optionally registers jobs with coordinator marketplace (`--marketplace-url` default `http://127.0.0.1:8014`) - Job lifecycle: POST `/v1/jobs` → provider processes → PATCH `/v1/jobs/{job_id}` with result - GPU marketplace CLI extended with `gpu unregister` (DELETE endpoint) to remove stale registrations - Services running: coordinator-api on 8000, wallet daemon on 8015 - Local test successful: payment + Ollama response in single command - Cross-host test pending (aitbc → aitbc1) - All changes pushed to branch `aitbc1/debug-services`