Thank you for improving TeleAutomata. This project favors maintainability and operational safety over feature count, so contributions are reviewed against the existing architecture rather than added beside it.
Requires Python 3.12+.
python -m venv .venv
# Windows: .\.venv\Scripts\Activate.ps1
# Unix: source .venv/bin/activate
pip install -e ".[dev]"Tests use in-memory SQLite and a fake gateway; they never contact Telegram or require credentials.
Every change must pass the full quality gate — the same checks CI runs on every push and pull request:
ruff check .
ruff format --check .
mypy src
pytest
python -m buildRun ruff format . to apply formatting before committing. Keep mypy src
strict-clean; Telethon's untyped surface is isolated at the adapter boundary,
not by weakening strictness project-wide.
The codebase is ports and adapters — see docs/architecture.md. Please respect these boundaries:
- Keep all
telethonimports insideinfrastructure/. The rest of the code depends on theTelegramGatewayprotocol indomain/ports.py. - Translate every Telegram exception at the anti-corruption boundary in
infrastructure/telegram.pyinto a domain error (RateLimitError,TransientActionError,PermanentActionError). The engine alone decides whether an error is retryable. - Validate action arguments in
application/actions.py, close to the operation they belong to.
- Add the type to the
ActionTypeliteral inworkflows/schema.py. - Validate its arguments and dispatch it in
application/actions.py. - Add a typed method to
TelegramGateway(domain/ports.py) and implement it onTelethonGatewayandNullGateway. - Add tests for the success, transient-failure, and permanent-failure paths.
- Document authorization and pacing expectations.
- Write focused, logical commits with clear messages (this project uses
Conventional Commit prefixes such as
feat:,fix:,test:,docs:). - Do not commit secrets,
.env, session files, or the localdata/database. - Include tests with behavioral changes and update the relevant docs.
Never automate accounts or entities you are not authorized to manage. Report security concerns privately rather than in a public issue — see SECURITY.md for how. The operational security model is documented in docs/security.md.