Issue #5 from code review - resolve_play and resolve_manual_play shared ~70% of their code causing maintenance burden and divergent behavior risk. Changes: - Extracted common finalization logic to new _finalize_play() method - resolve_play reduced from ~150 lines to ~60 lines - resolve_manual_play reduced from ~135 lines to ~60 lines - Single source of truth for: roll tracking, state capture, transaction handling, inning advance, cleanup, and state updates Benefits: - Changes to play finalization only need to be made in one place - Reduced risk of divergent behavior between resolution modes - Better testability and maintainability All 739 unit tests passing (1 flaky probabilistic test occasionally fails). 🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude <noreply@anthropic.com> |
||
|---|---|---|
| .. | ||
| .claude | ||
| .git-hooks | ||
| alembic/versions | ||
| app | ||
| scripts | ||
| terminal_client | ||
| tests | ||
| .dockerignore | ||
| .env.example | ||
| .python-version | ||
| CLAUDE.md | ||
| clean_test_data.py | ||
| docker-compose.yml | ||
| Dockerfile | ||
| mypy.ini | ||
| pyproject.toml | ||
| pyrightconfig.json | ||
| pytest.ini | ||
| README.md | ||
| requirements-dev.txt | ||
| requirements.txt | ||
| TEST_COVERAGE_SUMMARY.md | ||
| test_db_playground.py | ||
| test_pd_api_live.py | ||
| test_pd_api_mock.py | ||
| test_redis_cache.py | ||
| uv.lock | ||
Paper Dynasty Backend
FastAPI-based real-time baseball game engine with WebSocket support.
Quick Start
# Install UV
curl -LsSf https://astral.sh/uv/install.sh | sh
# Install dependencies
uv sync
# Run server
uv run python -m app.main
Documentation
See CLAUDE.md for full documentation.