Files
aitbc/pyproject.toml
aitbc 573aae065b
Some checks failed
API Endpoint Tests / test-api-endpoints (push) Successful in 56s
Blockchain Synchronization Verification / sync-verification (push) Failing after 3s
CLI Tests / test-cli (push) Failing after 5s
Coverage Phase 1 (70% Target) / test-coverage-70 (push) Failing after 19s
Coverage Phase 2 (85% Target) / test-coverage-85 (push) Failing after 18s
Cross-Chain Functionality Tests / test-cross-chain-sync (push) Successful in 3s
Cross-Chain Functionality Tests / test-cross-chain-transactions (push) Successful in 4s
Cross-Chain Functionality Tests / test-multi-chain-consensus (push) Successful in 5s
Deploy to Testnet / deploy-testnet (push) Failing after 21s
Documentation Validation / validate-docs (push) Failing after 13s
Documentation Validation / validate-policies-strict (push) Successful in 4s
Integration Tests / test-service-integration (push) Failing after 2s
Multi-Chain Island Architecture Tests / test-multi-chain-island (push) Successful in 4s
Multi-Node Blockchain Health Monitoring / health-check (push) Failing after 14s
Node Failover Simulation / failover-test (push) Successful in 9s
P2P Network Verification / p2p-verification (push) Successful in 5s
Package Tests / Python package - aitbc-agent-sdk (push) Successful in 51s
Package Tests / Python package - aitbc-core (push) Failing after 3s
Package Tests / Python package - aitbc-crypto (push) Successful in 22s
Package Tests / Python package - aitbc-sdk (push) Successful in 16s
Package Tests / JavaScript package - aitbc-sdk-js (push) Successful in 21s
Package Tests / JavaScript package - aitbc-token (push) Failing after 18s
Production Tests / Production Integration Tests (push) Failing after 1m9s
Python Tests / test-python (push) Failing after 3s
Security Scanning / security-scan (push) Failing after 41s
Smart Contract Tests / test-solidity (map[name:aitbc-contracts path:contracts]) (push) Failing after 6s
Smart Contract Tests / test-solidity (map[name:aitbc-token path:packages/solidity/aitbc-token]) (push) Failing after 7s
Smart Contract Tests / test-foundry (push) Failing after 20s
Smart Contract Tests / lint-solidity (push) Failing after 4s
Smart Contract Tests / deploy-contracts (push) Failing after 5s
Cross-Chain Functionality Tests / aggregate-results (push) Successful in 2s
Multi-Node Stress Testing / stress-test (push) Successful in 2s
Cross-Node Transaction Testing / transaction-test (push) Successful in 3s
feat: complete codebase remediation with all phases
Phase 1: Security fixes
- Added CORSMiddleware to marketplace-service with specific origins
- Fixed blockchain-node auth to fail closed on JWT errors
- Added security regression tests (test_cors_configuration.py, test_dispute_auth.py)

Phase 2: Repository cleanup
- Removed 51 fix/backup/legacy files
- Deleted marketplace-service-debug directory

Phase 3.1: Python version constraints
- Updated aitbc-crypto and aitbc-sdk with requires-python >=3.13
- Added explicit [tool.poetry].packages declarations

Phase 3.2: Agent service DI architecture
- Created aitbc-agent-core package with protocols and shared service
- Implemented adapters for agent-management and coordinator-api
- Created factory functions for gradual migration
- Added migration comments to existing integration files

Phase 4.1: Auth/utils extraction
- Created auth.py module with JWT validation and security utilities
- Created utils.py module with common helpers

Phase 4.2: Router decomposition
- Decomposed router.py into 10 domain modules (58 endpoints)
- Created route table snapshot for verification
- Preserved router_old.py as reference

Phase 5: App shell classification
- Documented app shell patterns across services

Phase 6: Quality gates
- Verified mypy type checking (75% error reduction)
- Analyzed logging inconsistencies with structlog migration plan
- Removed unused orjson dependency

