7 documents covering stack, integrations, architecture, structure, conventions, testing, and concerns.
4.1 KiB
4.1 KiB
Technology Stack
Analysis Date: 2026-04-01
Languages
Primary:
- Python 3.11+ — all application code (enforced via
pyproject.tomlrequires-python = ">=3.11")
Type Annotations:
- Full
from __future__ import annotationsusage throughout typing.Protocolused for dependency inversion (core/store.py,sdk/interface.py)
Runtime
Environment:
- CPython — runtime (development host currently runs 3.14.3)
- Minimum: Python 3.11 (uses
match-compatible union syntax,Self,X | Ytype hints)
Package Manager:
uv0.9.30 (Homebrew)- Lockfile:
uv.lockpresent and committed - Install:
uv sync
Frameworks
Telegram Bot:
aiogram3.26.0 — async Telegram Bot API framework- Used in
adapter/telegram/(planned; directory not yet present in main branch) - Brings in
aiohttp3.13.3 as its HTTP transport
- Used in
Matrix Bot:
matrix-nio0.25.2 — async Matrix Client-Server API client- Used in
adapter/matrix/bot.py - Key classes:
AsyncClient,AsyncClientConfig,RoomMessageText,ReactionEvent,InviteMemberEvent,RoomMemberEvent,MatrixRoom - Long-polling via
client.sync_forever(timeout=30000)
- Used in
Data Validation:
pydantic2.12.5 — data models insdk/interface.pyUser,Attachment,MessageResponse,MessageChunk,UserSettings,AgentEvent,PlatformError- Core protocol structs (
core/protocol.py) use plaindataclassesinstead
Build/Dev:
setuptools≥68 +setuptools-scm+wheel— build backend (pyproject.toml)ruff0.15.8 — linting and import sorting (line-length = 100,target-version = "py311", rules: E, F, I, UP, B)mypy1.19.1 — static type checking
Key Dependencies
Critical:
aiogram>=3.4,<4(resolved: 3.26.0) — Telegram adapter; pin avoids breaking v4 APImatrix-nio>=0.21(resolved: 0.25.2) — Matrix adapter; async-only clientpydantic>=2.5(resolved: 2.12.5) — SDK interface models; v2 required (v1 incompatible)
Infrastructure:
structlog25.5.0 — structured logging throughout; used viastructlog.get_logger(__name__)python-dotenv1.2.2 — loads.envat bot startup (load_dotenv(Path(...) / ".env"))httpx0.28.1 — available for HTTP calls (future SDK integration, not yet used in core logic)
Async I/O:
aiohttp3.13.3 — transitive via aiogram; provides HTTP session to Telegram Bot APIasyncio— stdlib; used directly insdk/mock.py(asyncio.sleepfor latency simulation) and all bot entry points (asyncio.run(main()))
Testing
Runner:
pytest9.0.2pytest-asyncio1.3.0 —asyncio_mode = "auto"(set inpyproject.toml)pytest-cov7.1.0 — coverage reporting
Configuration:
pyproject.toml[tool.pytest.ini_options]:testpaths = ["tests"],pythonpath = ["."]conftest.pyat project root
Internal Module Structure
Core (no external deps except stdlib + pydantic via sdk):
core/protocol.py—dataclasses-based unified event typescore/store.py—StateStoreProtocol +InMemoryStore(dict) +SQLiteStore(stdlibsqlite3)core/handler.py—EventDispatchercore/auth.py,core/chat.py,core/settings.py— domain managers
SDK Layer:
sdk/interface.py—PlatformClientProtocol (pydantic models)sdk/mock.py—MockPlatformClientin-process stub; simulates latency viaasyncio.sleep
Adapters:
adapter/matrix/— matrix-nio integration (active)adapter/telegram/— aiogram integration (referenced in deps, worktree branch exists)
Configuration
Environment:
- Loaded from
.envviapython-dotenvat startup - See
INTEGRATIONS.mdfor full variable list
Build:
pyproject.toml— single source of truth for deps, build, lint, test config
Platform Requirements
Development:
- Python ≥3.11
uvfor dependency management
Production:
- Any environment with Python ≥3.11
- Matrix bot: requires writable filesystem path for
matrix_store/(nio E2EE store) and SQLite DB - Telegram bot: stateless beyond env vars (or optionally SQLite for persistence)
Stack analysis: 2026-04-01