strat-gameplay-webapp/backend
Cal Corum fa3fadd14c CLAUDE: Implement uncapped hit decision UI + backend bugfixes (Issue #7)
Frontend: Full 5-phase interactive wizard for uncapped hit decisions
(lead advance, defensive throw, trail advance, throw target, safe/out)
with mobile-first design, offense/defense role switching, and auto-
clearing on workflow completion.

Backend fixes:
- Remove nested asyncio.Lock acquisition causing deadlocks in all
  submit_uncapped_* methods and initiate_uncapped_hit (non-re-entrant)
- Preserve pending_manual_roll during interactive workflows
- Add league_id to all dice_system.roll_d20() calls
- Extract D20Roll.roll int for state serialization
- Fix batter-runner not advancing when non-targeted in throw
- Fix rollback_plays not recalculating scores from remaining plays

Files: 10 modified, 1 new (UncappedHitWizard.vue)
Tests: 2481/2481 passing

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-12 13:54:57 -06:00
..
.claude CLAUDE: Add configurable regulation_innings and outs_per_inning 2025-11-19 20:06:57 -06:00
.git-hooks CLAUDE: Fix all unit test failures and implement 100% test requirement 2025-11-04 19:35:21 -06:00
alembic CLAUDE: RosterLink refactor for bench players with cached player data 2026-01-17 22:15:12 -06:00
app CLAUDE: Implement uncapped hit decision UI + backend bugfixes (Issue #7) 2026-02-12 13:54:57 -06:00
scripts CLAUDE: Add test game creation utilities 2025-11-19 16:30:29 -06:00
terminal_client CLAUDE: Fix RunnerAdvancementData tuple unpacking regression 2025-11-28 23:11:26 -06:00
tests CLAUDE: Implement uncapped hit interactive decision tree (Issue #6) 2026-02-12 09:33:58 -06:00
.dockerignore CLAUDE: Fix Docker build for UV migration 2025-11-04 09:19:30 -06:00
.env.dev CLAUDE: Improve UX with single-click OAuth, enhanced games list, and layout fix 2025-12-05 16:14:00 -06:00
.env.example CLAUDE: Implement server-side OAuth flow with HttpOnly cookies 2025-11-26 22:16:30 -06:00
.env.network CLAUDE: Add --network flag to dev-native.sh for cross-device testing 2026-02-06 18:09:01 -06:00
.env.prod CLAUDE: Improve UX with single-click OAuth, enhanced games list, and layout fix 2025-12-05 16:14:00 -06:00
.gitignore CLAUDE: Add pages/ to backend gitignore 2025-11-20 23:57:25 -06:00
.python-version CLAUDE: Add native development workflow for instant startup and hot-reload 2026-02-06 17:56:56 -06:00
alembic.ini CLAUDE: Add Alembic migrations and database session injection 2025-11-28 12:09:09 -06:00
CLAUDE.md CLAUDE: Implement uncapped hit interactive decision tree (Issue #6) 2026-02-12 09:33:58 -06:00
clean_test_data.py CLAUDE: Refactor game models and modularize terminal client 2025-10-28 14:16:38 -05:00
docker-compose.yml CLAUDE: Complete Phase 1 backend infrastructure setup 2025-10-21 19:46:16 -05:00
Dockerfile CLAUDE: Add SBA schedule integration with weekly matchup display 2026-01-14 23:39:31 -06:00
mypy.ini CLAUDE: Refactor GameEngine to forward-looking play tracking pattern 2025-10-25 22:18:15 -05:00
pyproject.toml CLAUDE: Replace black and flake8 with ruff for formatting and linting 2025-11-20 15:33:21 -06:00
pyrightconfig.json Clean up false positive Pylance errors 2025-10-23 09:10:41 -05:00
pytest.ini CLAUDE: Complete Week 4 - State Management & Persistence 2025-10-22 12:01:03 -05:00
README.md CLAUDE: Update documentation across codebase 2025-11-28 12:10:10 -06:00
requirements-dev.txt CLAUDE: Complete Phase 1 backend infrastructure setup 2025-10-21 19:46:16 -05:00
requirements.txt CLAUDE: Add interactive terminal client for game engine testing 2025-10-26 12:51:01 -05:00
TEST_COVERAGE_SUMMARY.md CLAUDE: Phase 2 test infrastructure + comprehensive documentation 2025-11-05 12:39:32 -06:00
test_db_playground.py Add scripts to test models in dev database 2025-10-23 09:10:55 -05:00
test_pd_api_live.py CLAUDE: Phase 3E-Main - Position Ratings Integration for X-Check Resolution 2025-11-03 21:00:37 -06:00
test_pd_api_mock.py CLAUDE: Phase 3E-Main - Position Ratings Integration for X-Check Resolution 2025-11-03 21:00:37 -06:00
test_redis_cache.py CLAUDE: Phase 3E-Final - Redis Caching & X-Check WebSocket Integration 2025-11-03 22:46:59 -06:00
uv.lock CLAUDE: Replace black and flake8 with ruff for formatting and linting 2025-11-20 15:33:21 -06:00

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

# Apply database migrations
uv run alembic upgrade head

# Run server
uv run python -m app.main

Database Migrations

This project uses Alembic for database schema migrations.

Initial Setup (New Database)

# Apply all migrations to create schema
uv run alembic upgrade head

Creating New Migrations

# Auto-generate from model changes
uv run alembic revision --autogenerate -m "Description of changes"

# IMPORTANT: Always review the generated migration before applying!
# Then apply:
uv run alembic upgrade head

Viewing Migration Status

# Show migration history
uv run alembic history

# Show current revision
uv run alembic current

Rolling Back

# Rollback one migration
uv run alembic downgrade -1

# Rollback to specific revision
uv run alembic downgrade 001

# Rollback all (dangerous!)
uv run alembic downgrade base

Migration Best Practices

  1. Always review auto-generated migrations before applying - autogenerate is helpful but not perfect
  2. Test migrations on dev/staging before production
  3. Keep migrations small and focused - easier to rollback
  4. Never edit migrations that have been applied to shared databases
  5. Include both upgrade and downgrade for reversibility

Existing Migrations

Revision Description
001 Initial schema (games, plays, lineups, rolls, etc.)
004 Materialized views for statistics

Documentation

See CLAUDE.md for full documentation.