Documentation:
- Created comprehensive remediation report
- Added architecture documentation for DI pattern
- Added quality analysis documents
2026-05-24 20:21:23 +02:00

258 lines
6.0 KiB
TOML

[tool.poetry]
name = "aitbc"
version = "0.6.0"
description = "AI Agent Compute Network - Main Project"
authors = ["AITBC Team"]
[tool.poetry.dependencies]
python = ">=3.13.5,<3.14"
# Core Web Framework
fastapi = ">=0.115.6"
uvicorn = {extras = ["standard"], version = ">=0.34.0"}
gunicorn = ">=23.0.0"
starlette = ">=0.49.1"
# Database & ORM
sqlalchemy = {extras = ["asyncio"], version = ">=2.0.49"}
sqlmodel = ">=0.0.38"
alembic = ">=1.18.4"
aiosqlite = ">=0.20.0"
asyncpg = ">=0.30.0"
# Configuration & Environment
pydantic = ">=2.11.0"
pydantic-settings = ">=2.13.1"
python-dotenv = ">=1.1.0"
# Rate Limiting & Security
slowapi = ">=0.1.9"
limits = ">=5.8.0"
prometheus-client = ">=0.21.1"
# HTTP Client & Networking
httpx = ">=0.28.1"
requests = ">=2.32.4"
urllib3 = ">=2.7.0"
aiohttp = ">=3.12.14"
aiostun = ">=0.1.0"
# Cryptocurrency & Blockchain
cryptography = ">=46.0.0"
pynacl = ">=1.6.2"
base58 = ">=2.1.1"
bech32 = ">=1.2.0"
web3 = ">=7.15.0"
eth-account = ">=0.13.7"
# Data Processing
pandas = ">=2.2.3"
numpy = ">=2.2.0"
# Machine Learning & AI
torch = ">=2.11.0"
torchvision = ">=0.26.0"
# CLI Tools
click = ">=8.3.2"
rich = ">=14.3.3"
typer = ">=0.24.1"
click-completion = ">=0.5.2"
tabulate = ">=0.10.0"
colorama = ">=0.4.6"
keyring = ">=25.7.0"
# JSON & Serialization
msgpack = ">=1.1.2"
python-multipart = ">=0.0.27"
# Logging & Monitoring
structlog = ">=25.1.0"
sentry-sdk = ">=2.20.0"
# Utilities
python-dateutil = ">=2.9.0"
pytz = ">=2026.1"
schedule = ">=1.2.2"
aiofiles = ">=25.1.0"
pyyaml = ">=6.0.2"
# Async Support
asyncio-mqtt = ">=0.16.2"
websockets = ">=14.1.0"
# Image Processing (for AI services)
pillow = ">=11.1.0"
opencv-python = ">=4.11.0"
# Additional Dependencies
redis = ">=5.2.1"
psutil = ">=6.1.0"
tenseal = ">=0.3.0"
idna = ">=3.7"
hypothesis = "^6.152.4"
[tool.poetry.group.dev.dependencies]
pytest = "9.0.3"
pytest-asyncio = "1.3.0"
pytest-timeout = "2.4.0"
black = "24.4.2"
flake8 = "7.3.0"
ruff = "0.15.10"
mypy = "2.0.0"
isort = "8.0.1"
pre-commit = "4.5.1"
bandit = "1.9.4"
pydocstyle = "6.3.0"
pyupgrade = "3.21.2"
safety = "3.7.0"
pytest-cov = "6.0.0"
types-requests = ">=2.32.0"
types-PyYAML = ">=6.0.0"
types-python-dateutil = ">=2.9.0"
[tool.black]
line-length = 127
target-version = ['py313']
include = '\.pyi?$'
extend-exclude = '''
/(
# directories
\.eggs
| \.git
| \.hg
| \.mypy_cache
| \.tox
| \.venv
| build
| dist
)/
'''
[tool.isort]
profile = "black"
line_length = 127
multi_line_output = 3
include_trailing_comma = true
force_grid_wrap = 0
use_parentheses = true
ensure_newline_before_comments = true
[tool.mypy]
python_version = "3.13"
exclude = "^apps/(agent-management|agent-coordinator|agent-services|blockchain-node|computing-node|identity-node|marketplace|mining-pool)/.*"
warn_return_any = true
warn_unused_configs = true
# Tightened mypy configuration for better type safety
check_untyped_defs = true
disallow_incomplete_defs = true
disallow_untyped_defs = true
disallow_untyped_decorators = true
no_implicit_optional = true
warn_redundant_casts = true
warn_unused_ignores = true
warn_no_return = true
warn_unreachable = true
strict_equality = true
strict_optional = true
[[tool.mypy.overrides]]
module = [
"torch.*",
"cv2.*",
"pandas.*",
"numpy.*",
"web3.*",
"eth_account.*",
"sqlalchemy.*",
"alembic.*",
"uvicorn.*",
"fastapi.*",
]
ignore_missing_imports = true
[[tool.mypy.overrides]]
module = [
"apps.coordinator-api.src.app.routers.*",
"apps.coordinator-api.src.app.services.*",
"apps.coordinator-api.src.app.storage.*",
"apps.coordinator-api.src.app.utils.*",
"apps.coordinator-api.src.app.domain.global_marketplace",
"apps.coordinator-api.src.app.domain.cross_chain_reputation",
"apps.coordinator-api.src.app.domain.agent_identity",
]
ignore_errors = true
[[tool.mypy.overrides]]
module = [
"apps.agent-management.*",
"apps.agent-coordinator.*",
"apps.agent-services.*",
"apps.blockchain-node.*",
"apps.computing-node.*",
"apps.identity-node.*",
"apps.marketplace.*",
"apps.mining-pool.*",
]
ignore_errors = true
[tool.ruff]
line-length = 127
target-version = "py313"
[tool.ruff.lint]
select = [
"E", # pycodestyle errors
"W", # pycodestyle warnings
"F", # pyflakes
"I", # isort
"B", # flake8-bugbear
"C4", # flake8-comprehensions
"UP", # pyupgrade
"E722", # bare except (explicitly enforce)
"G", # logging-string-format (enforce f-strings in logging)
"LOG", # logging best practices
]
ignore = [
"E501", # line too long, handled by black
"B008", # do not perform function calls in argument defaults
"C901", # too complex
"G001", # logging-string-format (allow for now, migration in progress)
"G002", # logging-string-format (allow for now, migration in progress)
]
[tool.ruff.lint.per-file-ignores]
"__init__.py" = ["F401"]
"tests/*" = ["B011"]
[tool.pydocstyle]
convention = "google"
add_ignore = ["D100", "D101", "D102", "D103", "D104", "D105", "D106", "D107"]
[tool.pytest.ini_options]
asyncio_mode = "auto"
asyncio_default_fixture_loop_scope = "function"
minversion = "8.0"
addopts = "-ra -q --strict-markers --strict-config --cov=apps --cov=packages --cov=cli --cov-report=term-missing --cov-report=html --cov-fail-under=50"
testpaths = ["tests"]
python_files = ["test_*.py", "*_test.py"]
python_classes = ["Test*"]
python_functions = ["test_*"]
markers = [
"slow: marks tests as slow (deselect with '-m \"not slow\"')",
"integration: marks tests as integration tests",
"unit: marks tests as unit tests",
]
[tool.coverage.run]
source = ["apps", "packages", "cli"]
omit = [
"*/tests/*",
"*/test_*.py",
"*/__pycache__/*",
"*/migrations/*",
"*/venv/*",
]
[tool.coverage.report]
exclude_lines = [
"pragma: no cover",
"def __repr__",
"raise AssertionError",
"raise NotImplementedError",
"if __name__ == .__main__.:",
"if TYPE_CHECKING:",
"@abstractmethod",
]
[build-system]
requires = ["poetry-core>=1.0.0"]
build-backend = "poetry.core.masonry.api"