chore: exclude .windsurf, test-results, wallet files from git tracking
This commit is contained in:
@@ -1,8 +0,0 @@
|
||||
---
|
||||
description: docs/done.md docs/roadmap.md
|
||||
auto_execution_mode: 3
|
||||
---
|
||||
|
||||
update docs/done.md docs/roadmap.md first
|
||||
and after all others in docs/
|
||||
but not in docs/bootstrap/
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: lowest-effort
|
||||
auto_execution_mode: 3
|
||||
---
|
||||
|
||||
Identify the lowest-effort task in docs/roadmap.md and code it now
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: do the git thing
|
||||
auto_execution_mode: 3
|
||||
---
|
||||
|
||||
do the git thing
|
||||
@@ -1,97 +0,0 @@
|
||||
---
|
||||
description: Workflow for managing and documenting issues from current to resolved
|
||||
---
|
||||
|
||||
# Issue Management Workflow
|
||||
|
||||
This workflow handles the lifecycle of issues from identification to resolution and archival.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
// turbo
|
||||
- Ensure you have write access to the docs directory
|
||||
- Check if the issue is already tracked in docs/currentissue.md
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Identify New Issue
|
||||
```bash
|
||||
# Check if currentissue.md already exists and has content
|
||||
cat /home/oib/windsurf/aitbc/docs/currentissue.md
|
||||
```
|
||||
|
||||
### 2. Document Issue in currentissue.md
|
||||
If tracking a new issue:
|
||||
- Add section with clear, descriptive title
|
||||
- Include date, status, description
|
||||
- List affected components
|
||||
- Document attempted fixes
|
||||
- Update status regularly
|
||||
|
||||
### 3. Monitor Progress
|
||||
- Update the issue status as work progresses
|
||||
- Add resolution details when fixed
|
||||
- Include code changes, configuration updates, etc.
|
||||
|
||||
### 4. When Issue is Resolved
|
||||
```bash
|
||||
# Move to issues folder with machine-readable name
|
||||
mv /home/oib/windsurf/aitbc/docs/currentissue.md \
|
||||
/home/oib/windsurf/aitbc/docs/issues/YYYY-MM-DD_brief-description.md
|
||||
|
||||
# Example:
|
||||
# mv docs/currentissue.md docs/issues/2026-01-29_cross-site-sync-resolved.md
|
||||
```
|
||||
|
||||
### 5. Create New Empty currentissue.md
|
||||
```bash
|
||||
# Create fresh currentissue.md
|
||||
cat > /home/oib/windsurf/aitbc/docs/currentissue.md << 'EOF'
|
||||
# Current Issues
|
||||
|
||||
*No current issues to report.*
|
||||
|
||||
---
|
||||
|
||||
## Usage Guidelines
|
||||
|
||||
When tracking a new issue:
|
||||
1. Add a new section with a descriptive title
|
||||
2. Include the date and current status
|
||||
3. Describe the issue, affected components, and any fixes attempted
|
||||
4. Update status as progress is made
|
||||
5. Once resolved, move this file to `docs/issues/` with a machine-readable name
|
||||
|
||||
## Recent Resolved Issues
|
||||
|
||||
See `docs/issues/` for resolved issues and their solutions.
|
||||
EOF
|
||||
```
|
||||
|
||||
## Naming Convention for Archived Issues
|
||||
|
||||
Use format: `YYYY-MM-DD_brief-description.md`
|
||||
- Date: Year-Month-Day of resolution
|
||||
- Description: Brief, lowercase, hyphen-separated summary
|
||||
- Examples:
|
||||
- `2026-01-29_cross-site-sync-resolved.md`
|
||||
- `2026-01-15_pytest-warnings-fixed.md`
|
||||
- `2026-01-10_database-migration-issue.md`
|
||||
|
||||
## Best Practices
|
||||
|
||||
1. **For Complex Issues**: Use `docs/currentissue.md` as the central tracking document
|
||||
2. **Regular Updates**: Update status daily for active issues
|
||||
3. **Detailed Resolution**: Document root cause and solution clearly
|
||||
4. **Cross-References**: Link to related code changes, PRs, or documentation
|
||||
5. **Archive Promptly**: Move resolved issues within 24 hours of resolution
|
||||
|
||||
## Integration with Other Workflows
|
||||
|
||||
- Use with `/docs` workflow to keep documentation current
|
||||
- Reference resolved issues in `docs/done.md`
|
||||
- Link technical details in `docs/reports/` as needed
|
||||
|
||||
## Memory Aid
|
||||
|
||||
Remember: For hard-to-track or complex issues spanning multiple components, always use `docs/currentissue.md` as the single source of truth for current status and resolution progress.
|
||||
@@ -1,10 +0,0 @@
|
||||
---
|
||||
description: Identify the most important first step and do it.
|
||||
auto_execution_mode: 3
|
||||
---
|
||||
|
||||
Identify the most important first step and do it.
|
||||
if
|
||||
No tasks are currently in progress.
|
||||
then
|
||||
Check docs/roadmap.md and carry out the next recommended step.
|
||||
@@ -1,116 +0,0 @@
|
||||
---
|
||||
description: Complete Ollama GPU provider test workflow from client submission to blockchain recording
|
||||
---
|
||||
|
||||
# Ollama GPU Provider Test Workflow
|
||||
|
||||
This workflow executes the complete end-to-end test for Ollama GPU inference jobs, including payment processing and blockchain transaction recording.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
// turbo
|
||||
- Ensure all services are running: coordinator, GPU miner, Ollama, blockchain node
|
||||
- Verify home directory wallets are configured
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Environment Check
|
||||
```bash
|
||||
# Check service health
|
||||
./scripts/aitbc-cli.sh health
|
||||
curl -s http://localhost:11434/api/tags
|
||||
systemctl is-active aitbc-host-gpu-miner.service
|
||||
```
|
||||
|
||||
### 2. Run Complete Test
|
||||
```bash
|
||||
# Execute the full workflow test
|
||||
cd /home/oib/windsurf/aitbc/home
|
||||
python3 test_ollama_blockchain.py
|
||||
```
|
||||
|
||||
### 3. Verify Results
|
||||
The test will display:
|
||||
- Initial wallet balances
|
||||
- Job submission and ID
|
||||
- Real-time job progress
|
||||
- Inference result from Ollama
|
||||
- Receipt details with pricing
|
||||
- Payment confirmation
|
||||
- Final wallet balances
|
||||
- Blockchain transaction status
|
||||
|
||||
### 4. Manual Verification (Optional)
|
||||
```bash
|
||||
# Check recent receipts
|
||||
curl -H "X-Api-Key: REDACTED_CLIENT_KEY" \
|
||||
http://127.0.0.1:18000/v1/explorer/receipts?limit=3
|
||||
|
||||
# Verify blockchain transaction
|
||||
curl -s http://aitbc.keisanki.net/rpc/transactions | \
|
||||
python3 -c "import sys, json; data=json.load(sys.stdin); \
|
||||
[print(f\"TX: {t['tx_hash']} - Block: {t['block_height']}\") \
|
||||
for t in data.get('transactions', [])[-5:]]"
|
||||
```
|
||||
|
||||
## Expected Output
|
||||
|
||||
```
|
||||
🚀 Ollama GPU Provider Test with Home Directory Users
|
||||
============================================================
|
||||
|
||||
💰 Initial Wallet Balances:
|
||||
----------------------------------------
|
||||
Client: 9365.0 AITBC
|
||||
Miner: 1525.0 AITBC
|
||||
|
||||
📤 Submitting Inference Job:
|
||||
----------------------------------------
|
||||
Prompt: What is the capital of France?
|
||||
Model: llama3.2:latest
|
||||
✅ Job submitted: <job_id>
|
||||
|
||||
⏳ Monitoring Job Progress:
|
||||
----------------------------------------
|
||||
State: QUEUED
|
||||
State: RUNNING
|
||||
State: COMPLETED
|
||||
|
||||
📊 Job Result:
|
||||
----------------------------------------
|
||||
Output: The capital of France is Paris.
|
||||
|
||||
🧾 Receipt Information:
|
||||
Receipt ID: <receipt_id>
|
||||
Provider: REDACTED_MINER_KEY
|
||||
Units: <gpu_seconds> gpu_seconds
|
||||
Unit Price: 0.02 AITBC
|
||||
Total Price: <price> AITBC
|
||||
|
||||
⛓️ Checking Blockchain:
|
||||
----------------------------------------
|
||||
✅ Transaction found on blockchain!
|
||||
TX Hash: <tx_hash>
|
||||
Block: <block_height>
|
||||
|
||||
💰 Final Wallet Balances:
|
||||
----------------------------------------
|
||||
Client: <new_balance> AITBC
|
||||
Miner: <new_balance> AITBC
|
||||
|
||||
✅ Test completed successfully!
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
If the test fails:
|
||||
1. Check GPU miner service status
|
||||
2. Verify Ollama is running
|
||||
3. Ensure coordinator API is accessible
|
||||
4. Check wallet configurations
|
||||
5. Verify blockchain node connectivity
|
||||
|
||||
## Related Skills
|
||||
|
||||
- ollama-gpu-provider - Detailed test documentation
|
||||
- blockchain-operations - Blockchain node management
|
||||
@@ -1,7 +0,0 @@
|
||||
---
|
||||
description: run script and debug
|
||||
auto_execution_mode: 3
|
||||
---
|
||||
|
||||
run script and debug
|
||||
rerun script
|
||||
@@ -1,6 +0,0 @@
|
||||
---
|
||||
description: still same issue
|
||||
auto_execution_mode: 3
|
||||
---
|
||||
|
||||
still same issue
|
||||
@@ -1,211 +0,0 @@
|
||||
---
|
||||
description: Test and debug workflow for AITBC platform
|
||||
auto_execution_mode: 3
|
||||
---
|
||||
|
||||
# Test and Debug Workflow
|
||||
|
||||
This workflow helps you run tests and debug issues in the AITBC platform.
|
||||
|
||||
## Steps
|
||||
|
||||
### 1. Run All Integration Tests
|
||||
```bash
|
||||
# Run all integration tests
|
||||
cd /home/oib/windsurf/aitbc
|
||||
python -m pytest tests/integration/test_full_workflow.py -v --no-cov
|
||||
|
||||
# Run with detailed output
|
||||
python -m pytest tests/integration/test_full_workflow.py -v --no-cov -s --tb=short
|
||||
```
|
||||
|
||||
### 2. Run Specific Test Classes
|
||||
```bash
|
||||
# Test wallet payment flow
|
||||
python -m pytest tests/integration/test_full_workflow.py::TestWalletToCoordinatorIntegration::test_job_payment_flow -v --no-cov -s
|
||||
|
||||
# Test marketplace integration
|
||||
python -m pytest tests/integration/test_full_workflow.py::TestMarketplaceIntegration::test_service_listing_and_booking -v --no-cov -s
|
||||
|
||||
# Test security integration
|
||||
python -m pytest tests/integration/test_full_workflow.py::TestSecurityIntegration::test_end_to_end_encryption -v --no-cov -s
|
||||
```
|
||||
|
||||
### 3. Debug Test Failures
|
||||
```bash
|
||||
# Run with pdb on failure
|
||||
python -m pytest tests/integration/test_full_workflow.py -v --no-cov --pdb
|
||||
|
||||
# Run with verbose output and show local variables
|
||||
python -m pytest tests/integration/test_full_workflow.py -v --no-cov -s --tb=long
|
||||
|
||||
# Stop on first failure
|
||||
python -m pytest tests/integration/test_full_workflow.py -v --no-cov -x
|
||||
```
|
||||
|
||||
### 4. Check Test Coverage
|
||||
```bash
|
||||
# Run tests with coverage
|
||||
python -m pytest tests/integration/test_full_workflow.py --cov=apps/coordinator-api --cov-report=html
|
||||
|
||||
# View coverage report
|
||||
open htmlcov/index.html
|
||||
```
|
||||
|
||||
### 5. Debug Services
|
||||
```bash
|
||||
# Check if coordinator API is running
|
||||
curl http://localhost:18000/v1/health
|
||||
|
||||
# Check if wallet daemon is running
|
||||
curl http://localhost:20000/api/v1/health
|
||||
|
||||
# Check if exchange is running
|
||||
curl http://localhost:23000/api/health
|
||||
|
||||
# Check if marketplace is accessible
|
||||
curl https://aitbc.bubuit.net/marketplace
|
||||
```
|
||||
|
||||
### 6. View Logs
|
||||
```bash
|
||||
# View coordinator API logs
|
||||
docker logs aitbc-coordinator-api -f
|
||||
|
||||
# View wallet daemon logs
|
||||
docker logs aitbc-wallet-daemon -f
|
||||
|
||||
# View exchange logs
|
||||
docker logs aitbc-exchange -f
|
||||
```
|
||||
|
||||
### 7. Test Payment Flow Manually
|
||||
```bash
|
||||
# Create a job with AITBC payment
|
||||
curl -X POST http://localhost:18000/v1/jobs \
|
||||
-H "X-Api-Key: REDACTED_CLIENT_KEY" \
|
||||
-H "Content-Type: application/json" \
|
||||
-d '{
|
||||
"payload": {
|
||||
"job_type": "ai_inference",
|
||||
"parameters": {"model": "gpt-4", "prompt": "Test"}
|
||||
},
|
||||
"payment_amount": 100,
|
||||
"payment_currency": "AITBC"
|
||||
}'
|
||||
|
||||
# Check payment status
|
||||
curl http://localhost:18000/v1/jobs/{job_id}/payment \
|
||||
-H "X-Api-Key: REDACTED_CLIENT_KEY"
|
||||
```
|
||||
|
||||
### 8. Common Debug Commands
|
||||
```bash
|
||||
# Check Python environment
|
||||
python --version
|
||||
pip list | grep -E "(fastapi|sqlmodel|pytest|httpx)"
|
||||
|
||||
# Check database connection
|
||||
psql -h localhost -U aitbc -d aitbc -c "\dt"
|
||||
|
||||
# Check running services
|
||||
ps aux | grep -E "(coordinator|wallet|exchange)"
|
||||
|
||||
# Check network connectivity
|
||||
netstat -tlnp | grep -E "(18000|20000|23000)"
|
||||
```
|
||||
|
||||
### 9. Performance Testing
|
||||
```bash
|
||||
# Run tests with performance profiling
|
||||
python -m pytest tests/integration/test_full_workflow.py --profile
|
||||
|
||||
# Load test payment endpoints
|
||||
ab -n 100 -c 10 http://localhost:18000/v1/health
|
||||
```
|
||||
|
||||
### 10. Clean Test Environment
|
||||
```bash
|
||||
# Clean pytest cache
|
||||
rm -rf .pytest_cache
|
||||
|
||||
# Clean coverage files
|
||||
rm -rf htmlcov .coverage
|
||||
|
||||
# Reset test database
|
||||
dropdb aitbc_test && createdb aitbc_test
|
||||
```
|
||||
|
||||
## Troubleshooting
|
||||
|
||||
### Common Issues
|
||||
|
||||
1. **Import Error: No module named 'app.schemas.payments'**
|
||||
- The test is using mock client (expected in CI)
|
||||
- Real client requires full environment setup
|
||||
|
||||
2. **ModuleNotFoundError: No module named 'requests'**
|
||||
- Install requests: `pip install requests`
|
||||
- Check if in correct Python environment
|
||||
|
||||
3. **Connection Refused Errors**
|
||||
- Check if services are running on expected ports
|
||||
- Verify docker containers are up: `docker ps`
|
||||
|
||||
4. **Payment Test Fails**
|
||||
- Ensure wallet daemon is running
|
||||
- Check exchange API is accessible
|
||||
- Verify AITBC token balance
|
||||
|
||||
5. **Marketplace Test Fails**
|
||||
- Check internet connectivity
|
||||
- Verify marketplace URL is accessible
|
||||
- May need to skip if network issues
|
||||
|
||||
### Debug Tips
|
||||
|
||||
1. Use `--pdb` to drop into debugger on failure
|
||||
2. Use `-s` to see print statements
|
||||
3. Use `--tb=long` for detailed tracebacks
|
||||
4. Use `-x` to stop on first failure
|
||||
5. Check logs for service errors
|
||||
6. Verify environment variables are set
|
||||
|
||||
## Test Categories
|
||||
|
||||
### Unit Tests
|
||||
```bash
|
||||
# Run unit tests only
|
||||
python -m pytest tests/unit/ -v
|
||||
```
|
||||
|
||||
### Integration Tests
|
||||
```bash
|
||||
# Run integration tests only
|
||||
python -m pytest tests/integration/ -v
|
||||
```
|
||||
|
||||
### End-to-End Tests
|
||||
```bash
|
||||
# Run e2e tests only
|
||||
python -m pytest tests/e2e/ -v
|
||||
```
|
||||
|
||||
### Security Tests
|
||||
```bash
|
||||
# Run security tests
|
||||
python -m pytest tests/security/ -v
|
||||
```
|
||||
|
||||
## Quick Test Commands
|
||||
|
||||
```bash
|
||||
# Quick test run
|
||||
pytest tests/ -x -q
|
||||
|
||||
# Full test suite
|
||||
pytest tests/ --cov
|
||||
|
||||
# Debug specific test
|
||||
pytest tests/integration/test_full_workflow.py::TestWalletToCoordinatorIntegration::test_job_payment_flow -v -s
|
||||
```
|
||||
Reference in New Issue
Block a user