New tavolo-scopa package with a pure rules engine and the platform adapters for two-player scopa and four-player fixed-partnership scopa a quattro: three cards each and four on the table, capture by rank or sum, sweep for scope and score carte/denara/settebello/primiera. The optional asso pigliatutto creation option turns either variant into scopa d'assi (an ace sweeps the whole table and scores no scopa), reusing scopone's rule semantics. Wire both engines into the app and the Docker install, add the scopa table view to the SPA (duo and four-seat layouts, deck count, captured/scope stats, hand-summary and final screens, player names in the two-player summary), and cover the rules, the platform contract, the REST/WebSocket flows, match persistence and Elo.
tavolo-app
The deployable tavolo application: the composition root wiring
tavolo-platform to the
tavolo-scopone,
tavolo-scopa and
tavolo-briscola games.
Contents
app.py— assembles theKayaApp(session/OIDC/Tortoise/OpenAPI mixins plusPlatformMixinand the deadline scheduler), registers theScoponeEngine,ScopaEngine,ScopaQuattroEngine,BriscolaEngine,BriscolaQuattroEngineandBriscolaChiamataEnginewith their configured timeouts, and exposestavolo.app:appfor granian.config.py— environment-driven frozenSettings.telemetry.py— the optional OpenTelemetry wiring beyond kaya-otel: meter/tracer/logger providers, thetavolo.active_users/tavolo.ongoing_gamesgauges (polled from the stores), process/CPython metrics viaopentelemetry-instrumentation-system-metrics, Postgres/Redis query spans via the asyncpg/redis instrumentations, and OTLP log export.aerich_config.py— Tortoise ORM configuration consumed by the aerich CLI (migrations live inserver/migrations/; aerich itself is configured via the[tool.aerich]section ofserver/pyproject.toml).logging_config.py— logging setup.static.py— SPA shell hosting for the compiled frontend.
Development (from packages/tavolo-app/)
.venv/bin/python -m mypy --namespace-packages --explicit-package-bases \
src/tavolo/app.py \
src/tavolo/config.py \
src/tavolo/telemetry.py \
src/tavolo/static.py \
src/tavolo/aerich_config.py \
src/tavolo/logging_config.py
End-to-end coverage of the wired stack lives in server/tests/.